[Chart.js] Reverting chart.js type: module #1264
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is complex, and relates to some hard/weird/broken changes that chart.js made in 3.9. Facts:
type: module
and making no other changes breakschart.js
v3 (but v4 works fine)chart.js/auto'
tochart.js
- like [ChartJs] Replacechart.js/auto
import withChart.register
calls #1263 fixes things. However, it breaks the tests in 3.9... because chart.js doesn't have anexports
key in that version, so our tests / node environment continue to load themain
key instead of themodule
key.So, this will "put thing back" and get chart.js working again.
After this, we should:
type: module
to chart.jschart.js
to v4By doing that, other than actually migrating any custom chart.js code from 3 -> 4 (https://www.chartjs.org/docs/latest/migration/v4-migration.html), users won't need to make any other changes.
The question about 3 -> 4 is if we can do that in a minor UX version of it needs to be a major. Technically, nothing in
symfony/ux-chart.js
changes... except that it will force you to change a JS dep up a major version. It's a gray area.Cheers!