You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
docs(lambda-nodejs): preserve decorator metadata during pre-compilation - #39332
preCompilation hands the JavaScript entry point emitted by TypeScript to esbuild, but extensionless imports can still resolve to adjacent TypeScript sources. Those imported modules are then compiled without decorator metadata. Document the confirmed --resolve-extensions=.js workaround, the required compiler configuration, and its limitation that imported JavaScript must exist.
Validation
The README example compiled and translated with jsii-rosetta (1 snippet, no diagnostics).
A real TypeScript/esbuild reproduction confirms default extensionless imports lose imported decorator metadata and --resolve-extensions=.js preserves design:paramtypes at runtime.
Documentation only; no changes to bundling behavior or synthesized infrastructure.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license.
This PR is a documentation-only change to the aws-lambda-nodejs module. It adds five lines of JSDoc to the existing preCompilation property on BundlingOptions (lib/types.ts) and expands the "Pre Compilation with TSC" section of the README with a worked example showing how to set esbuildArgs: { '--resolve-extensions': '.js' } so that decorator metadata is preserved for imported modules during pre-compilation.
The change introduces no public API surface change, no signature change, and no synthesis or behavior change. The documented esbuildArgs usage is valid against the existing esbuildArgs?: { [key: string]: string | boolean } signature, and all referenced properties (preCompilation, tsconfig, entry) are real existing members, so the README example type-checks and carries no regression risk. No issues found on this change.
🔴 0 blocking · 🟡 0 recommended · ⚪ 0 optional
Generated automatically. React 👍 or 👎 to tell us whether this review helped, so we can improve these reviews.
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
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.
Issue # (if applicable)
Closes #21168.
Description
preCompilationhands the JavaScript entry point emitted by TypeScript to esbuild, but extensionless imports can still resolve to adjacent TypeScript sources. Those imported modules are then compiled without decorator metadata. Document the confirmed--resolve-extensions=.jsworkaround, the required compiler configuration, and its limitation that imported JavaScript must exist.Validation
--resolve-extensions=.jspreservesdesign:paramtypesat runtime.Documentation only; no changes to bundling behavior or synthesized infrastructure.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license.