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

Migrate to webpack-dev-server to 4.0.0 #11318

Merged
merged 5 commits into from
Aug 19, 2021

Conversation

th7nder
Copy link
Contributor

@th7nder th7nder commented Aug 18, 2021

#11278 (reply in thread)

Fixes error overlay formatting by upgrading webpack-dev-server.

@facebook-github-bot
Copy link

Hi @th7nder!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@raix raix added this to the 5.0 milestone Aug 18, 2021
@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@mrmckeb
Copy link
Contributor

mrmckeb commented Aug 18, 2021

I'm not sure why this is failing in the CI, I'm seeing this issue that I saw on a friends project recently:

Though the "loose" option was set to "false" in your @babel/preset-env config, it will not be used for @babel/plugin-proposal-private-property-in-object since the "loose" mode option was set to "true" for @babel/plugin-proposal-private-methods.
The "loose" option must be the same for @babel/plugin-proposal-class-properties, @babel/plugin-proposal-private-methods and @babel/plugin-proposal-private-property-in-object (when they are enabled): you can silence this warning by explicitly adding
	["@babel/plugin-proposal-private-property-in-object", { "loose": true }]
to the "plugins" section of your Babel config.

@raix I see this:
https://github.com/facebook/create-react-app/blob/main/packages/babel-preset-react-app/create.js#L151-L153.

But the third isn't actually there, is that intentionally omitted, or could that be why we're seeing this issue?

@th7nder
Copy link
Contributor Author

th7nder commented Aug 18, 2021

@mrmckeb @raix
In the meantime (10 minutes ago, webpack version 4.0.0 got released), so I changed it.
If it's about those warnings, when I added the rule @babel/plugin-proposal-private-property-in-object warnings disappeared.

@th7nder th7nder changed the title Bump webpack-dev-server to 4.0.0-rc.1 Bump webpack-dev-server to 4.0.0 Aug 18, 2021
@th7nder
Copy link
Contributor Author

th7nder commented Aug 18, 2021

Looks like the build broke, after changes added in 4.0.0. Investigating.

@raix
Copy link
Contributor

raix commented Aug 18, 2021

@mrmckeb babel was just warning about a missing loose setting, Thanks @th7nder for fixing that one.

I might be able to qa why 4.0.0 breaks the build tomorrow, could not see any breaking changes in wds rc.1

@th7nder
Copy link
Contributor Author

th7nder commented Aug 18, 2021

@raix I found some issues and fixed them. According to: https://github.com/webpack/webpack-dev-server/blob/master/migration-v4.md. We had some incompatibilities in on(Before|After)SetupMiddleware and .listen() was marked as deprecated, so changed it to .startCallback().

@th7nder th7nder changed the title Bump webpack-dev-server to 4.0.0 Migrate to webpack-dev-server to 4.0.0 Aug 18, 2021
@raix
Copy link
Contributor

raix commented Aug 19, 2021

Awesome work @th7nder ! Great to see they added a migration guide from 3 to 4 :)

Not sure why the integration tests stopped working (maybe they just need a rerun 🧐)

@raix
Copy link
Contributor

raix commented Aug 19, 2021

It fails to load object-assign, seems related to babel - also a warning asking to update corejs to >3.3 - maybe we need to update a dependency in babel preset for it to pass 🧐

@th7nder
Copy link
Contributor Author

th7nder commented Aug 19, 2021

@raix It's weird, because I cannot reproduce it locally, even after removing my local yarn.lock.
yarn test:integration just passes (Node 14, Ubuntu 20.04). I don't think this error is related to this warning.

@raix
Copy link
Contributor

raix commented Aug 19, 2021

The build seem to fail loading object-assign from localhost - maybe it's a caching issue on the build server

@th7nder
Copy link
Contributor Author

th7nder commented Aug 19, 2021

How do we check if this is the issue with the build server? Can we clear the cache somehow?

@th7nder
Copy link
Contributor Author

th7nder commented Aug 19, 2021

