~/talk

Mastering React Component Library Optimization

Talkat ReactNext 2024 · on Monday, 2024-06-24· [react, frontend-architecture]
slides:none on file

A 40+ component React library shrinks from ~430KB to ~160KB by three concrete moves: switch to ES modules so the bundler can tree-shake, stop importing whole libraries (replace lodash imports with modular/lodash‑es calls), and publish per-component exports plus set sideEffects:false so unused files are dropped. Demo uses a repo with a consumer app, bundle visualizer and rebuilds the library live, and the approach reliably cuts bundle weight and CSS bleed in practice.

AI-written summary · about

  1. 0:00Introduction to React optimization
  2. 3:14Meet the speaker
  3. 4:01What is Tree Shaking
  4. 6:56Module bundling methods
  5. 10:33Project structure setup
  6. 12:40Initial bundle analysis
  7. 15:37Optimizing third-party dependencies
  8. 18:12Handling side effects
  9. 21:26Modular exports in library
  10. 24:29Final bundle size reduction
  11. 25:12Optimization checklist summary
~/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.