Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decrease bundle size #395

Merged
merged 2 commits into from
Feb 2, 2021
Merged

Decrease bundle size #395

merged 2 commits into from
Feb 2, 2021

Conversation

fireridlle
Copy link
Contributor

don't inject http,https,os,utils polyfills. they are required only inside condition isNodeEnv, so we are safe to remove them from the browser bundle

extract from the heavy url-parse package only what we need

Before
image

After
image

Note: screenshots above were made from non minified bundle. minified bundle about 78KB.

extract from heavy url-parse package only what we need
@fireridlle fireridlle requested a review from faunaee February 1, 2021 11:43
Copy link
Contributor

@erickpintor erickpintor left a comment

Choose a reason for hiding this comment

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

LGTM

@fireridlle
Copy link
Contributor Author

@n400 there are some more improvements and investigations we can do. for example, replace fn-annotate package with our own implementation will save about 0.6kb (for minified version) as well as review query.js which currently takes 41% of bundle size.

one thing more, we probably could extract streaming feature to separate package, so users who don't need this feature will install only fauna core features

@fireridlle fireridlle merged commit 835fece into fauna:master Feb 2, 2021
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.

3 participants