widget-ts-cookiecutter
widget-ts-cookiecutter copied to clipboard
Defer loading of widget implementation to first usage
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.
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!
Rebased onto the latest master to pick up the new CI.
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? https://github.com/bqplot/bqplot/pull/1192
I like having named chunks for debuggability and_proof_, but yeah it's probably just vanity window dressing.
ha, down to +2 −4. c'mon linter! :crossed_fingers:
Huzzah :heavy_check_mark: !