If I think correctly, our cache dependencies step in the github workflow arent't the best.

      - name: Cache dependencies
        id: cache
        uses: actions/cache@v2
        with:
          path: |
            node_modules
            */*/node_modules
          key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock', './yarn.lock') }}
      - name: Install packages
        if: steps.cache.outputs.cache-hit != 'true'
        run: yarn --frozen-lockfile --prefer-offline
      - name: Run integration tests
        run: yarn test:integration

We base our cache on yarn.lock, but it's not committed to the repo either way. In the end it tries to get packages from local cache which is based on I don't know what.

@raix
Copy link
Contributor

raix commented Aug 19, 2021

Not sure if this is the issue: Reading the '.github/integration' file it seems that we try calculating the cache invalidation hash of yarn.lock - I'm not sure this works as we dont check in yarn.lock files...
The only lockfile we check in is packages/create-react-app/yarn.cached.lockfile (running 'yarn compile:lockfile' will update it)

Not sure if the github integration cache should use the compiled lock file for generating the hash for cache invalidation @mrmckeb @iansu ?

@raix
Copy link
Contributor

raix commented Aug 19, 2021

@th7nder we could try using the compiled lock file - otherwise comment out the cache step to see if that fixes the issue

@raix raix merged commit 5ed5db4 into facebook:main Aug 19, 2021
@raix
Copy link
Contributor

raix commented Aug 19, 2021

Thanks @th7nder all green and merged (the 'yarn compile:lockfile' seemed to solve the issue)

@mrmckeb
Copy link
Contributor

mrmckeb commented Aug 19, 2021

Thanks all!

eventualbuddha added a commit to eventualbuddha/create-react-app that referenced this pull request May 4, 2022
In facebook#11318 a change was made to `babel-preset-react-app` to require `@babel/plugin-proposal-private-property-in-object`, but no such dependency was added to `package.json`. This fixes that mistake by adding the dependency.
eventualbuddha added a commit to eventualbuddha/create-react-app that referenced this pull request Jun 24, 2022
In facebook#11318 a change was made to `babel-preset-react-app` to require `@babel/plugin-proposal-private-property-in-object`, but no such dependency was added to `package.json`. This fixes that mistake by adding the dependency.
robhogan pushed a commit to eventualbuddha/create-react-app that referenced this pull request May 29, 2023
In facebook#11318 a change was made to `babel-preset-react-app` to require `@babel/plugin-proposal-private-property-in-object`, but no such dependency was added to `package.json`. This fixes that mistake by adding the dependency.
robhogan pushed a commit that referenced this pull request May 29, 2023
In #11318 a change was made to `babel-preset-react-app` to require `@babel/plugin-proposal-private-property-in-object`, but no such dependency was added to `package.json`. This fixes that mistake by adding the dependency.
GoetzGoerisch pushed a commit to umati/create-react-app that referenced this pull request Dec 6, 2023
In facebook#11318 a change was made to `babel-preset-react-app` to require `@babel/plugin-proposal-private-property-in-object`, but no such dependency was added to `package.json`. This fixes that mistake by adding the dependency.
unional pushed a commit to unional/create-react-app that referenced this pull request Feb 21, 2024
In facebook#11318 a change was made to `babel-preset-react-app` to require `@babel/plugin-proposal-private-property-in-object`, but no such dependency was added to `package.json`. This fixes that mistake by adding the dependency.
karlhorky added a commit to upleveled/create-react-app that referenced this pull request Mar 20, 2025
* fix(babel-preset-react-app): add missing dependency (facebook#12364)

In facebook#11318 a change was made to `babel-preset-react-app` to require `@babel/plugin-proposal-private-property-in-object`, but no such dependency was added to `package.json`. This fixes that mistake by adding the dependency.

* Migrate from Azure Pipelines to GitHub Actions (facebook#13222)

Beyond just a pure migration, this also:

- Drops Node 14 usage from CI (which also removes the need for explicit
  npm 8 installs)
- Removes the "old node" test, which just checked that installing on old
  node failed. We shouldn't need to test that
- Consolidates the build & test workflows so we don't end up with
  a proliferation of workflows.

* Update running-tests.md

Update running-tests

* chore: upgrade RTL version to avoid peer-deps mismatch

* Update types from facebook#13725

Co-authored-by: Rajhans Jadhao <[email protected]>

* Fix tests

* Fix e2e tests

* Add act

* try this instead

* update react-scripts react devDep

* idk

* Update tests

* skip svg component test

* Deprecate Create React App officially by changing the README, and adding a message on init (facebook#17003)

It's probably time to make this project document its status as being
deprecated and not recommended for production usage.

To change it:

- I opted to add a header to the README saying its over and you should
go look at https://react.dev/learn/start-a-new-react-project

- I left a note saying that if you are following, it is maybe worth
carrying on. While I hear react 19 doesn't work with CRA, I wouldn't be
surprised that a good chunk of tutorials would still work. Open to being
a bit more hard-lined there but there was a lot of great resources for
learning react in that era and it seems like a waste to be making people
stop early?

- I added a message inside the CLI, it shows once and says "don't use
this, use the stuff in
https://react.dev/learn/start-a-new-react-project"

---------

Co-authored-by: Ricky <[email protected]>
Co-authored-by: Rick Hanlon <[email protected]>

* Update deprecation link (facebook#17015)

Updates to a shortlink that we can redirect as needed for old versions.
Currently 404

* Add deprecation to website (facebook#17008)

- Adds a banner with deprecation notice
- Adds a noindex meta tag to home page to remove from search
- Add og meta info for when noindex is ignored

* Publish

 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]

* Migrate from Azure Pipelines to GitHub Actions (facebook#13222)

Beyond just a pure migration, this also:

- Drops Node 14 usage from CI (which also removes the need for explicit
  npm 8 installs)
- Removes the "old node" test, which just checked that installing on old
  node failed. We shouldn't need to test that
- Consolidates the build & test workflows so we don't end up with
  a proliferation of workflows.

* Update running-tests.md

Update running-tests

* chore: upgrade RTL version to avoid peer-deps mismatch

* Update types from facebook#13725

Co-authored-by: Rajhans Jadhao <[email protected]>

* Fix tests

* Fix e2e tests

* Add act

* try this instead

* update react-scripts react devDep

* idk

* Update tests

* skip svg component test

* Deprecate Create React App officially by changing the README, and adding a message on init (facebook#17003)

It's probably time to make this project document its status as being
deprecated and not recommended for production usage.

To change it:

- I opted to add a header to the README saying its over and you should
go look at https://react.dev/learn/start-a-new-react-project

- I left a note saying that if you are following, it is maybe worth
carrying on. While I hear react 19 doesn't work with CRA, I wouldn't be
surprised that a good chunk of tutorials would still work. Open to being
a bit more hard-lined there but there was a lot of great resources for
learning react in that era and it seems like a waste to be making people
stop early?

- I added a message inside the CLI, it shows once and says "don't use
this, use the stuff in
https://react.dev/learn/start-a-new-react-project"

---------

Co-authored-by: Ricky <[email protected]>
Co-authored-by: Rick Hanlon <[email protected]>

* Update deprecation link (facebook#17015)

Updates to a shortlink that we can redirect as needed for old versions.
Currently 404

* Add deprecation to website (facebook#17008)

- Adds a banner with deprecation notice
- Adds a noindex meta tag to home page to remove from search
- Add og meta info for when noindex is ignored

* Publish

 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]

* Disable deprecation warning and version check

* Bump version

* Disable deleting folder after error

* Fix babel-plugin-named-asset-import version number

* Bump @upleveled/create-react-app to 5.1.2

* Bump version of @upleveled/react-scripts to 5.1.1

* Add back call to createApp()

* Bump version of @upleveled/create-react-app to 5.1.3

* Revert to published versions of react-scripts dependencies

* Bump version of @upleveled/react-scripts to 5.1.2

* Allow pnpm to build @parcel/watcher, ignore core-js builds

* Bump version of @upleveled/cra-template to 1.3.1

* Remove pnpm config from package.json, bump to @upleveled/[email protected]

* Add pnpm built packages configuration in `package.json`

* Bump @upleveled/create-react-app to 5.1.4

---------

Co-authored-by: Brian Donovan <[email protected]>
Co-authored-by: Paul O’Shannessy <[email protected]>
Co-authored-by: Olexandr Radovenchyk <[email protected]>
Co-authored-by: Edgardo Avilés-López <[email protected]>
Co-authored-by: Matan Borenkraout <[email protected]>
Co-authored-by: Rick Hanlon <[email protected]>
Co-authored-by: Rajhans Jadhao <[email protected]>
Co-authored-by: Ricky <[email protected]>
Co-authored-by: Orta Therox <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants