react-i13n icon indicating copy to clipboard operation
react-i13n copied to clipboard

React I13n 3.0.0

Open roderickhsiao opened this issue 5 years ago • 10 comments

Use as a master tracker for 3.0.0 release.

Enhancement:

  • [x] [3.0.0-alpha.0] Modernize package, publishing ES module and CJS
  • [x] Move to new React context API #190
  • [x] Use new React forward ref API
  • [ ] Modernize build, and make sure test run reliably
  • [x] Replace deprecated React lifecycle
  • [ ] Update documentation and tests

Good to have enhancement

  • [x] [3.0.0-alpha.1] React.lazy Dashboard so better code spilt if the feature is not enabled.
  • [x] [3.0.0-alpha.1] Use component to write DebugMessage #23
  • [x] Remove proptypes for production build
  • [x] Rewrite viewport detect logic using intersection observer #182 #103
  • [ ] Use React to render DebugDashboard root component

Breaking Changes

  • [x] [3.0.0-alpha.0] Drop mixin usage
  • [x] [3.0.0-alpha.0] Drop deprecated props followLink
  • [x] [3.0.0-alpha.0] Remove Node 6 supports (EOL 2019-04-30)
  • [x] [3.0.0-alpha.1] Require React 16.6
  • [x] [3.0.0-alpha.5] require intersection-observer polyfill if you are need to support browsers doesnt have the function
  • [x] [3.0.0-alpha.5] Switch to hook so server side won't behave the same as before

[3.0.0-alpha.0] #218
[3.0.0-alpha.1] #226 [3.0.0-alpha.2] #228 [3.0.0-alpha.3] #229 [3.0.0-alpha.5] #259

roderickhsiao avatar Mar 25 '19 19:03 roderickhsiao

Regarding the move to the new context api (#190), I created a sample repo with some of the issues we're facing today: https://github.com/antonychan/react-i13n-context. Hopefully can provide you some use cases to work with!

We have some components that consume more than one context. We can get around that issue now by using a higher-order-component like withI13nContext in the repo passes down the i13n context object as a prop to its children.

In the repo, I created three components that consume multiple contexts in different ways:

  1. AwesomeComponent attempts to use both contextType and contextTypes to consume multiple contexts which results in a warning. contextTypes will be ignored in this case.

  2. AwesomeComponentWithRenderProps shows consuming multiple contexts using renderProps.

  3. AwesomeComponentWithUseContext shows consuming multiple contexts with useContext.

In the renderProps example, moving to the new context API (and exposing the consumer) should allow us to nest multiple consumers (https://reactjs.org/docs/context.html#consuming-multiple-contexts)

In the useContext example, seems like it would be useful if we could use an exposed I13nContext:

const i13nContext = useContext(I13nContext);
const someContext = useContext(SomeContext);

antonychan avatar Mar 26 '19 18:03 antonychan

@roderickhsiao whats the status of this?

Also what are your thoughts on introducing hooks?

redonkulus avatar May 27 '20 13:05 redonkulus

@redonkulus going to try the context for the next change, hopefully I can made it.

I think internally we can use hook, and provide both hooks and HOC externally (for people using class) to access i13n method, this we should be able to simplified the logic

roderickhsiao avatar May 27 '20 18:05 roderickhsiao

Hi @roderickhsiao , is there any task unassigned that I can help with upgrading react-i13n to 3.0.0 ?

danhuang1202 avatar Jul 21 '20 15:07 danhuang1202

If anyone can help https://github.com/yahoo/react-i13n/pull/259 will unblock the biggest task for 3.0.0 :)

roderickhsiao avatar Jul 21 '20 19:07 roderickhsiao

@roderickhsiao my yearly check-in on this migration work. What is left to be done? Looks like #259 was merged a while ago.

redonkulus avatar Mar 16 '22 22:03 redonkulus

I think only documentation left, the code should be stable enough.

roderickhsiao avatar Mar 16 '22 22:03 roderickhsiao

@redonkulus I'll try removing grunt and modernize the build probably this week or next

roderickhsiao avatar Mar 30 '22 02:03 roderickhsiao

@roderickhsiao awesome. lets make sure the docs are ok too. I think they are based on your context PR.

redonkulus avatar Mar 30 '22 02:03 redonkulus

then we can get 3.0.0 published and out of alpha.

redonkulus avatar Mar 30 '22 02:03 redonkulus

3.0.0 has been released, we can close this now.

redonkulus avatar Apr 17 '23 23:04 redonkulus