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

feat(ui): better bundle size with esmodules #548

Merged
merged 1 commit into from
Jul 24, 2020
Merged

Conversation

aulneau
Copy link
Contributor

@aulneau aulneau commented Jul 23, 2020

What this does

I was doing some work optimizing the bundle size of the docs site and kept seeing that all of the UI library was being bundled in with the application, and I know that we are using esmodules for the site, which I thought would lead to tree-shaking of any component not used. This was not the case.

After digging into it, I found that rollup (which TSDX uses under the hood) offers an option for preserveModules which will let us output all of the components to their own folder under dist/. This has given us a good amount of savings on the docs site of ~46kb 🗡️ 🔥 You can read a good thread about this here.

Before:

Screen Shot 2020-07-23 at 11 44 43 AM

After

Screen Shot 2020-07-23 at 11 44 29 AM

@github-actions
Copy link
Contributor

github-actions bot commented Jul 23, 2020

Blockstack UI Documentation

The Blockstack UI docs have been deployed with Vercel using the code from this PR!

Built with commit 6c6baea.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 23, 2020

Deploy previews

Deploy previews for blockstack-app and blockstack-test-app are ready!

Built with commit 6c6baea.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jul 23, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 4092eb3:

Sandbox Source
fancy-violet-4fycl Configuration

@aulneau aulneau merged commit 2c7046f into master Jul 24, 2020
@kyranjamie kyranjamie deleted the feat/rollup-changes-ui branch June 14, 2021 12:25
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.

2 participants