[web.worker] compile standalone server templates #124

Merged
eleith merged 1 commits from feat/worker-template-preparation into main 2026-10-19 21:16:58 +00:00

Summary

Add a small worker-owned compileTemplate(source, filename) utility:

  • Compile Svelte for synchronous server rendering with injected component CSS.
  • Use esbuild, a worker production dependency, to include the matching Svelte runtime.
  • Return { code, warnings }; the generated Node ESM module exports render(props)
    returning plain { body, head } strings.
  • Keep the entry in memory with one virtual-module identifier definition.
  • Preserve source warnings and compilation errors.

Includes one small Svelte fixture, a native isolated-render test, diagnostic tests,
worker documentation and a patch changeset. Raw fixture inputs are excluded from
worker source coverage.

Scope

No background job registration, template registry, supported-authoring-subset
validation, caching, revision publication, startup coordination, web wiring,
renderer fallback/navigation/icon policy, or Open Graph/thumbnail changes.
Source is trusted site-owner code; this utility is not a security sandbox.

Verification

  • All 282 worker tests pass across 47 files.
  • The native artifact test rejects every non-builtin import except its own module,
    preventing workspace Svelte resolution from hiding a missing bundle dependency.
  • Compiler warnings and invalid-source filename diagnostics are tested.
  • ESLint, TypeScript production build, formatting and diff checks pass.
  • New compiler coverage is 100%; overall worker coverage is 97.63% statements/lines,
    89.84% branches and 99.03% functions.

Reviewed and explicitly approved by the owner before staging. Contains exactly
one commit / eight approved files. Private plans and unrelated archive edits are
not included. This follows merged #123 from clean main, not old draft #121.

## Summary Add a small worker-owned `compileTemplate(source, filename)` utility: - Compile Svelte for synchronous server rendering with injected component CSS. - Use esbuild, a worker production dependency, to include the matching Svelte runtime. - Return `{ code, warnings }`; the generated Node ESM module exports `render(props)` returning plain `{ body, head }` strings. - Keep the entry in memory with one virtual-module identifier definition. - Preserve source warnings and compilation errors. Includes one small Svelte fixture, a native isolated-render test, diagnostic tests, worker documentation and a patch changeset. Raw fixture inputs are excluded from worker source coverage. ## Scope No background job registration, template registry, supported-authoring-subset validation, caching, revision publication, startup coordination, web wiring, renderer fallback/navigation/icon policy, or Open Graph/thumbnail changes. Source is trusted site-owner code; this utility is not a security sandbox. ## Verification - All 282 worker tests pass across 47 files. - The native artifact test rejects every non-builtin import except its own module, preventing workspace Svelte resolution from hiding a missing bundle dependency. - Compiler warnings and invalid-source filename diagnostics are tested. - ESLint, TypeScript production build, formatting and diff checks pass. - New compiler coverage is 100%; overall worker coverage is 97.63% statements/lines, 89.84% branches and 99.03% functions. Reviewed and explicitly approved by the owner before staging. Contains exactly one commit / eight approved files. Private plans and unrelated archive edits are not included. This follows merged #123 from clean `main`, not old draft #121.
eleith-gitea-agent Bot added 1 commit 2026-10-19 21:12:37 +00:00
[web.worker] compile standalone server template modules
ci/woodpecker/pr/web-worker Pipeline was successful
ci/woodpecker/push/web-worker Pipeline was successful
7aea25854e
Reviewed and explicitly approved before staging. Keep esbuild as a worker production dependency, centralize the in-memory template identifier, and test native rendering without workspace dependency resolution. No job registration, publication, or web/image-pipeline changes.
eleith merged commit 7aea25854e into main 2026-10-19 21:16:58 +00:00
eleith deleted branch feat/worker-template-preparation 2026-10-19 21:16:58 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: eleith/luzzle#124