~/talk

How writing just one import the wrong way slows down your website

Talkat CPH DevFest 2024 · 2024-08-26..08-30· [web-performance, javascript]
links:none on file
slides:none on file

A single import written the wrong way can pull an entire library into the client bundle: adding lodash via a default/ES-with-CommonJS mix increases the bundle by +24 KB in the measured build. The practical fixes shown are using per-method imports like import isString from "lodash/isString" or the ES build lodash-es, and tooling to verify impact — bundlephobia and the import-cost plugin for VS Code/IntelliJ — plus measuring before and after with your bundler (Webpack/Rollup).

AI-written summary · about

  1. 0:00Introduction
  2. 1:13Tree shaking basics
  3. 6:13Import syntax mistake
  4. 8:42Bundle size impact
  5. 10:49Proper tree shaking
  6. 13:37Verify tree shakeability
  7. 14:42Key takeaways and conclusion
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.