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

Defer loading of widget implementation to first usage #85

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

bollwyvl
Copy link

Thanks for maintaining this!

This adds lazy-loading of the widget implementation, CSS, and dependencies to the Lab plugin. From a cold cache, this trades:

  • increased time from the first "give me an instance widget X" to pixels
  • decreased time-to-moon-animation of every launch of the Lab application itself

The trade gets a bit murkier with cache, but parsing a huge main is also not free, and I suspect this time goes up faster than linearly.

Motivation

I've done this PR on a whole stack of projects, at this point... the arguments are usually for end users encountering fewer webpack issues (from reduced size/file count of vendor~main). I haven't had anybody revert the change, so seems reasonable to promote more broadly. For developers, it makes sourcemaps for the code in question and dependencies snappier, as it's no longer in the titanic main bundle. I have encountered no issues with deduplication.

@maartenbreddels
Copy link
Member

I love it, and plan to do it to the widget libraries I maintain as well. I think you have a similar or open on bqplot, and I'd like to see that merged as well.
Thanks!

@jtpio
Copy link
Member

jtpio commented Mar 12, 2021

Rebased onto the latest master to pick up the new CI.

@jtpio
Copy link
Member

jtpio commented Mar 12, 2021

I think you have a similar or open on bqplot, and I'd like to see that merged as well.

Probably referring to this PR? bqplot/bqplot#1192

@bollwyvl
Copy link
Author

bollwyvl commented Mar 17, 2021 via email

@bollwyvl
Copy link
Author

ha, down to +2 −4. c'mon linter! 🤞

@bollwyvl
Copy link
Author

Huzzah ✔️ !

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.

4 participants