web-vitals
web-vitals copied to clipboard
feat(nuxt3): rewrite with nuxt kit
In this PR I wanted to introduce some Breaking Changes for the configuration of the module for both Google Analytics and Vercel Analytics.
I wanted to add both these variables as a part of the module config options like this:
interface ModuleOptions {
provider: 'log' | 'vercel' | 'ga';
debug: boolean;
disabled: boolean;
options: {
googleMeasurementId: '123test', // <- for Google Analytics
vercelAnalyticsDsn: '123test' // <- for Vercel Analytics
}
}
Apart from that, no other BC are introduced in the migration and the module should work for all nuxt.js projects due to usage of module-builder.
@pi0 @Atinux @danielroe I have added all recommendations from you :)
@pi0 @Atinux @danielroe
I have updated the PR with the recent recommendations.
Would be nice to have an edge release in order to try it out :)
@Atinux Could you explain what do you mean about edge release?
I just created a PR with a update to Nuxt 3 so i dont have access to deploy the package. I believe it would be up to @pi0 to do that
I was thinking that you could try to release on a nuxt-webvitals-module to try it for example.
Do you mind resolving the conflicts @Baroshem ?
Current module should be compatible with Nuxt 3. I'm holding on this PR to properly test for Nuxt 3 and Nuxt 2 compatibility (vercel auto installs this module on deployments) and also check provider resolution changes.
This is why I was thinking of an edge deployment to test on Vercel for example on one of our Nuxt 3 projects, how to test it otherwise?
Hi guys, any updates on this one?
So far the module is working also on Nuxt 3.
I would personally vote to have a branch for Nuxt 2 and another one for Nuxt 3 for simplicity.
@Baroshem I reworked migration to kit with 3.0.0 compatibility in #59 to be without breaking changes and remain nuxt 2 compatible (mainly because vercel is injecting this module automatically).
Your PR included some more changes and type improvements that were conflicting. Feel free to rework them as smaller PRs and thanks again for time spent on this migration ❤️