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

Convert to yarn for package management #3952

Merged
merged 7 commits into from
Aug 25, 2023
Merged

Convert to yarn for package management #3952

merged 7 commits into from
Aug 25, 2023

Conversation

jpellizzari
Copy link
Contributor

@jpellizzari jpellizzari commented Aug 17, 2023

Closes #3943

Moves Core to use the same package manager as EE. This is really only to enforce consistency; we chose yarn as it a bit faster (historically) and has a nicer UX.

Note: Some scripts that run during releases may still be npm to reduce the risk of finding issues during a release.

@jpellizzari jpellizzari force-pushed the 3943-yarn branch 2 times, most recently from a7b83d1 to 7480d36 Compare August 17, 2023 20:46
@jpellizzari jpellizzari marked this pull request as ready for review August 18, 2023 16:34
Copy link
Contributor

@joshri joshri left a comment

Choose a reason for hiding this comment

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

Did upgrading eslint cause all those typescript errors? If we can get rid of the new @ts-ignores we should

@foot
Copy link
Contributor

foot commented Aug 21, 2023

Yeah it looks like the yarn.lock is using the react v18 types which seem to introduce these issues bvaughn/react-error-boundary#111 (comment)

If we can bump it back to 17.x in the yarn.lock somehow it will mirror the package-lock and we can maybe revert the code changes.

@foot
Copy link
Contributor

foot commented Aug 21, 2023

Using https://classic.yarnpkg.com/en/docs/cli/import/ preserves the @types/react at 17 at least, might have other issues, did a quick test with

git checkout main
rm -rf node_modules
make node_modules
yarn import

@jpellizzari
Copy link
Contributor Author

Did upgrading eslint cause all those typescript errors? If we can get rid of the new @ts-ignores we should

I tried removing most of these, but the Modal is being problematic for some reason. Unfortunately, we have some @types/ that require @types/react at 18.X, so we do have the two different type definitions.

@jpellizzari jpellizzari requested a review from joshri August 23, 2023 17:46
@jpellizzari
Copy link
Contributor Author

Here is a summary of the @types/react dep tree:

$ yarn why @types/react
yarn why v1.22.19
[1/4] Why do we have the module "@types/react"...?
[2/4] Initialising dependency graph...
[3/4] Finding dependency...
[4/4] Calculating file sizes...
=> Found "@types/[email protected]"
info Has been hoisted to "@types/react"
info Reasons this module exists
   - Specified in "devDependencies"
   - Hoisted from "@types#react-dom#@types#react"
info Disk size without dependencies: "184KB"
info Disk size with unique dependencies: "1.39MB"
info Disk size with transitive dependencies: "1.39MB"
info Number of shared dependencies: 3
=> Found "@types/react-router-dom#@types/[email protected]"
info This module exists because "@types#react-router-dom" depends on it.
info Disk size without dependencies: "392KB"
info Disk size with unique dependencies: "1.59MB"
info Disk size with transitive dependencies: "1.59MB"
info Number of shared dependencies: 3
=> Found "@types/styled-components#@types/[email protected]"
info This module exists because "@types#styled-components" depends on it.
info Disk size without dependencies: "392KB"
info Disk size with unique dependencies: "1.59MB"
info Disk size with transitive dependencies: "1.59MB"
info Number of shared dependencies: 3
=> Found "@testing-library/react-hooks#@types/[email protected]"
info Reasons this module exists
   - "@testing-library#react-hooks" depends on it
   - Hoisted from "@testing-library#react-hooks#@types#react-dom#@types#react"
info Disk size without dependencies: "392KB"
info Disk size with unique dependencies: "1.59MB"
info Disk size with transitive dependencies: "1.59MB"
info Number of shared dependencies: 3
=> Found "@types/hoist-non-react-statics#@types/[email protected]"
info This module exists because "@types#styled-components#@types#hoist-non-react-statics" depends on it.
info Disk size without dependencies: "392KB"
info Disk size with unique dependencies: "1.59MB"
info Disk size with transitive dependencies: "1.59MB"
info Number of shared dependencies: 3
=> Found "@types/react-router#@types/[email protected]"
info This module exists because "@types#react-router-dom#@types#react-router" depends on it.
info Disk size without dependencies: "392KB"
info Disk size with unique dependencies: "1.59MB"
info Disk size with transitive dependencies: "1.59MB"
info Number of shared dependencies: 3
=> Found "@types/react-test-renderer#@types/[email protected]"
info This module exists because "@testing-library#react-hooks#@types#react-test-renderer" depends on it.
info Disk size without dependencies: "392KB"
info Disk size with unique dependencies: "1.59MB"
info Disk size with transitive dependencies: "1.59MB"
info Number of shared dependencies: 3
=> Found "@types/react-transition-group#@types/[email protected]"
info This module exists because "@material-ui#core#@types#react-transition-group" depends on it.
info Disk size without dependencies: "392KB"
info Disk size with unique dependencies: "1.59MB"
info Disk size with transitive dependencies: "1.59MB"
info Number of shared dependencies: 3
Done in 0.39s.

@foot
Copy link
Contributor

foot commented Aug 24, 2023

Yeah.. it looks like we've bumped up to 18 for react-test-renderer etc.. in the yarn.lock etc, which may cause issues later as we're still on react 17?

yarn import seems to keep react-test-renderer back on 17 etc and aligned with the version of react we're using. Could give that go?

@jpellizzari
Copy link
Contributor Author

yarn import seems to keep react-test-renderer back on 17 etc and aligned with the version of react we're using. Could give that go?

I had no idea about yarn import 👍 . Updated.

@foot
Copy link
Contributor

foot commented Aug 25, 2023

There were still some v18 deps in the new yarn.lock which was odd, it seems to use the state of node_modules too, so did a clean run and that brought the rest back down to v17. Can remove the ts-ignore and the other code changes too, but the rest all seem like improvements 👍 .

@jpellizzari jpellizzari merged commit 2888e24 into main Aug 25, 2023
14 checks passed
@jpellizzari jpellizzari deleted the 3943-yarn branch August 25, 2023 17:47
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.

Convert to yarn for package management
3 participants