Skip to content

Conversation

@dancastellon
Copy link
Contributor

@dancastellon dancastellon commented Aug 7, 2018

Resolves #4514
Impact: minor
Type: performance

Issue

The Swiper NPM module (126 kb) is included in the initial client bundle. It's only used in one place - the cart drawer.

Solution

Move the loading of the module to a dynamic import.

Breaking changes

None.

Testing

  1. Add items to cart
  2. Confirm swiper still works (you can drag the items left/right while cart is expanded)
  3. Confirm swiper is no longer in bundle. Run Reaction with export TOOL_NODE_FLAGS='--max-old-space-size=4096' && METEOR_DISABLE_OPTIMISTIC_CACHING=1 meteor run --production --extra-packages bundle-visualizer

Before

swiper-before

After

swiper-after

@brent-hoover
Copy link
Collaborator

2018-08-08_06-41-17

Copy link
Collaborator

@brent-hoover brent-hoover left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested. Works well. 👍

@aldeed aldeed merged commit 06b71e5 into release-1.15.0 Aug 14, 2018
@aldeed aldeed deleted the perf-4514-dancastellon-swiper-dynamic-import branch August 14, 2018 21:00
@spencern spencern mentioned this pull request Aug 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants