Live data from Hacker News

Svelte 4

svelte.dev

201–210 of 227 posts

Re: Svelte 4

#201
post #87

Earlier quoted context omitted.

JS frameworks are like coffee, some people like them milky and full of sugar, some people like them like them lean and black, some are obsessed with making the "worlds best coffee" at home every morning, and some drink whatever brown water comes out of a vending machine. We all like our coffee different, just as we all have favourite features and designs of frameworks. There is no correct, or best, framework, only pe…

Thank you ChatGPT

I was curious how ChatGPT would actually compare these frameworks to each other in coffee metaphors, so here you go:

- Vue is like a latte. It's smooth, easy to drink, and has a nice balance of sweetness and bitterness. It's also very popular and widely available. Vue is a progressive, incrementally-adoptable JavaScript framework for building UI on the web. It has a good and intuitive documentation, a large community, and a simple syntax. Vue is also performant and fast, and supports component-based development.

- React is like an espresso. It's strong, concentrated, and gives you a lot of energy. It's also the most searched and used framework among the four. React is a JavaScript library for building user interfaces. It has a large community, a lot of resources, and a high performance. React also uses JSX, which is a syntax extension that allows you to write HTML in JavaScript.

- Angular is like a cappuccino. It's rich, creamy, and has a lot of foam on top. It's also very complex and requires a lot of skills to make and enjoy. Angular is a development platform for building mobile and desktop web applications using TypeScript/JavaScript and other languages. It has a fast server performance, an MVC architecture implementation, and a good documentation. Angular also has a steep learning curve and is very complex.

- Svelte is like a cold brew. It's refreshing, smooth, and has no bitterness. It's also relatively new and innovative in the coffee world. Svelte is a new way to build web applications. It's a compiler that takes your declarative components and converts them into efficient JavaScript that surgically updates the DOM. It has no virtual DOM, no frameworks on top of frameworks, and no framework at runtime. Svelte is also truly reactive, easy to learn and use, and supports component-based development.

Re: Svelte 4

#202

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.

I'm not sure what you mean. Vue 3 is very healthy and alive, and so is Evan.

Re: Svelte 4

#203
post #40

Earlier quoted context omitted.

> I keep hearing about Svelte's flavor of JS basically being its own language now and it not playing all that well with Typescript it's a weird habit on HN to refer to random rumours that have discouraged you from trying something, and then explicitly not link to even the source of the random thing you're thinking of. I would guess you're misremembering something about the *developers of Svelte* saying they didn't th…

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.

I couldn't disagree more. Compared to the mess of hooks in React, Svelte is closer to JavaScript in the script portion and closer to normal html in the markup portion. I use vite and TypeScript with each project and never once had a typing issue. Ive built several production apps and consider it far better for my brain than other libraries I tried, and I've been using React since before Redux was mainstream. Svelte is my go to now.

Re: Svelte 4

#204
post #184
post #89

Earlier quoted context omitted.

Could be the plugin was broken somehow. Happen all the time for me. Even now the syntax highlighting and code formatting feature would break if I write the code the wrong way. from my understanding the plugin does some clever tricks like insert some dummy code or create some dummy files to be consumed by the typescript language server. so it is not guaranteed to be correct 100% of the time.

I mean, that sounds like a data point of two now to me - you're also saying that Typescript and Svelte don't play that nice together if the plug-in breaks "all the time" and you need to be careful how you write code just to get correct syntax highlighting and code formatting, no?

Syntax highlighting and code formatting sometime break because Svelte file is single file component format, which mean it has script, markup and style in a single file. It's rather complex to parse it right, especially when you use regexes to do the job like in VS Code.

It's just the problem with the VS Code Svelte extension, not the framework itself nor because of Typescript. Also for my case, it happens because I prefer to not use semicolons in my code, not because it is typescript.

Re: Svelte 4

#205

Super happy Svelte user. Have recently published an iOS + Android app using SvelteKit and blogged about the process for those interested: https://khromov.se/how-i-published-a-gratitude-journaling-ap... I tested the beta version of Svelte 4 on my app and it worked without requiring any changes other than running the migration script. Excellent work from the team!

Happy user of your app. Works great. Thanks for documenting all the process. It’s really insightful

Re: Svelte 4

#206
post #204
post #184

Earlier quoted context omitted.

I mean, that sounds like a data point of two now to me - you're also saying that Typescript and Svelte don't play that nice together if the plug-in breaks "all the time" and you need to be careful how you write code just to get correct syntax highlighting and code formatting, no?

Syntax highlighting and code formatting sometime break because Svelte file is single file component format, which mean it has script, markup and style in a single file. It's rather complex to parse it right, especially when you use regexes to do the job like in VS Code. It's just the problem with the VS Code Svelte extension, not the framework itself nor because of Typescript. Also for my case, it happens because I p…

Maybe, but Vue also has SFCs, and I've never once had issues with syntax highlighting or code formatting there.

Re: Svelte 4

#208

I've heard of Svelte but am not sure exactly what it does. So this time I went to their homepage and it doesn't provide any concise summary of what it is. If I had to guess, I'd say it packages Javascript up into an application that runs locally, but... ¯\_(ツ)_/¯

It's just a frontend framework for building fast, interactive frontends. If you're interested in seeing what all the fuss is about and have 5-10 minutes to spare, you could start https://svelte.dev/tutorial/basics and get a pretty good sense of it in less than 10 minutes

Thanks! The "what is Svelte" part really should be on the homepage.

Re: Svelte 4

#209
post #4

> Svelte 4 reduces the Svelte package size by nearly 75% (10.6 MB down to 2.8 MB), which means less waiting on npm install. This improvement will be especially noticeable for users who are loading our interactive learning experience on learn.svelte.dev for the first time, users of the Svelte REPL, and users with limited connectivity. The majority of the remaining package size is eslint support, which necessitates dis…

At this rate Svelte 5 is going to have to be renamed Anorexic!

Re: Svelte 4

#210
post #13

Could someone give a one or two sentence explanation of why I would want to use Svelte over something like React? I have heard it is "better", but have never understood why.

JS frameworks are like coffee, some people like them milky and full of sugar, some people like them like them lean and black, some are obsessed with making the "worlds best coffee" at home every morning, and some drink whatever brown water comes out of a vending machine. We all like our coffee different, just as we all have favourite features and designs of frameworks. There is no correct, or best, framework, only pe…

Netscapé was the original distributor of industrial strength Java.
Post reply on HN