Earlier quoted context omitted.
Reminds me of Angular
Angular template syntax is correct HTML syntax. It's nothing like the examples abovd.
Svelte is a language
51–60 of 95 posts
Re: Svelte is a language
#52Earlier quoted context omitted.
Reminds me of Angular
Angular template syntax is correct HTML syntax. It's nothing like the examples abovd.
Haven't looked at angular since 2015 to be honest, but it still seems like they do weird html stuff to me, such as:
{{customer.name}} or Type something: {{customerInput.value}}
Re: Svelte is a language
#53Svelte is a major improvement on vuejs. It is a pleasure to work with. I can’t stand react / JSX. Highly recommend anyone who preferred vue over react to give svelte a try.
I disagree. But I am someone who deals with frontend tech sporadically as opposed to spending all/most of my time working on UI. I was excited about svelte, but have found that coming back to my svelte project after a month or two of not using it was arduous because of all the myriad language level things. There are just too many little svelte specific things to keep track of in head. In contrast coming back to a rea…
Familiarity wise Angular has been probably the easiest to jump into and maintain long term, but it is a pain to work with due to the amount of ceremony involved to do even the simplest of things.
Svelte codebases due to the very nature of Svelte are simpler and very straightforward to get into, there are some svelte specific things but they aren't too many of them and are simpler to reason about when compared to codebases built on hooks, and even worse are hooks in combination with junior Devs. It is very very easy to write bad react code and you see this way way too often. Most react code out in the wild is badly written, you don't see problems because the browsers and modern computers are performant enough to hide them away but you do notice as the codebase grows and you realize it too late that the very foundation was wrong.
I don't mind Vue and just see svelte as a nicer DSL over it.
Re: Svelte is a language
#54Give 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?
Re: Svelte is a language
#55The 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.
First we were excited for the virtual DOM which is good for batching updates, flexibility, efficiency, etc. But now the cool thing is to get rid of it?
Re: Svelte is a language
#56Earlier quoted context omitted.
Angular template syntax is correct HTML syntax. It's nothing like the examples abovd.
You're telling me on:click={toggle} is nothing like (click)="toggle()"?
you can on on:click={() => toggle()} in svelte which is more similar, but it isn't parsed and executed, it is a pointer to an anonymous function which is directly executed.
on:click={toggle()} in svelte would run the function immediately (probably not what you want) and return the result as the handler for the on:click
so quite different, really.
Re: Svelte is a language
#57The 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 don’t follow… in what sense is this JavaScript? Specifically, what is on:click? It doesn’t look like JavaScript, and it doesn’t look like the DOM. It looks like a new language which is specific to Svelte. Or what about this… is this JavaScript? $: doubled = count * 2; Or… {#if user.loggedIn} Log out {/if} Or… Click me I am willing to believe that all of that is ergonomic in some way, but it doesn’t appear to me at…
it's not. it's html. incrementCount is a pointer to a javascript function.
> Or what about this… is this JavaScript? > $: doubled = count * 2;
Yes. $: is a javascript label. We use it to indicate that a function should be reactive - if the count variable changes, the right hand will be rerun and double updated.
> Click me
html again. the |once is a modifier to click which detaches the handler after a single use. It's a directive in the html markup (still valid html) which the compiler picks up and converts into node.removeEventHandler.
Re: Svelte is a language
#58Earlier quoted context omitted.
Angular template syntax is correct HTML syntax. It's nothing like the examples abovd.
https://angular.io/guide/binding-overview Haven't looked at angular since 2015 to be honest, but it still seems like they do weird html stuff to me, such as: {{customer.name}} or Type something: {{customerInput.value}}
Re: Svelte is a language
#59Earlier quoted context omitted.
Angular template syntax is correct HTML syntax. It's nothing like the examples abovd.
You're telling me on:click={toggle} is nothing like (click)="toggle()"?
Re: Svelte is a language
#60I've converted my company website to svelte-kit from first Angular, then Vue.
But for SPA it's bad. If you use oidc auth. There's only Auth.JS and it's a confidential client, for Svelte Kit.
If you're not using svelte-kit you can use vite to create a Svelte SPA. There you can use your PCKE client as usual and burden the load on the client.
I have yet to experiment with how well it works with a graphql client. Apollo has its own cache but I'm not sure there is a svelte version of it. There is for Vue. Does it even need one? The default is for React. Is Apollo even needed? Questions over questions.
Why Svelte? Performance. Performance matters, a lot.
Svelte being a "language". First time using a template system? I have to wonder.