This repository has been archived by the owner on Apr 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 787
Chore/reduce bundle size #2659
Merged
benjamn
merged 8 commits into
apollographql:wip-reduce-bundle-size
from
JoviDeCroock:chore/reduce-bundle-size
Dec 13, 2018
Merged
Chore/reduce bundle size #2659
benjamn
merged 8 commits into
apollographql:wip-reduce-bundle-size
from
JoviDeCroock:chore/reduce-bundle-size
Dec 13, 2018
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
benjamn
reviewed
Dec 13, 2018
benjamn
reviewed
Dec 13, 2018
benjamn
reviewed
Dec 13, 2018
benjamn
reviewed
Dec 13, 2018
Co-Authored-By: JoviDeCroock <[email protected]>
Co-Authored-By: JoviDeCroock <[email protected]>
Co-Authored-By: JoviDeCroock <[email protected]>
Thank you so much for the quick response, let's make this wonderfull OSS project even better. |
Just as a heads up, I'm planning to open a PR here that mirrors apollographql/apollo-client#4234, so I will merge this PR into that branch once I've pushed it. We can publish beta versions to npm, but I'd like to keep track of how much bundle size we've saved, in one long-running PR. |
Okay, i'll probably be posting more of these, my plan was to start at react-apollo and then move on to others. |
benjamn
pushed a commit
that referenced
this pull request
Jan 20, 2019
Use our own flowRight-like function instead of using lodash.flowright. In addition to being smaller, this implementation does not require using CommonJS require to import a separate package.
benjamn
added a commit
that referenced
this pull request
Mar 5, 2019
Similar in spirit to apollographql/apollo-link#959 This inlining was first introduced in PR #2661 with the following commit: de2b5fc At the time, inlining made sense because TypeScript was injecting copies of the __extends, __rest, etc. helpers into every module that used them. Depending on the tslib package seemed undesirable because the available bundle size measurement tools (e.g. bundlephobia.com) mistakenly counted the entire tslib package against react-apollo, without acknowledging the possibility of sharing that package between multiple Apollo packages. It seemed safer to inline only the helpers we needed at the top of lib/react-apollo.esm.js. Now that we have a more holistic way to measure bundle sizes (#2839), and react-apollo works better with tree-shaking tools (#2659, #2661, #2677), we know that overall application bundle sizes benefit from sharing a single copy of the tslib helper package, even if no tree-shaking is happening. Of course, with tree-shaking, that one copy of the tslib package can be shrunk to contain just the helpers that are actually used.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Checklist:
I attempted to reduce the bundlesize by removing dependencies, I personally prefer making several small PR's for this so we can handle problem by problem.