chore: upgrade to svelte v5 with fix demo app#221
Merged
Conversation
Tony133
marked this pull request as ready for review
July 12, 2026 09:42
Tony133
force-pushed
the
chore/upgrade-svelte-v5
branch
from
July 12, 2026 09:51
86a6eba to
a67a581
Compare
is2ei
approved these changes
Jul 13, 2026
This was referenced Jul 13, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposal:
svelte@^5.0.0, and fixes everything that broke.Changes
Svelte 5 dropped
svelte/register(its CJS require-hook) and the compiler now only emits ESM, so.sveltefiles could no longer berequire().Added
example/svelte-loader.mjs, a Node module customization hook (module.register()) that compiles.sveltefiles to server-side JS on the fly, keeping their original file URLs so relative imports between components keep resolving normally without a bundler.example/worker.jsalso strips Svelte 5's hydration marker comments from SSR output (<!--[-->,<!--]-->), since Hotwire only ever swaps static HTML via Turbo and never hydrates client-side.Demo app fixes (unrelated to Svelte, surfaced by testing it):
/wsnow registered inside a nested plugin, fixing a boot-order race with@fastify/websocketthat left the websocket connection stuck pending forever.superheroes@4's API change (randomSuperhero()instead of.random()).POST /messagenow redirects instead of returning JSON, satisfying Turbo Drive's requirement for itstarget="_top"form.GET /now reuses an existing session cookie instead of always minting a new identity, fixing an inability to delete a message you had just created.POST /message/:id/deletenow responds with a turbo-stream on success, consistent with its own error paths and/toast/ack.Note: