Replace Yarn Berry by PNPM#2932
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.
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.
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.
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).
| * file that was distributed with this source code. | ||
| */ | ||
|
|
||
| /// <reference types="@types/webpack-env" /> |
There was a problem hiding this comment.
Otherwise __WebpackModuleApi was not found
| * file that was distributed with this source code. | ||
| */ | ||
|
|
||
| /// <reference types="google.maps" /> |
There was a problem hiding this comment.
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.
--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 |
kbond
left a comment
There was a problem hiding this comment.
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