Front-End Web & Mobile
AWS Amplify JavaScript Library Announces Leaner Bundles and Faster Load Times
We are excited to announce that the AWS Amplify JavaScript library has significantly reduced the bundle size for critical categories, including Auth, Storage, Notifications, and Analytics. For your users, this translates into faster load times when using your apps.
These reductions in bundle size are in response to popular demand from our community. We are committed to improving the bundle size and tree-shaking when using the Amplify JavaScript library, to help you provide a fast and performant experience to your users.
The Importance of Smaller Bundle Sizes
In order to meet the expectations of JavaScript developers, we have written our underlying clients that interact with AWS services to optimize for tree-shaking. This enables us to deliver the experience our customers need, while producing a substantially reduced bundle size. We are also removing underlying dependencies and relying on browser APIs such as Fetch to further reduce the bundle size.
These changes have enabled us to fully own our library stack and optimize it for the most commonly used frameworks and build tools. In doing so, we have reduced the bundle size by 26% for Auth, 59% for Notifications and Analytics, and 55% for Storage.
NOTE: The size numbers measure the final minified and gzipped bundle sizes. The “After” results were generated using Amplify JavaScript v5.3.4. The “Before” results were generated using Amplify JavaScript v5.2.4. Both results are generated using size-limit tool v8.2.6 and bundler webpack 5.88.0. To examine the result yourself, please follow this comment.
The Future of Amplify JavaScript
The changes mentioned in this blog are only the beginning of enhancements planned to reduce the bundle size and improve the overall experience of using the Amplify JavaScript library. Further enhancement that we have planned include:
- Further reduce the bundle size and app load times.
- Improve the TypeScript experience, including better auto-complete and Intellisense in your IDE. Your feedback is appreciate on this RFC.
- Expand Server Side Rendering support, including supporting additional frameworks and tooling out of the box such as SolidJS, Astro, and NuxtJS.
These areas of focus were driven by feedback from our community, and we are excited to bring these changes forward as part of our next major version of the Amplify JavaScript library.
To build apps with AWS Amplify you can visit our documentation. To stay connected with our community, follow us on our Github repo and join our Discord server.