Project

General

Profile

Actions

Patch #44018

closed

Update Chart.js to 4.5.1 and migrate to ES Modules

Added by Takashi Kato about 1 month ago. Updated 1 day ago.

Status:
Closed
Priority:
Normal
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:

https://github.com/redmine-ui/Chart.js/tree/esm_bundle


Files

Actions #1

Updated by Marius BĂLTEANU 4 days ago

  • Assignee set to Marius BĂLTEANU
  • Target version set to 7.0.0
Actions #2

Updated by Marius BĂLTEANU 2 days ago

  • Status changed from New to Resolved

Change committed, thanks!

Actions #3

Updated by Marius BĂLTEANU 1 day ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF