-
Notifications
You must be signed in to change notification settings - Fork 4k
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
(aws-lambda-nodejs): Support bun
lockfiles for NodejsFunction bundling
#31753
Comments
Thanks @blimmer for submitting the feature request. |
I don't recommend developing using Bun and deploying to a Node platform. While I'm sure you'd be fine in the vast majority of cases, it could lead to some particularly annoying bugs. Maybe I'm missing something, but it seems like this could only lead to confusion if users expect lock file support to imply Bun engine use. Edit: After thinking on it a bit more, I think you'd likely be okay. The issues I've seen were related to moving Node projects to Bun, rather than the other way around. |
This logic just allows installing dependencies from |
### Issue aws#31753 Closes aws#31753. ### Reason for this change `bun` is rapidly gaining popularity because it's extremely performant compared to `node`. `bun` has its own lockfile, `bun.lockb`, which is not currently respected by AWS CDK when bundling `NodejsFunction`s. ### Description of changes This code is very well-structured, so it was simple to add bun support alongside `yarn`, `pnpm` and `npm`. ### Description of how you validated changes I linked this code up to a simple, sample CDK app with a `bun` lockfile. I wasn't able to `bun cdk synth` before my changes. Then, after linking up my local workspace, I was able to bundle with my `bun` lockfile. I also added unit tests similar to those that exist for the other packages managers. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Something really weird happened with the PR. The commit ended up on |
Comments on closed issues and PRs are hard for our team to see. |
Describe the feature
Today, NodejsFunction supports lockfiles from the following ecosystems:
bun
is gaining in popularity and has its own lockfile,bun.lockb
. It would be great ifNodejsFunction
supported using this lockfile.Use Case
We've been migrating our apps to use
bun
since it's so much faster thannode
. However, when creating anew NodejsFunction
with a bun lockfile, we get this error:For now, we'll probably move over to a supported package manager, but we'd love to see native support for
bun.lockb
.Proposed Solution
Update the bundling logic to include
bun
and supportbun install
-ing.Other Information
No response
Acknowledgements
CDK version used
2.162.1
Environment details (OS name and version, etc.)
MacOS
The text was updated successfully, but these errors were encountered: