Skip to content
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

Fix peerDependencies of chart.js version <3.0.0 #48

Merged
merged 1 commit into from May 2, 2022
Merged

Fix peerDependencies of chart.js version <3.0.0 #48

merged 1 commit into from May 2, 2022

Conversation

jacksongross
Copy link
Contributor

What?

  • set peerDependencies for chart.js to >=2.8.0 in package.json to match support mentioned in README.md

Requires Chart.js 2.8.0 or later and date-fns 2.0.0 or later.

Why?

There was a related issue that was closed which was actually a valid problem I ran into if a project is using npm 7+ and depends on chart.js >=2.8.0 and <3.0.0. The code is definitely supported, but the package resolution is broken due to how peerDependencies are resolved since npm 7.

This change ensures that users can still install this package using older supported versions of chart.js.

…ned in README.md

Signed-off-by: Jackson Gross <jackson.gross@gmail.com>
@@ -49,6 +49,6 @@
"rollup-plugin-terser": "^7.0.2"
},
"peerDependencies": {
"chart.js": "^3.0.0"
"chart.js": ">=2.8.0"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not exclude 4.x?

Suggested change
"chart.js": ">=2.8.0"
"chart.js": ">=2.8.0 < 4"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why exclude? I think its a greater change this will work with 4.x than not. That translates directly to needing to do a new release of this adapter when 4.x is released.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just avoid unexpected breaking changes in chart.js 4.x. You can include 4.x in a next patch release 😁

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I agree with @kurkle, especially considering there isn't any version 4 released, and I haven't seen any plans to release a new major version as far as I know. I think it would be great to leave it as is to prevent the least amount of disruption 😄

@@ -29,7 +30,7 @@
"rollup-plugin-terser": "^7.0.2"
},
"peerDependencies": {
"chart.js": "^3.0.0"
"chart.js": ">=2.8.0"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"chart.js": ">=2.8.0"
"chart.js": ">=2.8.0 <4"

@kurkle kurkle requested a review from etimberg May 1, 2022 08:46
@kurkle kurkle merged commit b2cf48a into chartjs:master May 2, 2022
@jacksongross jacksongross deleted the peer-dependencies-chart.js-2.8 branch May 2, 2022 05:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants