Preprocessing
Five more short essays, part 2 of 5.
reference/svelte-v2.16.1/src/preprocessis a dedicated pipeline stage: a
.sveltefile can be rewritten by one or more preprocessors -- TypeScript, SCSS, PostCSS, and the like -- before the real compiler ever sees it, each registered as a plugin a project configures in its own build tool.
ARKlight has nothing in this position.
Compilationalready covers the one-pass build; the preprocessing-specific point is narrower -- there's no earlier stage where a second language could be rewritten into Python, because the entry file is already plain Python and the component vocabulary is closed and versioned with the compiler itself, not pluggable per project.
Where a project-specific rewrite still happens
- arklight.config.py is read as plain Python before Site() is constructed, but that's ordinary Python control flow -- a project reading its own environment variables, say -- not a registered preprocessor stage.
- The seven registered experimental features (experimental APIs) are the only place ARKlight steps outside its default closed vocabulary, and none of them is a general preprocessing hook.
- --emit-arklight writes a binary IR snapshot a later build can start from, which is closer to a build cache than to preprocessing a second language.
The practical effect mirrors parsing and compilation: fewer moving parts to configure, at the cost of no project-level escape hatch for a second authoring language. See
gotchasfor what actually goes wrong at the one stage ARKlight does have -- including an unrecognized
# includedirective, covered in
sourcemaps and debugging.
Styling model
No component-scoped stylesheet pass, because no component boundary survives into the output.
OpenSourcemaps and debugging
Nothing transformed to map back to, so --debug prints a real Python traceback instead.
OpenCustom elements
No compile target for exporting a component as a reusable element outside its own build.
OpenBuild tooling
One CLI invocation instead of a bundler configuration, with sbom.txt standing in for build stats.
Open