question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Total JS size is huge

See original GitHub issue

Hi! This project looks absolutely beautiful but I just imported GithubPicker and ChromePicker into my project and my prod-mode output after bundling increased by 143,413 bytes which is huge.

Is this something that will be addressed in #575 ?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:13
  • Comments:5

github_iconTop GitHub Comments

11reactions
ricokahlercommented, Apr 5, 2020

I second this. By doing a quick check on bundlephobia, it seems like this package isn’t bundled using ES modules.

image

Source

You can actually get some very big bundle size wins by:

  • supporting tree shaking via an ES6 modules build/bundle. you can do this by creating an ESM bundle and adding the module property to the published package.json. (reference)
  • bundling with rollup. rollup creates bundles with nice output and supports ESM bundles
  • only importing the colors your need from material-colors
  • removing lodash
  • removing tinycolor2 for an internal version (maybe using a canvas implementation)

None of these have to breaking changes btw. These could be addressed in a minor before 3.x.

Let me know if you’re accepting PRs, this is a great lib and I’d happy to contribute!

4reactions
ricokahlercommented, Aug 14, 2020

@casesandberg @atfzl I would suggest re-opening this (I think it auto closed when the PR merged). Still a bit to go but HUGE improvement 🎉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Total JavaScript Size Should Not Be Too Big | BoldGrid
If the web page's JavaScript files are very large, they will take longer for the web browser to download and decompress.
Read more >
Small Bundles, Fast Pages: What To Do With Too Much ...
This post will explain why bundle size matters and recommend tools and processes you can follow to monitor, visualise, and most importantly, ...
Read more >
JavaScript performance beyond bundle size - Nolan Lawson
When talking about the size of JavaScript code, you have to be precise. Some folks will say “my library is 10 kilobytes.” Is...
Read more >
Package size is massive · Issue #2707 · getsentry/sentry ...
This seems true of Vue.js as well. Vue's parsed size is 64.4 kB, while Sentry is a combined 68.0 kB (including the 6.1...
Read more >
total size of all assets in a webpage - javascript - Stack Overflow
I am running a Google Sites New based website. This website's pages may contain images and iframes to other web pages. By using...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found