react-i13n
react-i13n copied to clipboard
React I13n 3.0.0
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
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:
-
AwesomeComponent
attempts to use bothcontextType
andcontextTypes
to consume multiple contexts which results in a warning.contextTypes
will be ignored in this case. -
AwesomeComponentWithRenderProps
shows consuming multiple contexts using renderProps. -
AwesomeComponentWithUseContext
shows consuming multiple contexts withuseContext
.
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);
@roderickhsiao whats the status of this?
Also what are your thoughts on introducing hooks?
@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
Hi @roderickhsiao , is there any task unassigned that I can help with upgrading react-i13n to 3.0.0 ?
If anyone can help https://github.com/yahoo/react-i13n/pull/259 will unblock the biggest task for 3.0.0 :)
@roderickhsiao my yearly check-in on this migration work. What is left to be done? Looks like #259 was merged a while ago.
I think only documentation left, the code should be stable enough.
@redonkulus I'll try removing grunt and modernize the build probably this week or next
@roderickhsiao awesome. lets make sure the docs are ok too. I think they are based on your context PR.
then we can get 3.0.0 published and out of alpha.
3.0.0 has been released, we can close this now.