~/talk

Building a template engine from Scratch

Talkat JSWORLD Conference 2022 Online · 2022-02-09..02-23· [javascript]
links:none on file
slides:none on file

Builds a small compiled template engine that works: templates parse into tokens, produce JavaScript code, and become reusable render functions created with vm.runInContext. Language supports variable injections, if/elif/else branches, loops, and scoped globals; example site is a narf-powered to‑do app. The project claims zero external npm packages, tokenization via regex split, code-builder markers for insertion, and the demo generates correct HTML and multiple renders from one compiled template.

AI-written summary · about

  1. 0:00Introduction
  2. 2:38What is a template engine
  3. 4:22Template language spec
  4. 7:10Tokenizing the language
  5. 8:57Compiling to JavaScript
  6. 12:44Key components
  7. 17:57Strings to functions
  8. 19:22Live demo
  9. 21:53Summary
~/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.