Actions
Patch #44018
closedUpdate Chart.js to 4.5.1 and migrate to ES Modules
Status:
Closed
Priority:
Normal
Assignee:
Category:
Third-party libraries
Target version:
Description
This patch updates Chart.js to version 4.5.1 . Along with the update, the library has been migrated to ES Module (ESM) format, and the chart rendering logic has been refactored into a Stimulus controller.
To optimize performance, the Stimulus controller implements dynamic imports for Chart.js. If we were to import Chart.js at the top level, all users would be forced to download the library upon accessing Redmine. By using dynamic imports, the library is only downloaded when a chart actually needs to be rendered.
Since the official Chart.js distribution does not provide a pre-bundled ESM version suitable for this use case, I have modified the build settings in the following fork:
Files
Related issues
Updated by Marius BĂLTEANU 2 months ago
- Assignee set to Marius BĂLTEANU
- Target version set to 7.0.0
Updated by Marius BĂLTEANU 2 months ago
- Status changed from New to Resolved
Change committed, thanks!
Updated by Marius BĂLTEANU 16 days ago
- Related to Defect #44294: Charts are broken: empty app/assets/javascripts/chart.min.js shadows vendor/javascript/chart.min.js added
Actions