ARKlight logoARKlight
Getting startedTutorialReferenceExamplesWhyChangelog

Compiler notes

Styling model
Preprocessing
Sourcemaps and debugging
Custom elements
Build tooling

Preprocessing

Five more short essays, part 2 of 5.

reference/svelte-v2.16.1/src/preprocess

is a dedicated pipeline stage: a

.svelte

file 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.

Compilation

already 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

gotchas

for what actually goes wrong at the one stage ARKlight does have -- including an unrecognized

# include

directive, covered in

sourcemaps and debugging

.

Styling model

No component-scoped stylesheet pass, because no component boundary survives into the output.

Open

Sourcemaps and debugging

Nothing transformed to map back to, so --debug prints a real Python traceback instead.

Open

Custom elements

No compile target for exporting a component as a reusable element outside its own build.

Open

Build tooling

One CLI invocation instead of a bundler configuration, with sbom.txt standing in for build stats.

Open
LicenseChangelogGitHubPyPI

ARKlight is GPLv3 with attribution terms; sites you build are yours. Your browser is still running JavaScript. We just made Python responsible for getting it there.