~/talk

styled-ppx: How to mimic a JavaScript feature and over-engineering CSS

Talkat GambiConf EU 2022 · 2022-09-03..09-10· [frontend-architecture, javascript]
name:Dave
links:none on file
slides:none on file

Project implements styled-ppx: a ReScript/Reason OCaml PPX that parses embedded CSS, generates type-safe ReScript bindings, and emits hashed classnames at compile time. It includes a custom Menhir parser for modern CSS and a parser for MDN’s Backus-style grammar to validate ~200 CSS properties and values. Interpolation is supported but restricted to values (e.g. lengths, colors) so the compiler infers types and produces errors for mismatches. Result is working type-checked CSS in ReScript and enough traction to turn the repo into a job opportunity.

AI-written summary · about

  1. 0:00Introduction and speaker intro
  2. 1:33CSS in JS origins and React impact
  3. 7:17Why CSS in JS became popular
  4. 9:27Introduction to OCaml and ReasonML
  5. 12:34ReasonML and ReScript evolution
  6. 14:02Motivation for styled-ppx project
  7. 16:49Understanding PPX in OCaml
  8. 20:25Designing styled-ppx syntax
  9. 22:53CSS parsing and AST transformation
  10. 24:44Adding type safety to CSS properties
  11. 26:54Implementing CSS property validation
  12. 29:03Solving interpolation with type safety
  13. 31:10Project lessons and conclusions
  14. 32:56PPX as a compiler learning path
  15. 33:40Q&A and closing
~/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.