Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
judge2020
· 4y ago · 0 comments
AWS used to have this problem, which is why their JS framework now recommends only installing and importing parts of the API you need:
https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-...
Comments
[–]
hinkley
4y ago
You still have to police your coworkers to keep them from importing the whole goddamned thing just for the auth or s3 code...
[–]
richthegeek
4y ago
That's what a linter is for!
[–]
kclay
4y ago
What linting rule would enforce this?
[–]
SpikeMeister
4y ago
I've used this one:
https://eslint.org/docs/latest/rules/no-restricted-imports
[–]
underyx
4y ago
I use a custom Semgrep rule for it.
[–]
quackware
4y ago
And yet aws cdk has migrated to a monopackage design :(
https://docs.aws.amazon.com/cdk/v2/guide/migrating-v2.html
[–]
sondr3
4y ago
You will rarely, if ever, deploy an application running CDK, so the bundle size is more or less irrelevant. It’s basically a glorified YAML compiler used to bundle infrastructure.
[–]
oneplane
4y ago
Not only that, but you'll also not really be running it anywhere that isn't "on AWS", like a browser.
[–]
crazysim
4y ago
The cloudformation job will more than likely dwarf the tsc overhead from cdk stuff being a mono package.