Skip to content
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

[core] Drop support for React 16 #25464

Merged
merged 1 commit into from
Mar 23, 2021
Merged

Conversation

eps1lon
Copy link
Member

@eps1lon eps1lon commented Mar 22, 2021

BREAKING CHANGE

Official support for React 16 is discontinued.

Note that for now you can still use the library with React ^16.14.0.
This changes simplifies development for us a lot since we no longer have to consider certain behavior for two versions. This became especially problematic for event behavior when using the DOM.

Bundle size changes are expected since we're using the new jsx runtime.

Follow-up to #25416

https://reactjs.org/blog/2020/10/20/react-v17.html

@eps1lon eps1lon mentioned this pull request Mar 22, 2021
12 tasks
@eps1lon eps1lon added the core Infrastructure work going on behind the scenes label Mar 22, 2021
@eps1lon eps1lon marked this pull request as draft March 22, 2021 11:46
@mui-pr-bot
Copy link

mui-pr-bot commented Mar 22, 2021

Details of bundle changes

@material-ui/core: parsed: +0.39% , gzip: +0.33%
@material-ui/lab: parsed: +0.55% , gzip: +0.43%

Generated by 🚫 dangerJS against bda3910

@eps1lon eps1lon force-pushed the core/drop-react-16 branch from bb16215 to bda3910 Compare March 22, 2021 11:58
@eps1lon eps1lon marked this pull request as ready for review March 22, 2021 12:43
@eps1lon eps1lon merged commit 5e0037a into mui:next Mar 23, 2021
@eps1lon eps1lon deleted the core/drop-react-16 branch March 23, 2021 09:02
eps1lon added a commit to eps1lon/material-ui that referenced this pull request Mar 23, 2021
@NMinhNguyen
Copy link
Contributor

Bundle size changes are expected since we're using the new jsx runtime.

Oh is this because the new runtime is actually bigger?

@eps1lon
Copy link
Member Author

eps1lon commented Mar 25, 2021

Oh is this because the new runtime is actually bigger?

Because it's not bundled if you're not using it. The new runtime has a separate entry point (react/jsx-*) instead of being imported from react which cannot be tree-shaken at the moment.

@NMinhNguyen
Copy link
Contributor

Oh is this because the new runtime is actually bigger?

Because it's not bundled if you're not using it. The new runtime has a separate entry point (react/jsx-*) instead of being imported from react which cannot be tree-shaken at the moment.

Ah got it, so the increased size is due to the old runtime in react (that can't be tree-shaken despite being unused), and MUI using the new react/jsx-* entrypoint.

@eps1lon
Copy link
Member Author

eps1lon commented Mar 25, 2021

(that can't be tree-shaken despite being unused)

It's still used in some cases and will be for some time. TL;DR: key + spread needs to cover different combinations. https://gist.github.com/eps1lon/61f12fc47facba60b7572b38b6084285 includes a summary and additional resources.

ChristopherChudzicki added a commit to mitodl/open-discussions that referenced this pull request Jul 15, 2022
I'm going o try @mui (material-ui changed its name to @mui in version 5) and it requires react ^17 but says it should work with 16.14

mui/material-ui#25464
ChristopherChudzicki added a commit to mitodl/open-discussions that referenced this pull request Jul 20, 2022
I'm going o try @mui (material-ui changed its name to @mui in version 5) and it requires react ^17 but says it should work with 16.14

mui/material-ui#25464
ChristopherChudzicki added a commit to mitodl/open-discussions that referenced this pull request Jul 22, 2022
* move variables back to open-discussions, start inf theming

* remove banner from infinite homepage

* bump react to 16.14

I'm going o try @mui (material-ui changed its name to @mui in version 5) and it requires react ^17 but says it should work with 16.14

mui/material-ui#25464

* Add mui-based search textbox

* Make all <Searchbox /> instances controlled inputs

* use searchinput in searchbox

* Separate searchbox and searchinput tests

* remove some old code

* remove exclusive test

* make field links pretty

* add some tests

* format

* better mobile padding

* reset api between tests

* update yarn lock after rebase

* update linting/formatting
ChristopherChudzicki added a commit to mitodl/open-discussions that referenced this pull request Jul 22, 2022
* move variables back to open-discussions, start inf theming

* remove banner from infinite homepage

* bump react to 16.14

I'm going o try @mui (material-ui changed its name to @mui in version 5) and it requires react ^17 but says it should work with 16.14

mui/material-ui#25464

* Add mui-based search textbox

* Make all <Searchbox /> instances controlled inputs

* use searchinput in searchbox

* Separate searchbox and searchinput tests

* remove some old code

* remove exclusive test

* make field links pretty

* add some tests

* format

* better mobile padding

* reset api between tests

* update yarn lock after rebase

* update linting/formatting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change core Infrastructure work going on behind the scenes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants