avatar
(dialupready) @dialupready.com

this is where i suggest introducing a JSX for Svelte and get run out of town Vue has it, it’s fun to get the advantages of both single-file components, scoped styles, and functions returning markup instead of functions operating on templates in the same place

aug 28, 2025, 11:50 pm • 1 0

Replies

avatar
Peter Reeves @peterreeves.bsky.social

I don't think it's a good idea for a team the size of Svelte's to maintain two different syntaxes, that's a lot of work. If LLMs are improving as fast as people say they are, LLMs will learn Svelte syntax faster than the Svelte team could build support for a second syntax 😂

aug 29, 2025, 2:54 am • 3 0 • view
avatar
(dialupready) @dialupready.com

JSX doesn’t even need to be maintained and you don’t have to make people do any imports, you just have vite do the replacement with the function that has the type Component, that’s a feature of vite legitimately straightforward

aug 29, 2025, 3:00 am • 0 0 • view
avatar
Peter Reeves @peterreeves.bsky.social

My understanding is Svelte does a lot of compile time analysis that simply couldn't be done with JSX. For example, I don't see how Svelte's new `await` feature could work. You'd be giving up so much of what Svelte offers for very very little benefit.

aug 29, 2025, 3:05 am • 3 0 • view
avatar
Peter Reeves @peterreeves.bsky.social

All their a11y warnings wouldn't work, you'd need to test the output rather than knowing beforehand that you've got invalid markup, etc.

aug 29, 2025, 3:06 am • 2 0 • view
avatar
Peter Reeves @peterreeves.bsky.social

Maybe you could get most of the way there with `createRawSnippet`, but I really don't see the point at all.

aug 29, 2025, 3:13 am • 0 0 • view
avatar
(dialupready) @dialupready.com

jsx aria linters exist, await is an expression so it works in JSX as is (or you convert Await into a component with the Then, Catch, Finally as children) and invalid markup doesn’t compile that’s not how JSX works For the record I don’t feel strongly about this I haven’t used Svelte much if at all

aug 29, 2025, 3:13 am • 0 0 • view
avatar
Peter Reeves @peterreeves.bsky.social

Fair point on linters, though that's then an extra dep you need to install rather than it being baked into the core framework.

aug 29, 2025, 3:42 am • 0 0 • view
avatar
Peter Reeves @peterreeves.bsky.social

You don't need the then/catch/finally stuff anymore in svelte. You can just do:

{await greeting()}

And things just work.

aug 29, 2025, 3:30 am • 1 0 • view
avatar
Peter Reeves @peterreeves.bsky.social

For example: svelte.dev/playground/f... Notice how all greetings run in parallel, even though each one has a 1sec sleep. You don't need to reach for `Promise.all`, the compiler just works it out for you.

aug 29, 2025, 3:30 am • 0 0 • view
avatar
(dialupready) @dialupready.com

the JS output there tells me Svelte probably can’t have a JSX format like Vue, the “functions operating on templates” idea seems baked in to the very core

aug 29, 2025, 3:37 am • 0 0 • view
avatar
rich harris @rich-harris.dev

'legitimately straightforward' is the sort of thing people say when they have literally no idea what would actually be involved

aug 29, 2025, 9:17 am • 1 0 • view
avatar
(dialupready) @dialupready.com

it’s straightforward in the sense that vue can offer it as a tangential feature and vite has JSX injection and rewriting as a base feature (it’s almost seamlessly except for having to specify props as a string array in a defineComponent call registering the JSX function component)

aug 29, 2025, 12:18 pm • 0 0 • view
avatar
(dialupready) @dialupready.com

but also yes you’re right

aug 29, 2025, 12:18 pm • 0 0 • view
avatar
(dialupready) @dialupready.com

in svelte 5 Components apparently already compile down to functions anyway, so JSX just seems like an easy drop-in

aug 29, 2025, 3:01 am • 0 0 • view
avatar
(dialupready) @dialupready.com

they might have to maintain a _jsx function since that is what editors and bundlers do by default, apart from that nothing else

aug 29, 2025, 3:05 am • 0 0 • view
avatar
(dialupready) @dialupready.com

just

aug 29, 2025, 3:08 am • 0 0 • view
avatar
Pier @pierbover.com

LLMs would probably confuse it with React code and the Svelte idioms wouldn't translate. If you just want something like React but faster/lighter/smarter better look into Preact or Solid.

aug 29, 2025, 3:38 am • 1 0 • view
avatar
rich harris @rich-harris.dev

Yep we've seen this with solid, qwik etc. non-starter

aug 29, 2025, 9:16 am • 0 0 • view
avatar
(dialupready) @dialupready.com

my ideal component is React with an SFC format because I like React’s API (not used to signals) but want to co-ocate scoped CSS I can get very close with Vue though, Composition API is very hooklike, and with

aug 29, 2025, 3:41 am • 0 0 • view
avatar
Pier @pierbover.com

You're using signals when using ref(). Vue uses alien-signals now internally. github.com/stackblitz/a...

aug 29, 2025, 4:07 am • 1 0 • view
avatar
(dialupready) @dialupready.com

yes but that’s internal and not my problem i just see the ref “hook”

aug 29, 2025, 4:26 am • 0 0 • view