Open thmsobrmlr opened 1 year ago
Did some research into upgrading chart.js
to v4. Here are my findings for each plugin.
npm i --force
it won't run due to outdated package.json
which is not an acceptable solution.chart.js
v4 for anyone who uses the plugin. Based on these findings, it is not possible to simply update the plugins and continue, however, see below an alternative.
chart.js
v4 we can either create a fork of chartjs-adapter-dayjs-3
and change dependency requirements OR we can take the small ~80 lines of the plugin and build it into PostHog the app (as the plugin is under the MIT license).@thmsobrmlr Let me know if you want me to proceed, I am happy to make the migration. My recommendation would be to do option 2 (implement adapter in PostHog repo) as it is the easiest to maintain and doesn't require creating a new package.
Awesome findings @nategrift! And congratulations on becoming chartjs-plugin-crosshair admin π
Iβm without laptop until the 16th and will have a closer look then. cc @Twixes @mariusandra if you have comments meanwhile.
Regarding the issue with chartjs-adapter-dayjs-3: Weβre using pnpm, which supports a resolutions field in package.json. Maybe that could help, though unsure without having looked at the actual issue myself.
Okay, sounds good! When you get back and take a look, just tag me!
I've had a brief check and was able to use the updated packages without other changes (didn't run into an issue with pnpm). Thus we'd be ready to try the upgrade from a dependency resolution point of view. Do you want to give it a try @nategrift?
Sure! I would be happy to do that.
Is this still open ?
I would be happy to help. Is the issue still open?
We're on v3 of
chart.js
, but a v4 version was released. See here for a migration guide https://www.chartjs.org/docs/latest/migration/v4-migration.html.Note that finding things that are incompatible with chart.js v3 is also a good outcome of this task.
Some things to check: