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
Reduce bundle size #5862
Comments
How to lazy load large libraries in lab extensions: jupyterlab/jupyterlab-latex#107 |
An example up for xterm on #5994. Not great, but does save ~350kb Sanitizer is hard, as its API would have to change, as it is currently synchronous. I didn't realize how brutal the blueprint stuff really is: because it's used by every toolbar, there's no point in moving it out of the Pretty late in the game at this point, but I feel like we either need to ramp up our usage to use every single bell and whistle in there... or forbid use of it in the critical path (any sidebar, menu, launcher, etc.), and figure out a way for them to get them conveniently lazy loaded. |
Yeah, sanitizer it tough. A shame postcss is so large.
|
Is it even worth it if it has to be loaded every time? Does settings loading block any UI drawing? If so, there's no real benefit, as it's an extra connection. The only place we can really win for "clean" first start is things that won't be used at all until you decide what you are going to do: codemirror actually would be a candidate, and we as sure as shooting would want to not be loading monaco in the hot path. |
I had a look at |
Can't personally vouch for it but have read about ⏰ Day.js 2KB immutable date library alternative to Moment.js with the same modern API https://github.com/iamkun/dayjs reference: moment/moment#2373 (comment) |
Somebody mentioned previously that moment.js could be optimized by using submodule imports. Is this the case? |
Somebody mentioned previously that moment.js could be optimized by using
submodule imports. Is this the case?.
Not really: everything is chained off a moment instance, so there's no way
to get just the methods you want. It is possible to get not-stock builds.
https://medium.com/@k2u4yt/momentjs-vs-date-fns-6bddc7bfa21e
A huge whammy is the locale information, and we don't l10n, so it's not
worth it... yet.
I'm not down on moment (did some of the iso 8601 duration stuff), and have
used it in extensions, but we're presently just not using it much.
Day.js seems interesting, but I was just looking for something we (or one
of our dependencies) already nominally "trust" and therefore would already
have lying around, instead of adding new dependencies.
|
Follow up from #5722 (comment)
cc @ian-r-rose
The text was updated successfully, but these errors were encountered: