-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
Switch to pnpm #10576
Switch to pnpm #10576
Conversation
7c3d87e
to
b327dd9
Compare
e618efc
to
ea5bc05
Compare
f616a48
to
cdc99f0
Compare
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.
Looks fine only I think it would be best to put a mention in the migration guide for this too.
Guess best place is like in the V3 migration guide in the Developer migration
section, small bit of text that we switched from npm
to pnpm
so that needs to be installed before you can work with hte project again
Developer migration in v3 was for developers of plugins, etc. However, there won't be any migration required for either end users or developers of plugins. Only people working on this repository itself. That will start immediately with this being merged and will not coincide with the release of v4. So I think putting it in the contributor's guide is probably best. |
Aah yeah makes sense, my bad |
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.
Faster speed is a good enough reason to switch already. I have some questions though.
872fb63
to
43739aa
Compare
I can replicate the CI failure locally
|
No new should be without putting it in a variable if I'm not mistaken so const c = new Chart() should work although it's an unused car so we might need an update statement or ignore it |
Oops. Should be fixed now. I think it was working originally, but I lost some of the fixes while merging in the latest changes from |
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.
looks good expect for @LeeLenaleee comments (integration tests for helpers)
930ac69
to
f917e10
Compare
Some actions seem to fail still |
@kurkle looks like you caught it right before I pushed a fix 😄 I had a bad merge when rebasing against |
The main benefit is that it allows you to have a monorepo with sub-projects. E.g. right now the main
package.json
has all the dependencies in it, but in this PR I was able to move the documentation dependencies to thedocs
sub-project, which is cleaner and helps make it clearer what is used where. Also, this completely removes the need fortest/integration/integration-test.cjs
and creating a temporary directory for integration testing as we can use workspace dependencies.As a final benefit, pnpm is much faster than npm especially for subsequent installs of the Chart.js project. The lockfile is also easier to read - you can see the deletion of 28,000 lines. I've been seeing it adopted quite a lot in large projects like Next.js, Vue, Vite, and SvelteKit.
This requires that you install pnpm to build the project. Just run
npm install -g pnpm
The compressed size action is failing because it's checking out the previous version from github where pnpm fails because this project is not currently specifying the required peer dependencies. I fixed that in this PR, so all subsequent PRs after this one should pass that check if this is merged.