Live data from Hacker News

Svelte 4

svelte.dev

121–130 of 227 posts

Re: Svelte 4

#121
post #65
post #40

Earlier quoted context omitted.

But Svelte obviously doesn't play well with TypeScript, and is kind of its own language - you don't need a source for that. Good luck e.g. getting reactive declarations to play well with TS's type narrowing or null analysis.

you clearly don't know what you are talking about. reactive declarations do not change the type of the objects. it just that they can rerun when the dependencies change. sure for the convenience of the users you do not need to type `let vars...` for every new variable declared in the reactive statement, but no one forbid you to write it before hand, or let the language server/plugin do it for you. but Svelte indeed d…

I think the claim is that it breaks TS parsing, not that it changes the type.

Re: Svelte 4

#122
post #60

I'm curious what peoples' experiences have been using modern react vs svelte vs whatever else is popular these days. I used react a while back for a dashboard mockup and was pretty happy with it. Something about svelte being a superset of standard html/js/css that gets compiled bothers me. I realize that the same can be said about typescript/tsx but I feel like in can trust it more... Maybe it's a maturity thing? Or…

I'm a big fan of svelte vs. other frameworks. The closeness to vanilla js and natural coexistence with html+css makes it so smooth to work with and you feel productive right away. Recently built this with it: https://meoweler.com At least for small projects like this, it's perfect. For something larger/complex I'd be a bit more weary.

Great site. Some feedback:

* Main search (bottom center, not top right) taking over the screen when you click on desktop is terrible ux

* Should support some fuzzy search or misspelling tolerance, e.g. Cuzco for Cusco

* Valencia, Spain gives a 500 error

* No keyboard bindings when searching to navigate up/down between the matching results (e.g. type in 'Valencia' and I expect I can use the down key to choose which of the three results)

Re: Svelte 4

#123
post #51

Earlier quoted context omitted.

I'm used to Svelte, and I remember last year when I tried to install a basic NextJS starter template (create-nextjs-app) I had to wait a minute or so for all the npm dependencies to install. I then checked my project folder and it was 600MB....mindblowingly bloated.

yea but this more like install react more than nextjs, nextjs do to much magic to be comparable 600 mb is insane anyway but is important to be clear then we are comparing different things

Creating a skeleton SvelteKit app was around 150mb.

Re: Svelte 4

#124
Svelte rocks!!!

I'd recommend it to anyone who is focused on actually just shipping UI and making progress (not bike shedding or wasting time, you know who I'm talking about lol).

It is a nice paradigm that lets devs focus on just writing HTML, CSS, and JS with a little bit of teeny tiny magic (it is actually easy to understand). That's it.

Re: Svelte 4

#125
post #16

> The number of dependencies in Svelte has been greatly reduced from 61 down to 16 Adore this. Would love to see more JS frameworks reduce their dependency trees.

Should just bundle the npm module to a single file with esbuild before publishing it.

Re: Svelte 4

#126

Time for a very naive question. As somebody looking for a more effcient (less re-rendering) and nicer DX (template based, stuff like exit animations) alternative to React, what actually makes Svelte measurably better than Vue? On first (and very naive) look the two seem pretty similar, with the biggest difference being that Vue seems to have the much bigger ecosystem and more mature tooling (I keep hearing about Svel…

Vue 3 is kind of dead. Almost no features in the last year. Look at the GitHub repo, little activity, mostly maintenance stuff.

I suspect author (Evan) lost interest, given the Vue 2/3 situation (similar to Python 2/3) and the lost battle against React.

Re: Svelte 4

#127
post #66

Earlier quoted context omitted.

> What binds us to a virtual DOM? The virtual DOM was created to solve browser performance issues with the actual DOM. This may not be relevant anymore, but that's why it was made.

The VDOM was never about performance problems with the actual dom. It was always slower as you still have to mutate the actual DOM. The "VDOM if faster" was always FUD. The VDOM was invited to prevent bugs by removing the difficult of managing fine grade DOM mutations. Technically you are doing more work with a VDOM and diffing, than carefully mutating the DOM, it's slower. Of course if you just threw away the whole…

It was not FUD. It’s not faster than carefully mutating the DOM, but back then, almost no one was “carefully mutating the DOM” all the time. It was a shit-show of ad hoc re-rendering strategies that often re-rendered excessively because no one has time to do it carefully for every case. For most common use cases, VDOM had great performance with little cognitive overhead.

Re: Svelte 4

#128

I've used Svelte 3 and I like it, but honestly this is the problem I have with most JS projects. Svelte 3 had 3000+ experimental features and hacky stuff, why go into 4 when 3 itself has not mature yet?! Software support is basically the thousands of low-paid js dev jobs that companies hire to update their stack every 6 months?

I hear you, but you might be projecting a bit. FTA: > "Svelte 3 was released more than four years ago! In JavaScript-framework-time, that's eons. Svelte’s freshness has persisted throughout, but Node.js and browser APIs have evolved during that time and today we’re updating Svelte to take advantage of some of these improvements. Svelte 4 is mainly a maintenance release, bumping minimum version requirements and tighte…

Maybe they shouldn't call it Svelte 4 then. Major version in semver are usually breaking.

Re: Svelte 4

#129

I've used Svelte 3 and I like it, but honestly this is the problem I have with most JS projects. Svelte 3 had 3000+ experimental features and hacky stuff, why go into 4 when 3 itself has not mature yet?! Software support is basically the thousands of low-paid js dev jobs that companies hire to update their stack every 6 months?

Did you read the article? Svelte 4 is mostly a maintenance release. It is largely backwards compatible with Svelte 3 code.

"largely"

Re: Svelte 4

#130
post #9

I've used Svelte 3 and I like it, but honestly this is the problem I have with most JS projects. Svelte 3 had 3000+ experimental features and hacky stuff, why go into 4 when 3 itself has not mature yet?! Software support is basically the thousands of low-paid js dev jobs that companies hire to update their stack every 6 months?

read TFA: > "Svelte 3 was released more than four years ago... Svelte 4 is mainly a maintenance release, bumping minimum version requirements and tightening up the design in specific areas." Major Changes breaking: Minimum supported Node version is now Node 16 (#8566) breaking: Minimum supported webpack version is now webpack 5 (#8515) breaking: Bundlers must specify the browser condition when building a frontend bun…

This is why the JS ecosystem sucks...
Post reply on HN