feat(lib): add native NodejsFunction with Rolldown bundling - #402
garysassano wants to merge 7 commits into
Conversation
Signed-off-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
NodejsFunction with Rolldown bundling
|
I think this PR has interesting components that we may want to split and rebase:
These depend on an ongoing effort for defining a cross-cloud Asset (and bundling) mechanism as per #380 (also referenced in the issue driving this PR). Can we first align on how to slice and land these? Additionally - I think we aim to keep Currently you may use https://github.com/TerraConstructs/base/tree/main/src/aws/compute/function-nodejs which is already an exact Port of AWSCDK L2 + Asset Pipeline (as well as decoupled bundling). So perhaps the changes proposed here could improve that existing AWS L2 specific construct? Another consideration is the ongoing work to integrate with AWSCDK specifically through the AWSCC+cfncompat provider which is the ideal way forward.
in conclusion:
Let's align and discuss via cdk.dev slack and perhaps on the next CDKTN Sync-up call? |
|
Agreed that the current PR crosses both the asset-lifecycle and provider-ownership boundaries. This needs an architectural split rather than only a commit split. The generic package should provide provider-independent Node.js bundling behind the asset interfaces agreed in #380, with core owning identity, staging, packaging, and synthesis lifecycle. The Lambda construct is AWS-specific and should move to TerraConstructs or a provider-specific I have pushed the first provider-independent isolation in The bundler package passes 38 tests and the AWS Lambda package passes 12 tests. Both TypeScript builds, ESLint, Prettier, package tarball checks, and the exported declaration check also pass. The remaining decisions are:
Once those ownership decisions are settled, I can rebase the bundler onto the agreed core asset API and move the AWS-specific work to its chosen repository. |
e6c565f to
127bc9f
Compare
|
FYI, I'm asking a Hermes Bot to test the Asset Pipeline PRs against this (and other) implementations for it it created this DX Report the assets related work carries a label for easy reference: |
Related issue
Closes #401
Description
Adds native
NodejsFunctionconstruct with Rolldown bundling, deterministic ZIP assets, and automatic IAM and logging setup:The unpublished TypeScript/JavaScript packages expose native Rolldown controls, validate build inputs and ZIP limits, and include package guides and a runnable example. Native addons require prepared files or layers.
Validation: 49 package tests, all 542 core tests, builds, lint, formatting, dependency and packed-consumer checks pass. AWS deployment, invocation, code updates and cleanup passed; all 12 resources were confirmed absent.
Checklist