Repository navigation
fix(esm): register synchronous hooks when require(esm) is disabled - #11277
joeyzhao2018 wants to merge 1 commit into
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
❌ ErrorsYour PR has failed checks. Please review the issues below and take necessary action before merging. 🚦 38 Pipeline jobs failed
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 54b6f737a4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // Only the pure loader helper is bundled. The public import-in-the-middle registry | ||
| // and its generated wrappers must keep using the application's shared dependency. | ||
| // A CommonJS build lets synchronous preloads install hooks when require(esm) is disabled. | ||
| module.exports = [config, { |
There was a problem hiding this comment.
Update the license tests for the multi-compiler configuration
Changing this export from an object to an array breaks the existing consumer in scripts/test/vendor-licenses.spec.js: its bundle() helper still reads config.plugins[0], which now throws TypeError: Cannot read properties of undefined (reading '0'). Consequently, the license tests run by npm run test:scripts in .github/workflows/project.yml fail before checking any bundled licenses. Update that helper to select the dependencies configuration and preserve its output and plugin settings.
Useful? React with 👍 / 👎.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #11277 +/- ##
===========================================
- Coverage 99.13% 72.06% -27.07%
===========================================
Files 1118 610 -508
Lines 184942 95439 -89503
Branches 82 9 -73
===========================================
- Hits 183338 68779 -114559
- Misses 1603 26660 +25057
+ Partials 1 0 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
pabloerhard
left a comment
There was a problem hiding this comment.
I’m unsure whether this is the approach we should take. Can we hold off until we reach an agreement?
|
If this is on hold, could it be converted to draft to stop notifications? |
What does this PR do?
AWS Lambda can disable
require(ESM), which preventsdd-trace/register.jsfrom loading the synchronous hook helpers and makes Node.js 26 emit DEP0205 when the tracer falls back tomodule.register().Share a CommonJS loader implementation between the CommonJS preloader and the ESM loader entry point. Build the pure
import-in-the-middlehelper as CommonJS through the existing vendor pipeline, using the currently pinned dependency and preserving its public instrumentation registry. Keep matcher initialization lazy and retain the asynchronous fallback on older runtimes.Motivation
Allow Lambda applications to install synchronous module hooks without enabling experimental module loading or suppressing deprecation warnings.
Additional Notes
Validation:
require(ESM)disabled.npm run lint,npm run lint:editorconfig, andgit diff --checkpass.Deployed AWS validation, release-line backport artifacts, and a published Lambda layer remain outstanding.