pluto-message-ingestion: remove externals from ncc config #1180
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.
What does this change?
Remove the "externals" field from pluto message ingestion's ncc config.
The externals field excludes a package from the bundled JS output. This could be used in AWS Lambda runtimes <= 16 which bundled the v2 AWS JS SDK. However 18 and above bundle the v3 SDK, so we need to either 1) stop excluding the SDK from the bundle or 2) migrate to the v3 SDK. We should probably do both (the first so we have confidence about which version of the SDK is being used at runtime, the second to keep uptodate with library updates) but for now I'm focused on upgrading the runtime, so we'll come back to the SDK upgrade at a later date.
How to test
cd pluto-message-ingestion; yarn; yarn build
. Before this change, the bundled output is 34kB (11kB zipped). After this change it is ~10.7MB (1.3MB zipped).(That's a huge increase but still well within AWS limits, so we'll live with it. Moving the v3 SDK will help as the unused parts of the SDK are more easily excluded by bundlers like ncc).
How can we measure success?
Lambda can run on the Node 18 runtime.
Have we considered potential risks?
Images
Accessibility