Skip to content

v0.35.2

Choose a tag to compare

@metonym metonym released this 10 Jul 00:18
· 175 commits to main since this release
v0.35.2
08f70a1

Features

  • bundle a pruned svelte parser instead of the full svelte/compiler import (1c417db, #372)
  • lazy-load the parser stack so cached CLI runs skip it entirely (649d5d2, #375)
  • skip writing output files whose content is unchanged (64de536, #374)
  • memoize buildComponentApiDocument() when json, markdown, and custom-elements run together (7c2338b, #376)
  • inline tinyglobby and zimmerframe to shrink the bundle (adb155b, #380)

Fixes

  • resolve TS type annotations for context values (446cc50, #379)
  • emit component type parameter signatures in Markdown docs (06e865c, #378)

Performance

0.35.2 is a performance-focused patch that speeds up warm runs and shrinks the published bundle.

The largest structural change is in the build: sveld no longer imports svelte/compiler, which unconditionally pulls in the analyze and transform phases plus aria-query and axobject-query. A shim in svelte-parse.ts calls the internal parser phase directly, verified byte-identical to the real parse() across every fixture. That drops most of the accessibility-linting dependency graph from the bundle.

Three more optimizations target repeated runs:

  • lazy parser stack — the CLI dynamically imports ComponentParser and svelte-parse only when parsing is needed; cache hits skip the entire parser module graph
  • unchanged-file skip — writers read existing output and skip the write when content is byte-identical, avoiding spurious mtime updates for file watchers
  • buildComponentApiDocument() memoization — when json, markdown, and custom-elements outputs are all enabled, the sorted document is built once per writeOutput() call

Two smaller wins round out the release: inlining tinyglobby and zimmerframe (each used for a single narrow purpose) removes four transitive packages from the bundle.

Parser and documentation fixes

  • context type annotations — context values declared with a TypeScript type annotation now resolve from the AST instead of falling back to any
  • Markdown generics — components with type parameters now emit their generic signature under the heading, so props referencing T (or other params) have a defined type in the table