~/talk

Minifying Private Fields in TypeScript

links:none on file
slides:none on file

A short webpack loader runs a TypeScript custom transformer (using the TypeScript compiler API) to rename private class fields by prefixing them with underscores so Closure-style minification is safe. This approach preserves type-aware correctness (avoiding Babel-only misrenaming of cross-instance or dynamic accesses) and was toggled in production to save about 31 KB raw and ~2% gzipped in the player bundle.

AI-written summary · about

  1. 0:00Introduction
  2. 3:54Private fields in TypeScript
  3. 7:11Google Closure Compiler issues
  4. 10:50Alternative solutions
  5. 15:53Babel and plugins
  6. 19:16Minifying private fields attempts
  7. 25:10Custom loader creation
  8. 27:39Implementation and deployment
  9. 28:01Optimization results
  10. 32:40Q&A
~/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.