-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
feat(nitro-utils): Export Rollup Plugin wrapServerEntryWithDynamicImport
#14176
base: develop
Are you sure you want to change the base?
Conversation
b7aba48
to
21d30b6
Compare
return { id: source, moduleSideEffects: true, external: true }; | ||
} | ||
|
||
if (options.isEntry && source.includes('.mjs') && !source.includes(`.mjs${SENTRY_WRAPPED_ENTRY}`)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this might not be strict enough. For example in SolidStart, the prerenderer would run through this too.
I'm not sure what the side effects are tho so I'm reluctant to change anything for the time being but maybe we can think about alternatives, e.g. making it configurable which sources should be caught in this. Maybe via a filter function or an array of entry files to be wrapped?
serverConfigFileName: string; | ||
resolvedServerConfigPath: string; | ||
entrypointWrappedFunctions: string[]; | ||
additionalImports?: string[]; | ||
debug?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
m: Could we define an exported type for this instead of inlining it? In case the consuming sides need to expose these via their own options, it would be prone to running out of sync.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one question but otherwise good to go from my end! Full disclosure: I'm not completely familiar with the rollup plugin details but it looks fine from my perspective. I think the package is correctly configured to not be published or cause issues while publishing.
# Sentry Utilities for Nitro-based SDKs | ||
|
||
[![npm version](https://img.shields.io/npm/v/@sentry-internal/nitro-utils.svg)](https://www.npmjs.com/package/@sentry-internal/nitro-utils) | ||
[![npm dm](https://img.shields.io/npm/dm/@sentry-internal/nitro-utils.svg)](https://www.npmjs.com/package/@sentry-internal/nitro-utils) | ||
[![npm dt](https://img.shields.io/npm/dt/@sentry-internal/nitro-utils.svg)](https://www.npmjs.com/package/@sentry-internal/nitro-utils) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
super-l: As long as we don't publish this package, these badges will yield a 404 but that's fine
packages/nitro-utils/package.json
Outdated
"@sentry/core": "8.36.0", | ||
"@sentry/types": "8.36.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
m: Does this package actually depend on core and types? I didn't see an import in the source files.
export default makeNPMConfigVariants( | ||
makeBaseNPMConfig({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
l: Maybe one more question: Do we need a CJS version of this or is ESM enough? If we don't need CJS, we can configure the build to only emit ESM. In this case, we should also adjust the exports in package.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ESM should be enough in Nitro 👍
3c908f4
to
73150d2
Compare
73150d2
to
ab1ccb3
Compare
ab1ccb3
to
4063dee
Compare
Creates an internal package
@sentry-internal/nitro-utils
which exports the Rollup plugin which is currently used in SolidStart and Nuxt.