~/talk

Demystifying TypeScript Decorators

Talkat NodePDX 2016 · 2016-06-19..06-21· [typescript, javascript]
links:none on file
slides:none on file

Shows how TypeScript 1.5 implements the ES2016 decorator proposal by transpiling decorators to plain ES5/ES6 using Object.defineProperty and Object.getOwnPropertyDescriptor, so browsers need no native support. Builds real decorators—log, perf and memoize—in Visual Studio Code, wraps original methods via descriptor.value, measures a slow call at ~1001ms and a cached second call at ~0ms, and composes class/property/method decorators successfully.

AI-written summary · about

  1. 0:00Introduction and welcome
  2. 0:26What are TypeScript decorators
  3. 3:16Browser support and transpilation
  4. 9:17Setting up the demo project
  5. 12:49Adding logging manually
  6. 14:38Creating the log decorator
  7. 23:07Decorators at class and property level
  8. 24:59Performance measurement decorator
  9. 26:01Memoization decorator
  10. 27:26Real-world decorator libraries
  11. 30:15Caution and future outlook
~/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.