Skip to content
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

fix: Update import-in-the-middle #4745

Merged
merged 4 commits into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions experimental/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ All notable changes to experimental packages in this project will be documented

### :bug: (Bug Fix)

* fix(instrumentation): Update `import-in-the-middle` to fix [numerous bugs](https://github.com/DataDog/import-in-the-middle/pull/91) [#4745](https://github.com/open-telemetry/opentelemetry-js/pull/4745) @timfish

### :books: (Refine Doc)

* docs(instrumentation): better docs for supportedVersions option [#4693](https://github.com/open-telemetry/opentelemetry-js/pull/4693) @blumamir
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"dependencies": {
"@opentelemetry/api-logs": "0.51.1",
"@types/shimmer": "^1.0.2",
"import-in-the-middle": "1.7.4",
"import-in-the-middle": "1.8.0",
"require-in-the-middle": "^7.1.1",
"semver": "^7.5.2",
"shimmer": "^1.2.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,12 +309,11 @@ export abstract class InstrumentationBase<
: this._requireInTheMiddleSingleton.register(module.name, onRequire);

this._hooks.push(hook);
const esmHook =
new (ImportInTheMiddle as unknown as typeof ImportInTheMiddle.default)(
[module.name],
{ internals: false },
<HookFn>hookFn
);
const esmHook = new (
ImportInTheMiddle as unknown as {
Hook: typeof ImportInTheMiddle.default;
}
).Hook([module.name], { internals: false }, <HookFn>hookFn);
this._hooks.push(esmHook);
}
}
Expand Down
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.