Skip to content

Plan for Nuxt 3 version #530

Closed
Closed
@rchl

Description

@rchl

The module's code was refactored in #456 and now largely follows a structure of a Nuxt 3 module (using defineModule and all) but note that it's not using @nuxt/kit but instead a "homemade" shim that has similar (same?) methods. This should make it easy to transition to the real @nuxt/kit for Nuxt 3.

The plan is for the Nuxt 3 version to live on its own branch and have higher major version (we can skip 2 versions or so to give some space for the Nuxt 2 version to introduce breaking changes). Attempts at making a version compatible with both Nuxt 2 and Nuxt 3 were futile so this is how it has to be. Alternatively, a monorepo with both versions sounds like a viable alternative but those would have to not share dependencies so not sure if that would work (I'm not too familiar with the current monorepo solutions).

When implementing the new version, those are some challenges that I foresee:

  • Supporting Nitro and making Sentry available on the server side (in non-webpack/non-vite context). Current version exposes sentry on process.sentry which is a bit of a hack to make Sentry available globally and to avoid reinitializing it on every server side page load. This is to also to allow use of Sentry even outside of specific server routes. If there are better ways to do it in Nuxt 3 then we can try that, even if it would be a breaking change. Important: ensure that Sentry is initialized early in a global server context. It would likely not be enough to do from a middleware and require some request to run first.
  • Supporting publishing releases in Vite environment. Currently we are using the official webpack plugin to handle that. We would also need to support Vite. Looks like there is official support ready for Vite now in https://github.com/getsentry/sentry-javascript-bundler-plugins
  • Supporting tracing functionality. Part of the functionality uses connect/express middleware to instrument tracing of routes. Make sure that still works.
  • Adding the Vue composition APIs. Currently lacking.
  • Sentry express/connect middleware handlers (https://docs.sentry.io/platforms/node/guides/express/) have a bunch of logic for detecting transactions, session tracking and more. Not sure if h3 is compatible with those. If not then maybe those have to be adapted for Nuxt 3 version.

I'm open for contributors to tackle this. Since I'm not using Nuxt 3 at the moment, I don't have that much incentive or time to work on it myself.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions