chore: Hoist transitive imports for bundles#21858
Merged
Merged
Conversation
Member
|
I think we should find out, why do we have this imports at all?? Like, this: import '@sentry/conventions/attributes';
import '@opentelemetry/core';
import '@opentelemetry/sdk-trace-base';seems like it should def. not be in the bundle there at all!! |
mydea
approved these changes
Jun 30, 2026
Member
|
seems we can't really get rid of this without splitting our builds into separate builds, which also seems unnecessary. this seems easy enough! |
Lms24
approved these changes
Jun 30, 2026
timfish
approved these changes
Jun 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
same as with #21856 I came across this with adding the Prisma integration to Cloudflare.
What has changed
The
@sentry/opentelemetrySDK has some side effect imports, which don't do anything: https://unpkg.com/@sentry/opentelemetry@10.62.0/build/esm/index.jsthose are the imports
hoistTransitiveImportshas been added to get rid of the side effect imports. However, I'm confused with this option, as the docs say that this option is actually ignored whenpreserveModuleshave been set (but it still has an effect).Also here, if someone has a better idea - I'm all ears.