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.

Huge component size

See original GitHub issue

Just noticed that the overall component has 400+ kb in size. I must say that’s pretty huge for a component that generates fields. After taking a look at the source code I noticed that moment.js is used in several places for very basic functionalities. I think you can get rid of it to save some space.

Only by removing all moment js dependencies (4) the size shrinked from 400kb to 176kb. There is also one component fieldVueMultiSelect which for some reason uses the whole Vue library. I don’t think there is need to bring the whole library just to instantiate that component. There should be another way of doing it. By removing the vue dep the final file further reduces to 126kb.

Taking down lodash util function brings the file down under 100kb. To sum it up, by removing only external dependencies (moment, vue and lodash) I managed to bring the library down from 400+ kb to 55kb and by removing external components it goes down to 29kb.

The size here is huge factor for people deciding whether to use such a component or not. I would say we could shrink this one down to 100-150kb very easily and then with some effort it can be brought under 100kb.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:38 (26 by maintainers)

github_iconTop GitHub Comments

2reactions
icebobcommented, Feb 15, 2017

Full bundle: 75k Core bundle: 39k

Great!

2reactions
icebobcommented, Feb 14, 2017

In this case we can create two bundles. A minimal version (for only html5 field, but can be import the further fields) and a full version (as current bundle, which contains every built-in fields)

Opinion?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Giant component - Wikipedia
In network theory, a giant component is a connected component of a given random graph that contains a finite fraction of the entire...
Read more >
Size of the giant component in a random geometric graph
In this paper, we study the size of the giant component CG C G in the random geometric graph G=G(n,rn,f) G = G...
Read more >
Expected size of giant component in ER graph
Given an undirected G(n, p) graph with p=1.2/n , what is the expected size of its giant component? Note: I know that there...
Read more >
The Size of the Giant Component of a Random Graph with a ...
In this paper we analyse the size of the giant component in the former case, and the structure of the graph formed by...
Read more >
The size of the giant component in random hypergraphs - arXiv
We consider connected components in k-uniform hypergraphs for the following notion of connectedness: given integers k\ge 2 and 1\le j \le k-1, ...
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