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
Can the bundle size be reduced? #113
Comments
@mrchief Longer-term we'll also be able to replace the |
@chrisradek This is great news!
Yes, I totally understand. I'm not deeply familiar with the subject, so I can't say for certain whether this would work out, but I've found pino to be very modular (in addition to being fast and lightweight). It has a big ecosystem of modules so you can pick and choose the ones you actually need. Ultimately, I'd leave up to the maintainers to make the call but I'm happy that things are proceeding in the right direction! |
When can a release be made that moves the |
Hi @jplock, I explained in #187 why making |
|
Hi @vertti, |
@willarmiros Sure. I would love to hear that I'm doing something silly here. I have a bunch of lambdas that have a shared dependency. This dep is instrumented with x-ray for it's Postgresql calls. In my common library I run:
then doing
and checking where the
But I'm guessing this is just the difference of using npm dependencies and not webpacking/treeshaking/uglifying? |
Interesting, I reproduced that just fine on my end. We shouldn't have to require our customers to use treeshaking before deploying their Lambda functions to reduce the size of a dependency - especially because we only use Since its only use could be accomplished with native JS, I'll open a PR to remove |
Are there any updates on this? moving aws-sdk to peerDependencies to be more specific I'd rather not use Xray at all than add the entire aws-sdk to my bundle, especially after doing all these workarounds in my serverless environment to remove it like:
And yet it still ends up in my package due to aws-xray-sdk-core, which makes my packaged lambdas size too big and slows down my deployments, very frustrating. |
Hi @khaledosman, |
As of 3.0.0-alpha.2, |
According to bundlephobia, the core package weighs at 98kb minified+gzipped. Is there any way to reduce this bundle size?
lodash and winston seem to be obvious targets. lodash supports tree shaking (as well as has individual packages that are lighter). winston is a fatty package in itself with a lot of lighter & faster replacements.
I think it'd help to bring the size down especially for AWS Lambda packages which themselves can be very lightweight.
Thoughts?
The text was updated successfully, but these errors were encountered: