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

Upgrade React #753

Merged
merged 2 commits into from
Jun 14, 2021
Merged

Upgrade React #753

merged 2 commits into from
Jun 14, 2021

Conversation

tlgimenes
Copy link
Contributor

@tlgimenes tlgimenes commented Jun 9, 2021

What's the purpose of this pull request?

Add support for react 18.

How it works?

React 18 is currently shipping its first alpha version. After the release of this alpha version, the experimental branch of React, that is currently being used in our stores, promoted the unsable_createRoot API to createRoot. In order to not be in sync with the nightly builds of react, and since we were using a very old release of react, this PR supports React 18.

With this, I also enabled the FAST_DEV, DEV_SSR and PARALLEL_SOURCING flags in all repos.

How to test it?

Test the deploy previews on these links:
https://github.com/vtex-sites/btglobal.store/pull/609
https://github.com/vtex-sites/storecomponents.store/pull/975
https://github.com/vtex-sites/marinbrasil.store/pull/519
https://github.com/vtex-sites/carrefourbrfood.store/pull/769

@netlify
Copy link

netlify bot commented Jun 9, 2021

✔️ Deploy Preview for storeui ready!

🔨 Explore the source changes: 1e57d01

🔍 Inspect the deploy log: https://app.netlify.com/sites/storeui/deploys/60c4b431a63c510007798655

😎 Browse the preview: https://deploy-preview-753--storeui.netlify.app

@tlgimenes tlgimenes changed the title upgrade react deps Upgrade React Jun 9, 2021
@codesandbox-ci
Copy link

codesandbox-ci bot commented Jun 9, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 1e57d01:

Sandbox Source
Store UI Typescript Configuration

@tlgimenes tlgimenes marked this pull request as ready for review June 11, 2021 15:44
@tlgimenes tlgimenes requested a review from a team as a code owner June 11, 2021 15:44
@emersonlaurentino
Copy link
Member

You should use the npm version on store repositories.

@lbebber
Copy link
Contributor

lbebber commented Jun 11, 2021

Not sure about removing StrictMode. If anything, there are additional benefits on using StrictMode on React 18, rather than not needing it anymore: Troubleshooting on reactwg/react-18#6 plus reactwg/react-18#19

It's supposed to help catching concurrent-mode borne issues, among other things

@tlgimenes
Copy link
Contributor Author

I'm removing from root because Gatsby is not compatible with strict mode. This makes us have two versions of the same page being rendered on the screen for instance.

However, I agree with you. Maybe we should add strict mode to wrap the page element. This way we skip Gatsby but keep our code compatible with strict mode. I'll see if I find any error while doing this

@tlgimenes tlgimenes merged commit 6aaa224 into master Jun 14, 2021
@tlgimenes tlgimenes deleted the upgrade-react-v2 branch June 14, 2021 19:49
bentoper pushed a commit that referenced this pull request Jun 17, 2021
* upgrade react deps

* use strict mode in dev only
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants