Skip to content

refactor(sveltekit): generate only Svelte 5 code - #422

Merged
angeloashmore merged 1 commit into
mainfrom
claude/drop-svelte-4
Oct 14, 2026
Merged

angeloashmore merged 1 commit into
mainfrom
claude/drop-svelte-4

Conversation

@angeloashmore

@angeloashmore angeloashmore commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Resolves:

Description

Before this PR, SvelteKit setup and prismic slice create generated Svelte 4 code in Svelte 4 projects. That code could not work, because @prismicio/svelte v2, the version that setup installs, requires Svelte 5.

After this PR, the CLI always generates Svelte 5 code. Svelte 5 projects get the same files and instructions as before.

This is the first of a stack that adds SvelteKit 3 support (#418).

Checklist

  • If my changes require tests, I added them.
  • If my changes affect backward compatibility, it has been discussed.
  • If my changes require an update to the CONTRIBUTING.md guide, I updated it.

Preview

How to QA 1

Run prismic gen setup in a SvelteKit project with Svelte 5. Make sure that the generated files are the same as on main.

🤖 Generated with Claude Code

https://claude.ai/code/session_01L53y5wowGHwtT4aZJ3UsHY


Generated by Claude Code


Note

Medium Risk
Removes Svelte 4 codegen and version-based fallbacks, so Svelte 4 projects get Svelte 5 output that may not match their stack until they upgrade; aligns with @prismicio/svelte v2 requiring Svelte 5.

Overview
The SvelteKit adapter always emits Svelte 5 scaffolds and setup guidance, dropping runtime detection of the installed Svelte major and all Svelte 4 variants (export let, <slot />, version-specific slice/layout templates).

gen setup and slice creation now use a single code path: $props(), {@render children()}, and inlined head markup in rootLayoutTemplate. Manual PrismicPreview instructions are fixed to the Svelte 5 diff only. Tests shed Svelte 4 / missing-node_modules cases and useSvelteKit no longer fakes a pinned Svelte version in node_modules.

Reviewed by Cursor Bugbot for commit 3c5d817. Bugbot is set up for automated code reviews on this repo. Configure here.

Footnotes

  1. Please use these labels when submitting a review:
    ❓ #ask: Ask a question.
    💡 #idea: Suggest an idea.
    ⚠️ #issue: Strongly suggest a change.
    🎉 #nice: Share a compliment. ↩

@prismicio/svelte v2 requires Svelte 5, so the Svelte 4 code that
SvelteKit setup generated did not work. Setup, slice components, and
setup instructions now always use Svelte 5 syntax.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L53y5wowGHwtT4aZJ3UsHY
@angeloashmore
angeloashmore merged commit 6c12ba9 into main Oct 14, 2026
16 checks passed
@angeloashmore
angeloashmore deleted the claude/drop-svelte-4 branch October 14, 2026 19:28
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