Commit d4e3f0a
committed
bug #1264 [Chart.js] Reverting chart.js type: module (weaverryan)
This PR was merged into the 2.x branch.
Discussion
----------
[Chart.js] Reverting chart.js type: module
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| Issues | Fix #1262
| License | MIT
This is complex, and relates to some hard/weird/broken changes that chart.js made in 3.9. Facts:
* Changing `type: module` and making no other changes breaks `chart.js` v3 (but v4 works fine)
* Changing the import from `chart.js/auto'` to `chart.js` - like #1263 fixes things. However, it breaks the tests in 3.9... because chart.js doesn't have an `exports` key in that version, so our tests / node environment continue to load the `main` key instead of the `module` key.
So, this will "put thing back" and get chart.js working again.
After this, we should:
1) Re-add `type: module` to chart.js
2) Upgrade `chart.js` to v4
By 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!
Commits
-------
3fca0ca [Chart.js] Reverting chart.js type: module1 file changed
+0
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
| |||
0 commit comments