-
Notifications
You must be signed in to change notification settings - Fork 90
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: use inline cjs build #1146
Merged
Merged
Conversation
This file contains 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
syall
approved these changes
Jan 17, 2024
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.
LGTM given the tests in the PR description pass.
4 tasks
trentm
added a commit
to trentm/opentelemetry-js-contrib
that referenced
this pull request
Jan 25, 2024
…dk-v3 instrumentation As of smithy-lang/smithy-typescript#1146 (details at smithy-lang/smithy-typescript#1113) the CommonJS export for many (all?) `@smithy/*` packages is now an esbuild bundle -- all in `dist-cjs/index.js`. That means that subfile patching like this no longer works: ```js const v3SmithyMiddlewareStackFile = new InstrumentationNodeModuleFile( '@smithy/middleware-stack/dist-cjs/MiddlewareStack.js', ['>=1.0.1'], this.patchV3ConstructStack.bind(this), this.unpatchV3ConstructStack.bind(this) ); ``` In our case this breaks as of `@smithy/[email protected]` released 2024-01-17T22:26:42.432Z. This is considered a non-breaking change, so the dependency ranges for earlier released versions of `@smithy/smithy-client` will pick this up. A fix is to change the `@smithy/middleware-stack` patching to be on the top-level module exports. Because the `constructStack` field is only available as a getter we cannot use shimmer (InstrumentationBase._wrap). Instead this returns a new `moduleExports` object with a new getter that shims the call.
trentm
added a commit
to open-telemetry/opentelemetry-js-contrib
that referenced
this pull request
Feb 5, 2024
…dk-v3 instrumentation (#1913) As of smithy-lang/smithy-typescript#1146 (details at smithy-lang/smithy-typescript#1113) the CommonJS export for many (all?) `@smithy/*` packages is now an esbuild bundle -- all in `dist-cjs/index.js`. That means that subfile patching like this no longer works: ```js const v3SmithyMiddlewareStackFile = new InstrumentationNodeModuleFile( '@smithy/middleware-stack/dist-cjs/MiddlewareStack.js', ['>=1.0.1'], this.patchV3ConstructStack.bind(this), this.unpatchV3ConstructStack.bind(this) ); ``` In our case this breaks as of `@smithy/[email protected]` released 2024-01-17T22:26:42.432Z. This is considered a non-breaking change, so the dependency ranges for earlier released versions of `@smithy/smithy-client` will pick this up. A fix is to change the `@smithy/middleware-stack` patching to be on the top-level module exports. Because the `constructStack` field is only available as a getter we cannot use shimmer (InstrumentationBase._wrap). Instead this returns a new `moduleExports` object with a new getter that shims the call This PR also updates .tav.yml to reduce the number of aws-sdk package versions tested.
HenryCorn
pushed a commit
to HenryCorn/opentelemetry-js-contrib
that referenced
this pull request
Feb 6, 2024
…dk-v3 instrumentation (open-telemetry#1913) As of smithy-lang/smithy-typescript#1146 (details at smithy-lang/smithy-typescript#1113) the CommonJS export for many (all?) `@smithy/*` packages is now an esbuild bundle -- all in `dist-cjs/index.js`. That means that subfile patching like this no longer works: ```js const v3SmithyMiddlewareStackFile = new InstrumentationNodeModuleFile( '@smithy/middleware-stack/dist-cjs/MiddlewareStack.js', ['>=1.0.1'], this.patchV3ConstructStack.bind(this), this.unpatchV3ConstructStack.bind(this) ); ``` In our case this breaks as of `@smithy/[email protected]` released 2024-01-17T22:26:42.432Z. This is considered a non-breaking change, so the dependency ranges for earlier released versions of `@smithy/smithy-client` will pick this up. A fix is to change the `@smithy/middleware-stack` patching to be on the top-level module exports. Because the `constructStack` field is only available as a getter we cannot use shimmer (InstrumentationBase._wrap). Instead this returns a new `moduleExports` object with a new getter that shims the call This PR also updates .tav.yml to reduce the number of aws-sdk package versions tested.
2 tasks
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.
This PR switches the
build:cjs
operation of all packages to use the inline transform.See #1113
JS SDK tests: