Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(storage): Optimized storage category
sideEffects
to improve sha…
…ke-ability (#10375) <!-- Please make sure to read the Pull Request Guidelines: https://github.com/aws-amplify/amplify-js/blob/main/CONTRIBUTING.md#pull-requests --> #### Description of changes Refactored the storage module's `sideEffects` to improve shake-ability by moving singleton registration out of `index.ts`. Verified change with a simple Auth-only React app and a variety of bundlers. ##### Bundler results The table below outlines observed bundle size improvements from this change. Apps that don't use storage directly should also see improvements from no longer having to bundle `@aws-sdk/client-s3`. | Bundler | Parsed `packages` Δ | Parsed `node_modules` Δ | GZipped `packages` Δ | GZipped `node_modules` Δ | | --- | --- | --- | --- | --- | | Webpack | -41 kB | -107 kB | -6.58 kB | -48 kB | | Rollup | -44 kB | -390 kB | NA | NA | | Parcel | -31 kB | -98 kB | NA | NA | #### Issue #, if available Tangentially related to [Increase in package size with aws-amplify@4.3.36](https://t.corp.amazon.com/P72001406/overview) #### Description of how you validated changes - Manually confirmed bundle optimization with a simple Auth sample app - [`build_test_deploy`](https://app.circleci.com/pipelines/github/aws-amplify/amplify-js/14763/workflows/5ebc88a2-e898-4d42-a177-774b7dd0fbcc) CircleCI test pass - The 4 failing datastore observe tests are unrelated & currently being investigated by the datastore team #### Checklist <!-- Remove items that do not apply. For completed items, change [ ] to [x]. --> - [x] PR description included - [x] `yarn test` passes - [x] Tests are unchanged - [ ] Relevant documentation is changed or added (and PR referenced) By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
- Loading branch information