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

Test and Upgrade to React 17 #24485

Closed
youknowriad opened this issue Aug 11, 2020 · 8 comments
Closed

Test and Upgrade to React 17 #24485

youknowriad opened this issue Aug 11, 2020 · 8 comments
Assignees
Labels
Framework Issues related to broader framework topics, especially as it relates to javascript [Status] In Progress Tracking issues with work in progress
Projects

Comments

@youknowriad
Copy link
Contributor

The React team announced React 17 RC1. It’s a major release with some breaking changes.
You can read the full post here https://reactjs.org/blog/2020/08/10/react-v17-rc.html
We will be able to start upgrading React when it's stabilized and supported by react-native.

In the meantime, we can start testing and analyzing how impactful the breaking changes will be and how to roll out the release on Core.

My first impression after reading the release post is that it's not impactful and while some breakage is always possible, we might be able to upgrade to 17 easily.

Of course, a dev note will be required to announce that change on the WordPress release but I don't expect the need for extra-communication. This might be needed for future upgrades but our use of StrictMode is putting us in a good position since deprecated APIs are already receiving warnings.

Thoughts.

@youknowriad youknowriad added the Framework Issues related to broader framework topics, especially as it relates to javascript label Aug 11, 2020
@gziolo gziolo added this to To do in Core JS Oct 14, 2020
@gziolo gziolo moved this from To do to In progress in Core JS Dec 12, 2020
@gziolo gziolo mentioned this issue Dec 12, 2020
3 tasks
@gziolo gziolo added the [Status] In Progress Tracking issues with work in progress label Dec 12, 2020
@swissspidy
Copy link
Member

Is thee also an issue for using the new JSX transforms?

@youknowriad
Copy link
Contributor Author

Not that I know of but it was definitely on my mind :)

@gziolo gziolo moved this from In progress to Done in Core JS Jun 21, 2021
@gziolo
Copy link
Member

gziolo commented Jun 21, 2021

This one was accomplished with #29118 🎉

Is thee also an issue for using the new JSX transforms?

This part wasn't covered. I'm wondering how much work it is to replace our custom approach with the official one. They seem to be compatible though.

@gziolo gziolo closed this as completed Jun 21, 2021
@ocean90
Copy link
Member

ocean90 commented Jul 27, 2021

@gziolo It looks like the React update wasn't documented in any changelog which means the change in @wordpress/element was released as a minor release while it should have been a major release I think. Now packages like @wordpress/data also require React 17 which doesn't mention that new requirement in the changelog. This is mostly an issue where the packages are used outside of the regular WordPress/Gutenberg context and an upgrade to React 17 isn't possible yet.

I guess it's too late to handle that now but wanted to mention anyway as a reminder for future updates.

Edit: Not sure how feasible that is, but one option might be to support v16 and v17 in @wordpress/element?

@gziolo
Copy link
Member

gziolo commented Jul 27, 2021

@ocean90, good catch. It's definitely a huge deal.

Do you think we could downgrade React to 16.13.x and publish a patch release, then add an entry in the changelog and bump again to 17.0.x to ensure that all other packages pick it up correctly next time we publish all changed packages?

We could also check if making React and React DOM a peer dependency would work in this case. Not sure what npm 7 would install by default in that case though. Projects using npm 6 would have to explicitly set React as a dependency.

@gziolo
Copy link
Member

gziolo commented Jul 28, 2021

I haven't figured out how to make the current version of @wordpress/element compatible with React 16 and 17.

However, I have PR with entries to all CHANGELOG files in packages that ship React components: #33731. This will at least trigger a major version bump. We can try to fix @wordpress/element` v3.2.0 afterwards.

@gziolo
Copy link
Member

gziolo commented Jul 29, 2021

We have new major version of packages published to npm in case they contain React components: 4e106dd.

The remaining question is what we can do about @wordpress/element v3.2.0, any ideas?

@ocean90
Copy link
Member

ocean90 commented Jul 29, 2021

Is it possible two create a branch based on the publish commit for @wordpress/element v3.2.0? If so, we could try to revert the changes from #29118 only in this branch and do a patch release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Framework Issues related to broader framework topics, especially as it relates to javascript [Status] In Progress Tracking issues with work in progress
Projects
No open projects
Core JS
  
Done
Development

Successfully merging a pull request may close this issue.

4 participants