~/talk

The Superpower of ASTs: How We Saved 16% on Our Bundle Size

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

A custom Babel plugin walks the codebase AST, finds nested constant objects of strings, inlines just-used values, drops the imports and removes whole files, yielding a measured 16% bundle size reduction — 4250 imports removed and about 14 MB reduced in production builds, outperforming Webpack tree-shaking. Exact integration tests run transformed code to assert runtime behavior, and aggressive assertion checks (buildFrameError style) guard assumptions to catch edge cases during build time.

AI-written summary · about

  1. 0:00Bundle size reduction intro
  2. 3:56Abstract Syntax Trees
  3. 7:05Babel with ASTs
  4. 8:29Challenges of working with ASTs
  5. 9:34Testing AST tools
  6. 11:40Guarding AST assumptions
  7. 13:46AST lifecycle best practices
  8. 14:51Key takeaways
~/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.