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.
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 main2026-10-19 21:16:58 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Add a small worker-owned
compileTemplate(source, filename)utility:{ code, warnings }; the generated Node ESM module exportsrender(props)returning plain
{ body, head }strings.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
preventing workspace Svelte resolution from hiding a missing bundle dependency.
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.