-
-
Notifications
You must be signed in to change notification settings - Fork 381
Replace Yarn Berry by PNPM #2932
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
Conversation
📊 Packages dist files size differenceThanks for the PR! Here is the difference in size of the packages dist files between the base branch and the PR.
|
- name: Replace local "workspace:*" occurrences | ||
run: | | ||
yarn workspaces foreach -pA exec "sed -i 's/\"workspace:\*\"/\"${{ env.VERSION }}\"/g' package.json" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is automatically done when running pnpm publish
, see https://pnpm.io/workspaces#publishing-workspace-packages
1eef72b
to
548ae06
Compare
"@testing-library/dom": "^10.4.0", | ||
"@testing-library/jest-dom": "^6.6.3", | ||
"@testing-library/user-event": "^14.6.1", | ||
"@testing-library/dom": "catalog:", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Catalogs are like an alias to a constraint version.
When defining the catalog version for @testing-library/dom
, then it will always install the exact same version when installing the same package in different places (if we use the same catalog ofc)
"@testing-library/dom": "catalog:", | ||
"@testing-library/jest-dom": "catalog:", | ||
"@testing-library/user-event": "catalog:", | ||
"jsdom": "catalog:", | ||
"tom-select": "^2.2.2", | ||
"tslib": "catalog:", | ||
"tsx": "catalog:", | ||
"typescript": "catalog:", | ||
"vitest": "catalog:", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding the (dev) dependencies used by the package instead of relying of packages installed from parents directories (that "magically" works with Yarn) is a good practice.
By using catalog:
, we will have the same exact version of the dependency installed everywhere (consistency).
@@ -7,6 +7,8 @@ | |||
* file that was distributed with this source code. | |||
*/ | |||
|
|||
/// <reference types="@types/webpack-env" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise __WebpackModuleApi
was not found
@@ -7,6 +7,8 @@ | |||
* file that was distributed with this source code. | |||
*/ | |||
|
|||
/// <reference types="google.maps" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise google
type was not found
548ae06
to
d25f4cb
Compare
d25f4cb
to
17a4bb7
Compare
YARN_ENABLE_HARDENED_MODE: 0 | ||
YARN_ENABLE_IMMUTABLE_INSTALLS: 0 | ||
- working-directory: test_apps/encore-app | ||
run: pnpm install --ignore-workspace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--ignore-workspace
allows to ignore the pnpm-workspace.yaml
from parent folders, and install dependencies from test_apps/encore-app
only (test_apps/encore-app
is not a workspace on purpose)
What does it mean for the contributors? |
Nice job and i’m all in to leave legacy yarn :) |
pnpm will be automatically installed when running |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good arguments for this change!
…PM, as it breaks installation from `vendor/` PHP packages (Kocal) This PR was merged into the 2.x branch. Discussion ---------- Fix package.json files to not use "catalog" feature from PNPM, as it breaks installation from `vendor/` PHP packages | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Docs? | no <!-- required for new features --> | Issues | Fix #2951 <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead --> | License | MIT <!-- Replace this notice by a description of your feature/bugfix. This will help reviewers and should be a good start for the documentation. Additionally (see https://symfony.com/releases): - Always add tests and ensure they pass. - For new features, provide some code snippets to help understand usage. - Features and deprecations must be submitted against branch main. - Update/add documentation as required (we can help!) - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry - Never break backward compatibility (see https://symfony.com/bc). --> Since #2932 Dropping any fancy stuff from our `package.json` since it can breaks when people install JS packages through the PHP packages I will edit the "test apps" jobs to use `npm` to install dependencies, so we will be sure in the future we are not breaking things again. Commits ------- 4c24ce6 Fix package.json files to not use "catalog" feature from PNPM, as it breaks installation from `vendor/` PHP packages
…from PNPM, as it breaks installation from `vendor/` PHP packages (Kocal) This PR was merged into the 2.x branch. Discussion ---------- Fix package.json files to not use "catalog" feature from PNPM, as it breaks installation from `vendor/` PHP packages | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Docs? | no <!-- required for new features --> | Issues | Fix symfony#2951 <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead --> | License | MIT <!-- Replace this notice by a description of your feature/bugfix. This will help reviewers and should be a good start for the documentation. Additionally (see https://symfony.com/releases): - Always add tests and ensure they pass. - For new features, provide some code snippets to help understand usage. - Features and deprecations must be submitted against branch main. - Update/add documentation as required (we can help!) - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry - Never break backward compatibility (see https://symfony.com/bc). --> Since symfony#2932 Dropping any fancy stuff from our `package.json` since it can breaks when people install JS packages through the PHP packages I will edit the "test apps" jobs to use `npm` to install dependencies, so we will be sure in the future we are not breaking things again. Commits ------- 4c24ce6 Fix package.json files to not use "catalog" feature from PNPM, as it breaks installation from `vendor/` PHP packages
…from PNPM, as it breaks installation from `vendor/` PHP packages (Kocal) This PR was merged into the 2.x branch. Discussion ---------- Fix package.json files to not use "catalog" feature from PNPM, as it breaks installation from `vendor/` PHP packages | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Docs? | no <!-- required for new features --> | Issues | Fix symfony#2951 <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead --> | License | MIT <!-- Replace this notice by a description of your feature/bugfix. This will help reviewers and should be a good start for the documentation. Additionally (see https://symfony.com/releases): - Always add tests and ensure they pass. - For new features, provide some code snippets to help understand usage. - Features and deprecations must be submitted against branch main. - Update/add documentation as required (we can help!) - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry - Never break backward compatibility (see https://symfony.com/bc). --> Since symfony#2932 Dropping any fancy stuff from our `package.json` since it can breaks when people install JS packages through the PHP packages I will edit the "test apps" jobs to use `npm` to install dependencies, so we will be sure in the future we are not breaking things again. Commits ------- 4c24ce6 Fix package.json files to not use "catalog" feature from PNPM, as it breaks installation from `vendor/` PHP packages
Purely internal, this PR replaces Yarn by PNPM for the following reasons:
For developers working on UX, pnpm can be installed with Corepack
Note: the ~26k lines changed are mainly about lock files