-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Update optional peer dependency canvas to v3 #3806
Conversation
Not release candidate anymore - canvas 3 is out |
Yes, please remove canvas v2 from the peer dependencies and testing matrix so that we don't have the extra support burden! |
I removed canvas v2 from the test matrix (I removed the test matrix) and from the peer dependencies. I set node version for that pipeline step to v22. |
.github/workflows/jsdom-ci.yml
Outdated
- name: Run tests | ||
run: npm test -- --retries 1 | ||
run: npm i canvas && npm test -- --retries 1 |
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.
I know that the test setup is not that great (probably there should be a test project with both canvas and jsdom) but:
- Installing dependencies should not be done in 2 steps.
canvas
should be installed together with the other dependencies. This will also keep the test output clean. - Not specifying a version when installing a package will always install the latest. This will install
canvas@4.0.0
when it will be released.
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.
I'm currently on my way to a ski trip and will implement the changes this evening.
I have a question regarding your second point: will npm i canvas
always install the latest version even when the field "peerDependencies": { "canvas": "^3.0.0" }
is set? I thought (or hoped) it would install the latest minor or patch version of the v3 major version.
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.
npm i canvas
will modify package.json
and the lockfile and will add the latest version of canvas to the dependencies
group. I'm not sure if npm will also remove it from peerDependencies
(might also depend on the npm version), some package managers do this.
Viel Spaß! :)
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.
Moved the npm i canvas@3
to the same line as npm ci
and specified canvas in its installtion with @3
Can we land this, so that jsdom will support node 22? The changes by @sebastianwachter seems to avoid the issue with an eventual canvas v4 |
There is no change in API between So unless you enable npm/strict-peer-deps or pnpm/strict-peer-dependencies, you should be able to provide |
The thing causing issues is that canvas v3 is not listed in jsdom's peer dependencies which can cause issues like this one (dependabot wants to update to canvas v3 but can't): https://github.com/sebastianwachter/wc-scratch/actions/runs/12568528588/job/35036163215?pr=212 |
We probably need to wait for @domenic to merge this PR and release a new version.
As mentioned above, you should not have this issue unless you explicitly set strict-peer-deps to For me, Renovate and |
I can also confirm
|
This would be super helpful. We're currently waiting on an 3.0.1 |
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.
Thanks!
Canvas v3.0.0 is now out of Release Candidate.
Should canvas v2.x.x compatibility be removed now that a stable version is available for newer node versions?(removed)