Skip to content

Commit d4e3f0a

Browse files
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: module
2 parents de0d92a + 3fca0ca commit d4e3f0a

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

src/Chartjs/assets/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"license": "MIT",
55
"version": "1.1.0",
66
"module": "dist/controller.js",
7-
"type": "module",
87
"types": "dist/controller.d.ts",
98
"symfony": {
109
"controllers": {

0 commit comments

Comments
 (0)