~/talk

Bending Svelte using Preprocessors

Talkat Svelte Summit Fall 2021 · on Saturday, 2021-11-20· [javascript, frontend-architecture]
slides:none on file

Builds a Svelte preprocessor that extracts the children of a <SourceCode> inline component by reading node.children start/end offsets from the AST, slices the original file and injects a new source prop while escaping backticks, and preserves accurate sourcemaps. Uses MagicString for edits and map generation and svelte/compiler parse+walk to find nodes, relying on index math and appendLeft to insert attributes. A working demo and tests run in the provided playground.

AI-written summary · about

  1. 0:00Introduction and goals
  2. 2:08Project setup overview
  3. 4:32Planning with AST Explorer
  4. 6:58Technical approach design
  5. 12:00Initializing magic string
  6. 14:16AST parsing and traversal
  7. 18:18Implementing property injection
  8. 21:13Verification and finalization
~/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.