PostHog / posthog

πŸ¦” PostHog provides open-source product analytics, session recording, feature flagging and A/B testing that you can self-host.
https://posthog.com
Other
21.24k stars 1.26k forks source link

Upgrade chart.js to v4 #16828

Open thmsobrmlr opened 1 year ago

thmsobrmlr commented 1 year ago

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:

nategrift commented 1 year ago

Did some research into upgrading chart.js to v4. Here are my findings for each plugin.

Based on these findings, it is not possible to simply update the plugins and continue, however, see below an alternative.

Alternatives I have considered

@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.

thmsobrmlr commented 1 year ago

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.

nategrift commented 1 year ago

Okay, sounds good! When you get back and take a look, just tag me!

thmsobrmlr commented 1 year ago

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?

nategrift commented 1 year ago

Sure! I would be happy to do that.

AvaterClasher commented 10 months ago

Is this still open ?

sejalgolani2801 commented 6 months ago

I would be happy to help. Is the issue still open?