Live data from Hacker News

Svelte is a language

gist.github.com

21–30 of 95 posts

Re: Svelte is a language

#22

Give a quick glance to Svelte. Help me understand, how this syntax {#if expression}...{:else if expression}...{/if} can be seriously invented in our... more civilized age?

How would you do it?

I don't know should I stick to mustaches (it can be dictated by other reasons), but if I should: {#if expr} {#elseif expr} {#endif}

Re: Svelte is a language

#23

Earlier quoted context omitted.

How would you do it?

I don't know should I stick to mustaches (it can be dictated by other reasons), but if I should: {#if expr} {#elseif expr} {#endif}

These sigils seem to exist to make it easier to balance the expressions. I personally find {#if} … {/if} much more intuitive. {:else} is an unfortunate compromise necessitated by the fact that elseif is ugly in most imperative languages.

Re: Svelte is a language

#24
post #15

The really exciting thing about svelte is getting rid of the virtual Dom. Having everything just be explicit JavaScript code that modifies the Dom manually makes for really readable code. If you have not tried it, got to the svelte tutorial and look at the output code. It's awesome.

> Having everything just be explicit JavaScript code

This is funny because it's exactly the reason I prefer react

Re: Svelte is a language

#25

Give a quick glance to Svelte. Help me understand, how this syntax {#if expression}...{:else if expression}...{/if} can be seriously invented in our... more civilized age?

How would you do it?

I much prefer keeping everything XML-ish:

https://www.solidjs.com/docs/latest/api#switchmatch

Re: Svelte is a language

#27
post #16
post #15

The really exciting thing about svelte is getting rid of the virtual Dom. Having everything just be explicit JavaScript code that modifies the Dom manually makes for really readable code. If you have not tried it, got to the svelte tutorial and look at the output code. It's awesome.

I haven't used Svelte beyond a couple toy tutorials, but, for me, the infrastructure adapters [1] are the most exciting thing. I love the idea of being able to build using Svelte and auto-magically deploy to something like Cloudflare Pages without completely giving up the potential to deploy somewhere else. 1. https://kit.svelte.dev/docs/adapters

Infrastructure adapters are becoming table stakes for frontend frameworks.

Re: Svelte is a language

#29
post #18
post #16

Earlier quoted context omitted.

I haven't used Svelte beyond a couple toy tutorials, but, for me, the infrastructure adapters [1] are the most exciting thing. I love the idea of being able to build using Svelte and auto-magically deploy to something like Cloudflare Pages without completely giving up the potential to deploy somewhere else. 1. https://kit.svelte.dev/docs/adapters

I've got mixed feelings about this and I'm sure I'm in the minority. Those adapters are usually supported by the commercial company that wants you to use them. But, for example, the static or node adapters often don't work great with the important parts of svelte kit like SSR, and feel like second class citizens. I love svelte but I'm having a hard time getting the same development ergonomics out of svelte kit. It's…

adapter-static is meant for generating fully static sites. It's fundamentally not aiming to and cannot support SSR in that context. However, SSR is fully supported in adapter-node, which is well maintained.

Re: Svelte is a language

#30
post #15

The really exciting thing about svelte is getting rid of the virtual Dom. Having everything just be explicit JavaScript code that modifies the Dom manually makes for really readable code. If you have not tried it, got to the svelte tutorial and look at the output code. It's awesome.

> Having everything just be explicit JavaScript code This is funny because it's exactly the reason I prefer react

Agreed, I want markup in my logic — not logic in my markup
Post reply on HN