Skip to content

Modernize frontend/build stack for Svelte 5#171

Merged
rendall merged 11 commits intomasterfrom
frontend-modernization
Mar 26, 2026
Merged

Modernize frontend/build stack for Svelte 5#171
rendall merged 11 commits intomasterfrom
frontend-modernization

Conversation

@rendall
Copy link
Copy Markdown
Owner

@rendall rendall commented Mar 26, 2026

Summary

This PR completes the Priority 4 frontend/build modernization lane.

It upgrades the frontend stack to the current Svelte 5-compatible toolchain and carries through the compatibility work needed to keep build, tests, local runtime, and embed mounting working.

Key changes:

  • upgrade the frontend stack to svelte@^5.55.0, @sveltejs/vite-plugin-svelte@^4.0.0, and svelte-preprocess@^6.0.3
  • align the Vite/Svelte preprocess path to tsconfig.frontend.json
  • align frontend Jest handling for the post-upgrade ESM dependency edge (esm-env)
  • enable verbatimModuleSyntax and move frontend module resolution to bundler
  • fix the Svelte 5 invalid non-void self-closing tags surfaced by the build
  • convert StateValue imports to type-only imports to remove build noise
  • migrate src/simple-comment.ts from new SimpleComment(...) to mount(SimpleComment, ...)
  • archive the completed Priority 4 dependency/frontend documentation artifacts

Validation

Completed on the frontend-modernization branch during the upgrade loop:

  • yarn lint
  • yarn run prettier --list-different .
  • yarn typecheck
  • yarn test:frontend
  • yarn run build:frontend
  • yarn run ci:local

Local runtime verification:

  • simple-comment mounts again in local development after the Svelte 5 mount(...) change
  • once MongoDB/backend runtime was started, the app ran successfully end-to-end

Notes

A later ci:local rerun after local Netlify dev/runtime activity picked up generated .netlify/functions-serve/* artifacts during linting. That is documented in the archived validation notes as generated-artifact/environment noise rather than a frontend/build regression from this PR.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Modernizes the repo’s frontend/build toolchain to a Svelte 5–compatible stack while preserving existing embed/runtime behavior and keeping lint/test/build workflows working.

Changes:

  • Upgrades Svelte/Vite/Svelte-preprocess/ts-jest dependencies and lockfile to the Svelte 5 ecosystem.
  • Aligns frontend build + test configs to the updated TS/ESM model (tsconfig.frontend.json, Vite preprocess, Jest ESM edge cases).
  • Applies required source compatibility fixes (Svelte 5 mount(...), type-only imports, and non-void self-closing tag fixes).

Reviewed changes

Copilot reviewed 17 out of 18 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
yarn.lock Updates resolved dependency graph for the upgraded Svelte 5-compatible toolchain.
package.json Bumps core frontend/build dependencies (Svelte 5, Vite plugin, preprocess, ts-jest, etc.).
vite.config.ts Pins Svelte preprocess TypeScript settings to tsconfig.frontend.json.
tsconfig.frontend.json Enables verbatimModuleSyntax and switches module resolution to bundler.
jest.frontend.config.ts Adjusts Jest transforms for ESM deps (esm-env) and treats .ts as ESM.
eslint.config.mjs Tweaks unused-vars ignore pattern in Svelte files to avoid noise around state.
src/simple-comment.ts Migrates embed entrypoint from new Component(...) to mount(Component, ...).
src/simple-comment-icebreakers.ts Adds missing TypeScript types for async callback parameters.
src/components/low-level/SkeletonText.svelte Replaces invalid non-void self-closing tags with explicit closing tags.
src/components/Login.svelte Converts StateValue import to type-only.
src/components/DiscussionDisplay.svelte Fixes invalid self-closing non-void <div />.
src/components/CommentInput.svelte Converts StateValue import to type-only; fixes invalid self-closing <textarea />.
src/components/CommentEdit.svelte Converts StateValue import to type-only; fixes invalid self-closing <textarea />.
src/components/CommentDisplay.svelte Fixes invalid self-closing non-void <div /> placeholders.
docs/archive/Priority4FrontendBuildModernizationPlan.md Archives the Priority 4 frontend/build modernization plan artifact.
docs/archive/Priority4FrontendBuildModernizationChecklist01Validation.md Archives validation evidence/notes for the lane completion.
docs/archive/Priority4FrontendBuildModernizationChecklist01.md Archives the checklist artifact for the completed lane.
docs/archive/Priority4DependencyModernizationPlan.md Marks the broader Priority 4 dependency modernization plan as archived.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +36 to +39
preprocess: [
sveltePreprocess({
typescript: { tsconfigFile: "tsconfig.frontend.json" },
}),
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

svelte-preprocess v6 still supports this call shape, but its default export is deprecated. To avoid deprecation warnings and reduce risk of a future breaking change, switch to the named export (import { sveltePreprocess } from "svelte-preprocess") and call that here.

Copilot uses AI. Check for mistakes.
@rendall rendall enabled auto-merge (squash) March 26, 2026 20:48
@rendall rendall merged commit 08c22c8 into master Mar 26, 2026
10 checks passed
@rendall rendall deleted the frontend-modernization branch March 26, 2026 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants