Guess how many unique modules get loaded: import get from '//unpkg.com/lodash-es/get?module'; console.log(get({ message: 'Hello world' }, 'message')); Hint: The odd one out.
-
-
Replying to @tbranyen @TheLarkInn
Once loaded, guess how many get cached and guess how fast a reload is.. I’ve started devving like this and using a bundler (sometimes, when it makes sense to) as part of a deploy step rather than a build step every time I hit save.
1 reply 0 retweets 1 like -
Replying to @lukejacksonn @tbranyen
Unless I'm wrong, about the new implementation of Module Records etc...The only thing cached is the source itself saving the Network cost. The 53 modules still have to be parsed, executed, and evaluated. Which is the most expensive part of using JavaScript.
2 replies 0 retweets 1 like -
Chrome will cached the parsed JS as bytecode so parse time is negligible for the reload case (10x speedup). Evaluation is a mandatory/desired part of reloading.
1 reply 0 retweets 3 likes -
so one browser parses it as bytecode, how do they cache it session base? timeout base? at the end of the day, I've not seen it get anywhere near as close to as fast as bundled code not to mention the diff between 53 modules vs 1 3.5kb bundle
3 replies 0 retweets 1 like -
Replying to @TheLarkInn @robpalmer2 and
I believe Chromies have talked about their bytecode caching at Chrome Dev Summit. Perhaps
@samccone,@_developit, or@slightlylate can provide some clarification1 reply 0 retweets 1 like -
Replying to @DotProto @TheLarkInn and
Also, here's a repated thought dump from Addyhttps://gist.github.com/addyosmani/a74668d403c6de5b86b25e9daf6fe385 …
1 reply 0 retweets 1 like -
Replying to @DotProto @TheLarkInn and
There are many subtleties to code caching and many places it happens. Are you mostly curious about the case when you refresh in the same session (and strictly speaking a second load, not 3rd+)?
1 reply 0 retweets 1 like -
Replying to @slightlylate @DotProto and
I think the primary use case we're considering is a developer making repeated change-reload cycles to their app code file(s), whilst a remote vendor dependency that is 53-modules-deep remains constant. Can smart browser caching of that remote code be "fast enough"?
1 reply 0 retweets 0 likes
There is per-resource overhead, so totally atomizing things has limits. Beyond that, we do keep in-memory caches for JS resources and, if a script is run often enough, persist optimized representations to disk.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
& Web Standards TL; Blink API OWNER
Named PWAs w/
DMs open. Tweets my own; press@google.com for official comms.