-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: rewrite with typescript and module-builder #456
Conversation
Haven't looked at the changes yet but are you saying that it should be possible to use module-builder and nuxt/kit and at the same time still have it compatible with Nuxt 2? |
Yes, we should be able to have compatibility with both nuxt 2 and 3. |
@rtibaldo I've tried to use come of your changes "context.$sentry.setUser is not a function"
Guess this is it, process.sentry is undefined |
On which Nuxt version? Those changes do not make module work in Nuxt 3 (at least not all functionality). |
Nuxt 2 + Nuxt Bridge |
So I've never worked with a monorepo before (and I could be saying something stupid) but wouldn't using one be the best long term solution to handle testing different versions of Nuxt? Wdyt @rchl? |
I dug up what the issue was and found a workaround for the problem I was having with Bridge, maybe it would resolve also yours @daniluk4000. It seems like there is a problem with the esm version of tslib that gives an error when importing on the client side. I found this issue on the Nuxt Bridge repo where @danielroe gave a workaround and explained why there is this error. TL DR: Add this to your nuxt config
PS. This does not mean the module is Bridge compatible, there are things that I'm pretty sure don't work, like Nitro errors being traced |
@rtibaldo looks interesting, I'll try that tomorrow, thanks |
I don't necessarily see a need for monorepo just yet. |
Nuxt v3 is able to run in Cloudflare Workers. Will this be compatible in that context? There's a sentry module made by Cloudflare here if that's any help. https://github.com/cloudflare/worker-sentry |
I think we're gonna handle upgrade to v7 SDK first (#461), release as new major version and then pick this up. This will also likely have to be released as yet another major version. |
I've released the current state as Testing likes to crash for some reason on CI. Works locally (usually). |
A bit late but just noticed another deal breaker. (EDIT: Not only Vue 2 but also other Nuxt-3 only packages) |
Just checking, |
That's one of the issues that we've discussed in private. The other issue has to do with using Specifically this line:
You've provided a possible workaround by casting module export to export default defineNuxtModule(...) as any and it does in fact get rid of (The
Maybe our understanding of "depends on" differs because those |
I've missed before that https://github.com/nuxt/module-builder/blob/main/README.md says "Requirements: Nuxt 3 or Nuxt Bridge. Nuxt 2 is functional but not advised". So I guess it's not lying. The module will work but the types will be broken in Nuxt 2. This could perhaps be more clear. |
And even if I can workaround it for the published package, the types (for example extends of |
I think the next step is to replace EDIT: Though that would also require dropping |
I don't have any outstanding issues with those changes so released as |
I don't consider this having any breaking changes (maybe only some minor in types but shouldn't affect normal usage) so I will aim to release it as a minor or patch bump. |
Refactored module using nuxt/module-builder (using typescript) and nuxt/kit to begin working towards nuxt 3 compatibility.
Test are semi-broken as module-builder requires nuxt 3 so they now have their own package.json with nuxt 2.
I don't know if this is the best solution, but I couldn't come up with anything else