Skip to content

Uncomfortable Svelte 5 DX using Inertia v2 + Svelte #2523

@kresnasatya

Description

@kresnasatya

@inertiajs/svelte Version

2.1.2

Backend stack (optional)

No response

Describe the problem

When I'm using the Svelte 5 syntax in Inertia v2, I get uncomfortable DX like this: $page.blablabla and $form.blablabla. This is different when compare it with Inertia v2 (Vue/ReactJS). The reason is in Inertia v2, the Svelte 4 also supported. I'm not sure how many (literally) large scaled project using Inertia v2 with Svelte 4 syntax but with Svelte 5 it much more simpler thanks to the Svelte's runes. E.g. If we re-write the implemetation of usePage, useForm using global state runes, the DX will be improved. So, I just call like this: page.blablabla and form.blablabla.

If we want to keep support for Svelte 4, then we must split the packages: The packages/svelte4 for Svelte 4 and the packages/svelte for Svelte 5. So, we can re-write components, utilities in the package with new Svelte 5 syntax without disturb the Svelte 4 itself.

Steps to reproduce

Nothing.

Metadata

Metadata

Assignees

Labels

svelteRelated to the svelte adapter

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions