01/Scope
Compile templates, not components
8 → 92%
routes that can compile
- The problem
- Real pages fetch their data inside the component. A compiler that needs the whole component to be compilable would cover almost nothing.
- What I did
- Split every component in two: its setup code stays JavaScript and runs as normal, and only the JSX it returns is compiled. Calls that don't belong in a template are lifted out, keeping their original conditions.
- What happened
- On the 13-app corpus, coverage went from 8% of routes to 92% (optimistic), without asking anyone to rewrite a page.