@yourtwitter
@mgechev
Differential loading
● Produce ES5 bundles for newer browsers
● Do not send polyfills to modern browsers
● Smaller payload
● Do not downlevel modern features
● Faster execution
● Smaller payload
Slide 8
Slide 8 text
@mgechev
-65KB polyfills
~2-10% smaller bundles
Slide 9
Slide 9 text
@mgechev
Step 1: Load HTML Step 2: Look at script tags Step 2: Download right
version
Differential loading
@yourtwitter
@mgechev
Differential loading
✅ Simple deployment infrastructure
✅ Proposal for a browser standard
WHATWG
Slide 13
Slide 13 text
@mgechev
Slide 14
Slide 14 text
@yourtwitter
Angular CLI
Introduced this feature in
v8.0.0
Slide 15
Slide 15 text
@yourtwitter
@mgechev
● Set the target in tsconfig.json
to es2015
● Set the minimum supported browsers
in browserlist
Differential loading with Angular CLI version 8
twitter.com/mgechev
Step 1: Open
https://example.com/
Step 2: Determine JavaScript
which is likely to be required
Step 3: Download the
chunks
Step 4: Store chunks
in browser cache
Pre-fetching
Slide 29
Slide 29 text
twitter.com/mgechev
Slide 30
Slide 30 text
@yourtwitter
@mgechev
● Prefetch visible links
● Predictive prefetching
● Prefetch on mouse over
Prefetching strategies
Slide 31
Slide 31 text
@yourtwitter
@mgechev
● Prefetch visible links
● Predictive prefetching
● Prefetch on mouse over
Prefetching strategies