Skip to content

Conversation

Kocal
Copy link
Member

@Kocal Kocal commented Jul 20, 2025

Q A
Bug fix? no
New feature? no
Docs? no
Issues Fix #...
License MIT

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

@carsonbot carsonbot added the Status: Needs Review Needs to be reviewed label Jul 20, 2025
Copy link
Contributor

github-actions bot commented Jul 20, 2025

📊 Packages dist files size difference

Thanks for the PR! Here is the difference in size of the packages dist files between the base branch and the PR.
Please review the changes and make sure they are expected.

FileBefore (Size / Gzip)After (Size / Gzip)
Autocomplete
controller.js 17.6 kB / 4.12 kB 17.61 kB0% / 4.13 kB0%

- name: Replace local "workspace:*" occurrences
run: |
yarn workspaces foreach -pA exec "sed -i 's/\"workspace:\*\"/\"${{ env.VERSION }}\"/g' package.json"

Copy link
Member Author

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

@Kocal Kocal force-pushed the move-from-yarn-to-pnpm branch 7 times, most recently from 1eef72b to 548ae06 Compare July 21, 2025 06:59
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/user-event": "^14.6.1",
"@testing-library/dom": "catalog:",
Copy link
Member Author

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)

Comment on lines +52 to +60
"@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:",
Copy link
Member Author

@Kocal Kocal Jul 21, 2025

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" />
Copy link
Member Author

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" />
Copy link
Member Author

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

@Kocal Kocal force-pushed the move-from-yarn-to-pnpm branch from 548ae06 to d25f4cb Compare July 21, 2025 07:07
@Kocal Kocal force-pushed the move-from-yarn-to-pnpm branch from d25f4cb to 17a4bb7 Compare July 21, 2025 08:06
YARN_ENABLE_HARDENED_MODE: 0
YARN_ENABLE_IMMUTABLE_INSTALLS: 0
- working-directory: test_apps/encore-app
run: pnpm install --ignore-workspace
Copy link
Member Author

@Kocal Kocal Jul 21, 2025

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)

@Kocal Kocal requested review from kbond and smnandre July 21, 2025 08:21
@smnandre
Copy link
Member

What does it mean for the contributors?

@smnandre
Copy link
Member

Nice job and i’m all in to leave legacy yarn :)

@Kocal
Copy link
Member Author

Kocal commented Jul 21, 2025

What does it mean for the contributors?

pnpm will be automatically installed when running corepack enable, which we already explain in our CONTRIBUTING.md. And of course, commands like yarn install or yarn build won't work anymore, in favor of pnpm install, pnpm build, etc...

Copy link
Member

@kbond kbond left a 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!

@carsonbot carsonbot added Status: Reviewed Has been reviewed by a maintainer and removed Status: Needs Review Needs to be reviewed labels Jul 21, 2025
@Kocal Kocal merged commit b096ecc into symfony:2.x Jul 21, 2025
31 of 33 checks passed
Kocal added a commit that referenced this pull request Jul 28, 2025
…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
Kocal added a commit to Kocal/symfony-ux that referenced this pull request Jul 28, 2025
…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
Kocal added a commit to Kocal/symfony-ux that referenced this pull request Jul 28, 2025
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Reviewed Has been reviewed by a maintainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants