re: We reduced our vendor.js from 210kb to 16kb in about five minutes of work and ten lines of code VIEW POST

FULL DISCUSSION
 

I think this post by @quii is relevant to this discussion. I hope we can do a lot more to improve on this front.

 

This is cool, I haven't seen this technique before

Is there a chance it could make some features a bit slow when they're first used?

By doing this, a few seldom-used libraries will only get called when the user triggers an action in our code.

So if i click some button, it's now that it downloads, parses and executes the JS; which might be slow.

I guess it's all trade offs and from my point of view it seems like a good one.

 

So if i click some button, it's now that it downloads, parses and executes the JS; which might be slow.

Prefetching would be the next step but it requires more than 5 minutes:

The other 194 are in chunks that load when import is called within the code.

Some are quite deep in app logic and we really never want them for most visits. They are only called as necessary. We would maybe want to prefetch them once folks get close to where they would be hidden, but that's about it.

I guess it's all trade offs and from my point of view it seems like a good one.

Yeah, you still download it only one time

code of conduct - report abuse