~/talk

Porting 100K lines of code to TypeScript

Talkat ForwardJS 2019 · on Thursday, 2019-01-24· [typescript, javascript]
links:none on file
slides:none on file

TinyMCE converts roughly 100k lines of JS to TypeScript using an AST-based conversion script that rewrites AMD modules to ES2015, pulls module bodies to the top level and emits export default any so the code compiles immediately. The team does the migration library-by-library (around a hundred libs), runs a test harness that runs TSC and npm test across all repos, and finishes the bulk in about a month. Result: caught real bugs (accidental global from commented ctor args, mismatched function-arg bug), gained automated refactoring and compile-time checks, and continues adding stricter flags and an API .d.ts surface via gradual typing.

AI-written summary · about

  1. 0:00Intro
  2. 4:14Motivation for the Conversion Project
  3. 5:08Why TypeScript?
  4. 7:50What is Gradual Typing?
  5. 8:49Conversion Process for each Library
  6. 10:27The Conversion Script
  7. 12:32Module Conversion Example
  8. 13:48Adding Types
  9. 16:35Example Bugs
  10. 22:39Convert Common Libraries First
  11. 24:15Gradually introduce Compiler Features
  12. 26:02Write a Script to Test Everything
  13. 28:30Developer Adjustments
  14. 30:28Continuing Work
~/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.