Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Svelte 5 Migration and Related Issues #1668

Open
vvnsrzn opened this issue Jan 27, 2025 · 0 comments
Open

Svelte 5 Migration and Related Issues #1668

vvnsrzn opened this issue Jan 27, 2025 · 0 comments

Comments

@vvnsrzn
Copy link

vvnsrzn commented Jan 27, 2025

Description

This issue outlines the process of migrating to Svelte 5.

Steps Taken

npx sv migrate svelte-5  

Migration Errors

AssistantSettings.svelte

<p> cannot be a child of <select>. <select> only allows these children: <option>, <optgroup>, <#text>, <hr>, <script>, <template>.
The browser will "repair" the HTML (by moving, removing, or inserting elements), which breaks Svelte's assumptions about the structure of your components.

Reference: Svelte Error Documentation - Node Invalid Placement

Suggestion:

	<select
		name="modelId"
		class="w-full rounded-lg border-2 border-gray-200 bg-gray-100 p-2"
		bind:value={modelId}
	>
		{#each models.filter((model) => !model.unlisted) as model}
			<option value={model.id}>{model.displayName}</option>
		{/each}
	</select>
	<p class="text-xs text-red-500">{getError("modelId", form)}</p>

I am available to work on this, feel free

Are there any integration/e2e tests I can run to check that the migration has gone smoothly?

ChatMessage.svelte

<svelte:fragment> must be the direct child of a component.

Reference: Svelte Error Documentation - Svelte Fragment Invalid Placement

Suggestion:

{#if nChildren > 0}
	{@const messageId = messages.find((m) => m.id === id)?.children?.[childrenToRender]}
	{#key messageId}
		<ChatMessage
			{loading}
			{messages}
			{isAuthor}
			{readOnly}
			{model}
			id={messageId}
			on:retry
			on:vote
			on:continue
		>
                // update the slot
                // remove the afterUpdate function

ToolEdit.svelte

<p> cannot be a child of <select>. <select> only allows these children: <option>, <optgroup>, <#text>, <hr>, <script>, <template>.
The browser will "repair" the HTML (by moving, removing, or inserting elements), which breaks Svelte's assumptions about the structure of your components.

Reference: Svelte Error Documentation - Node Invalid Placement

Suggestion: same as AssistantSettings.svelte


I am available to work on this topic :)

Are there any integration/e2e tests I can run to check that the migration has gone smoothly?

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

No branches or pull requests

1 participant