Skip to content

Conversation

@Tyson910
Copy link
Contributor

@Tyson910 Tyson910 commented Dec 21, 2024

What did you build?

Force the SuperFormDebug component into legacy mode

Resolve issues outlined here #306 & #426

Why did you add this?

Allows consumers to opt-in to runes on a project wide level by adding the following to their svelte.config.js. This will be the default behavior in Svelte 6 according to the Svelte docs

  compilerOptions: {
    runes: true,
  }

@vercel
Copy link

vercel bot commented Dec 21, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
superforms ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 21, 2024 4:47pm

@ciscoheat ciscoheat merged commit f29c972 into ciscoheat:main Jan 21, 2025
2 checks passed
@ciscoheat
Copy link
Owner

This is not compatible with Svelte 4 (see #554), so it has been rolled back in 2.23.1. Any ideas how to support both versions?

@Tyson910
Copy link
Contributor Author

This is not compatible with Svelte 4 (see #554), so it has been rolled back in 2.23.1. Any ideas how to support both versions?

import { VERSION } from 'svelte/compiler';	

{#if VERSION.startsWith('5')}
 <svelte:options runes={false} />
{/if}

Could add something resembling the above code for as long as Svelte 3/4 are supported

@ciscoheat
Copy link
Owner

The svelte:options element cannot be inside an if block, unfortunately.

@Tyson910
Copy link
Contributor Author

That's disappointing. Only other option I can think of would be a SuperDebugV5 component, but I don't know if maintaining 2 pretty much identical SuperDebug components is worth it

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