-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use new Context API in React 16.3 #10868
Comments
Regarding backward compatibility: https://github.com/jamiebuilds/create-react-context |
@leMaik I'm not sure that using create-react-context will be a wise call to make.
I start to believe the best approach would be to rely on the old context API up until React 17.0.0 land and introduce a breaking change to move to the new API. Let's wait and see what the community is doing. I don't think that we need to be bleeding edge on this topic. |
I would prefer dropping support for React < 16.3 in 1.0.0. People will hate us, but they'll need to effectively rewrite their app anyway when they update. Also, React 16.x is very stable, API-wise, so upgrading from React 16.0 to 16.3 to 16.x should be easy. Regarding the metrics of the package: Didn't look at that, missing issues and 1.4 kB overhead are a pretty big no-go. |
@leMaik We will at least drop React < 16.0 support between 1.0.0-beta.x and 1.0.0. |
@oliviertassinari Any updates on that? Are there any plans on dropping support of React < 16.3 for 1.0.0. Just considering moving to new context api for material-ui-pickers. But don't want to force the community migrate to React 16.3 till material-ui not. |
@dmtrKovalenko We will drop support for React 15.x in Material-UI v1. There is no plan for dropping React 16.0. I think that we will wait for Material-UI v2. |
Be careful. React 16.4 will start warn about deprecated api. Waiting react 17 is a case only for application. All third party libraries has only 16.3 - 16.4 migration period. create react context is used across many libs before dropping react < 16.3 support. PRs are open, so all possible problems are fixable. |
@TrySound I believe that we have fixed all the deprecation warnings introduced in React 16.3. Unless the React team plans on adding new ones, we should be good on waiting React 17. If they do, we will release Material-UI v2 sooner than expected and drop < React 16.3 support. I wish we can wait +6 months between v1 and v2. We plan on releasing Material-UI v1 May 17th. The timing is short. |
Hi @oliviertassinari I am using React 16.3 and MUI next beta.44 in a project and I seed the following warnings coming from |
@willopez Make sure you use the most up to date version of react-hot-loader. |
Nevermind, I didn't notice the dates on this thread, I see that React 16.3.0 is required as of version |
@eps1lon We are pretty much done with this task no? I think that we can close. |
|
@eps1lon People can already use |
That's still alpha though. I guess it's ok since we want to migrate |
@oliviertassinari I'm confused, do you consider the new React context API a form of dependency injection? Or is there a branch of material-ui/styles that uses something different? |
@jedwards1211 |
Cool, i was nervous when I saw "DI" 🤣 |
There's a new render prop/children-as-function API for context that just came in React 16.3.0.
The big thing that's relevant to us: It works across
shouldComponentUpdate
boundaries without the need for subscriptions.It will require some refactoring. And backward compatibility is going to be...interesting. We may have to drop backward compatibility to make the implementation clean. FWIW, React Router and React Redux is considering this too, so we're not alone.
The text was updated successfully, but these errors were encountered: