Closed pkarw closed 4 years ago
I'd like us to focus on this task. My ideas of simple ways to optimize the bundle size:
src/amp-renderer
src/google-tag-manager
src/hotjar
src/google-analytics
core/offline-order
(+ remove all dependencies + move all offline orders logick into this module prior to disabling it :) )localForage
- we're now using only LocalStorage and it's pretty limited usage. The storage.ts
is a good place to start - it's a proxy over localForage. We can change the proxied calls from localForage.setItem
to localStorage.setItem
etc. -> https://bundlephobia.com/result?p=localforage@1.7.3apollo-client
references when project is not using graphQL driver (config.server.api != graphql
) - it should be somehow done dynamically or simply separate all the logick of apollo to another core/module to not let webpack to include apollo https://bundlephobia.com/result?p=apollo-client@2.6.4, https://bundlephobia.com/result?p=vue-apollo@3.0.0, https://bundlephobia.com/result?p=graphql@14.5.8bodybuilder
by moving the query language to vue-storefront-api
- https://github.com/DivanteLtd/vue-storefront/issues/2167webpack-bundle-analyzer
vue-carousel
- https://bundlephobia.com/result?p=vue-carousel@0.18.0https://www.dropbox.com/s/lktr1cttl2gojwo/Screenshot%202019-10-24%2010.58.53.png
The src/modules
it's really huge - it's not worth the size: https://github.com
Bundle overview: https://www.dropbox.com/s/yn761a68sncvlqn/Screenshot%202019-10-24%2010.57.48.png
bodybuilder+graphql = 500kB
[x] graphql
is already loaded dynamically
[x] bodybuilder
has been removed as a part of #2167
WIP - Remove localForage
I will try to move it to separate package and remove all timeouts from storage.ts
What is the motivation for adding / enhancing this feature?
This is an open task. Each lib removed/replaced to make the overall bundle size smaller - is a win in here :)