Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # 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 and others added 3 commits March 17, 2021 08:08
Co-authored-by: Frédéric Collonval <fcollonval@gmail.com>
@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 ✔️ !

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants