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

Updates CRA from v4 to v5 #771

Merged
merged 7 commits into from Oct 19, 2022
Merged

Updates CRA from v4 to v5 #771

merged 7 commits into from Oct 19, 2022

Conversation

shayneczyzewski
Copy link
Sponsor Contributor

@shayneczyzewski shayneczyzewski commented Oct 17, 2022

Description

Updates Create React App from v4 to v5. It is pretty straightforward:

The only drag is we do have a couple of deprecation warnings (however, this is a known CRA5 issue that will hopefully be fixed soon: facebook/create-react-app#11860):

Web app (stderr): (node:10363) [DEP_WEBPACK_DEV_SERVER_ON_AFTER_SETUP_MIDDLEWARE] DeprecationWarning: 'onAfterSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
Web app (stderr): (Use `node --trace-deprecation ...` to show where the warning was created)
Web app (stderr): (node:10363) [DEP_WEBPACK_DEV_SERVER_ON_BEFORE_SETUP_MIDDLEWARE] DeprecationWarning: 'onBeforeSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
Web app (stderr): Starting the development server...

If we really wanted to hide it, we could filter the web app output.

Fixes most deprecation warnings from: #181 (The only ones left are stable, w3c-hr-time, and svgo. But down from 21 before upgrade. And far fewer npm audit errors.)

The goal for this is to make it easier to add Tailwind support as a next step (https://tailwindcss.com/docs/guides/create-react-app).

Type of change

Please select the option(s) that is more relevant.

  • Code cleanup
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

⚠️Help Wanted⚠️

How should I be thinking about testing this? I ran the existing apps and they seem ok. Since CRA helps with frontend in dev mode, deployment should not be a concern, right? Anything else to consider/test/validate?

("react-scripts", "4.0.3"),
-- NOTE: We need to specify this exact version of `react-error-overlay` for use with
-- `react-scripts` v4 due to this issue: https://github.com/facebook/create-react-app/issues/11773
("react-error-overlay", "6.0.9")
Copy link
Sponsor Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a CRA4-only bug.

@shayneczyzewski shayneczyzewski changed the title Updates CRA from v4 to v5 Draft: Updates CRA from v4 to v5 Oct 18, 2022
@shayneczyzewski shayneczyzewski changed the title Draft: Updates CRA from v4 to v5 Updates CRA from v4 to v5 Oct 18, 2022
@shayneczyzewski shayneczyzewski marked this pull request as ready for review October 18, 2022 14:58
Copy link
Contributor

@sodic sodic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

waspc/src/Wasp/Generator/WebAppGenerator.hs Show resolved Hide resolved
@sodic
Copy link
Contributor

sodic commented Oct 19, 2022

How should I be thinking about testing this? I ran the existing apps and they seem ok. Since CRA helps with frontend in dev mode, deployment should not be a concern, right? Anything else to consider/test/validate?

If the apps work (with both compile and start), I think we're good.

@Martinsos
Copy link
Member

Awesome that we will now have less of those deprecation warnings!

@Martinsos
Copy link
Member

How should I be thinking about testing this? I ran the existing apps and they seem ok. Since CRA helps with frontend in dev mode, deployment should not be a concern, right? Anything else to consider/test/validate?

If the apps work (with both compile and start), I think we're good.

Ah sorry forgot to comment on this: yup I agree with @sodic , that should be enough of testing for now!

@shayneczyzewski
Copy link
Sponsor Contributor Author

Thanks for the review here @sodic and @Martinsos. I forgot to add the Changelog update for the possible breaking change (I will link to the CRA4 to 5 transition doc). After that, I will merge! 🚀

@shayneczyzewski shayneczyzewski marked this pull request as draft October 19, 2022 14:26
@shayneczyzewski shayneczyzewski marked this pull request as ready for review October 19, 2022 14:26
@shayneczyzewski shayneczyzewski merged commit dc036f5 into main Oct 19, 2022
@shayneczyzewski shayneczyzewski deleted the shayne-update-cra5 branch October 19, 2022 14:39
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.

None yet

3 participants