5 ms·
Yeah Svelte is the next thing. Backbone and Angular were great, but then came Vue and React. Vue and React were great, but then came Svelte. It's: - Simpler. Y
by nailer 7y ago
Yeah Svelte is the next thing. Backbone and Angular were great, but then came Vue and React. Vue and React were great, but then came Svelte. It's:
- Simpler. You change values with `=` not some method call.
- Faster, as the svelte compiler dynamically creates bindings at build time, vs a virtual DOM that has to dynamically track binding at run time
- Smaller, since Svelte's output doesn't include Svelte.
- s_y_n_t_a_x 7y agoSvelte is just a web framework, React is a software framework. Then there's the missing Typescript support... That's what happens when you create your own template syntax...again. I'll continue to use React so I can simply use Typescript for my components, not some random syntax. My styles are typed, my components are typed, my state is typed. Why would I ever go back?
- nailer 7y ago> That's what happens when you create your own template syntax...again. > I'll continue to use React React also created it's own syntax. Svelte's syntax looks more similar to preceding work than React's syntax did.
- s_y_n_t_a_x 7y agoJSX is syntactic sugar for function calls, but they are still just JS functions. You don't even have to use JSX. Templates are 5 steps backwards, Svelte overall is a leap backwards. Familiarity != simplicity. The only thing I'd use Svelte for is for simple websites, but oh no you can't because it requires JS...
- nailer 7y agoIt seems like you're splitting hairs. React had a new syntax. Svelte has a new syntax too, albeit a familiar one. You can call Svelte's syntax 'templates' if you want, but if you do, you should call JSX a 'template' syntax too. You seem to be saying templates are bad, which is fine, but a vdom and a compiler are both sufficiently different from, say, mustache templates and you seem to be favoring React for no technical reason. > Familiarity != simplicity. Sure. But you literally just said: > That's what happens when you create your own template syntax...again. Which seems to indicate you preferred familiarity. I'm not really sure what your argument is except pointing out that you prefer React. OK.
- s_y_n_t_a_x 7y agoJSX is not a template syntax. JSX is entirely optional, it's just syntactic sugar for function calls. JSX is simply a way to write JavaScript that looks like HTML. I know when I develop in React there's no magic. I know JSX are just functions, everything else in the code is as is.
- arxpoetica 7y ago> I know when I develop in React there's no magic. That's the biggest misstatement of the day. ️ We understand that you prefer React, but this is utter...
- s_y_n_t_a_x 7y agoI honestly don't care what you think, I explained my position. I'll continue to use the one framework that supports typing styles, components, and state. I'll continue to use the one framework that can bridge to every major desktop and mobile OS's native UI. I'll continue to use the one framework backed by both Facebook and Microsoft. I'll continue to use simple JS functions to build every part of my app. You can use Svelte, lol. Oh and don't use "we", you're one person.
- Can_Not 7y agoSvelte also doesn't support anything like rollbar/sentry. Some exceptions won't trigger the error handler in sapper, so your app just freezes.
- hajile 7y agohttps://stefankrause.net/js-frameworks-benchmark8/table.html https://stefankrause.net/js-frameworks-benchmark8/table.html Preact diffs against the real dom and is faster than Svelte in benchmarks while the library is only around 3.5kb (the minified code fits easily on a single screen). I'd note that authors from most of the frameworks represented have submitted their own optimizations, so performance isn't strictly based on the author's familiarity. InfernoJS is massively faster than Svelte or Preact (the benchmark author had to do some rather convoluted re-writes of vanillaJS over the years to keep ahead) and it uses a virtual DOM, but has a few optimizations that React doesn't have or can't use due to its external API. stdweb is the real thing to keep your eye on as it seems to show that WASM can be every fast. They still haven't gotten the vanilla benchmark up to the same speed. https://stefankrause.net/js-frameworks-benchmark8/table.html https://stefankrause.net/js-frameworks-benchmark8/table.html React's Fibers do some cool batching behind the scenes which means that large updates (especially constant ones like animations) don't have large negative impacts on user interaction. I doubt this would be possible without a vdom or something very similar to track all changes before deciding batches and update priority. Also, remember that vdoms have gotten a lot more efficient too. Newer ones can do things like re-use existing sub-trees or recycle vdom objects (they can also recycle the associated real DOM nodes too). Preventing all that extra garbage goes a huge way toward keeping those vdoms efficient. As to svelte in particular, you aren't "just using an equals". It actually compiles behind the scenes into a completely different set of reactive code. This gets at my biggest issue with such frameworks. Their abstractions aren't free. I have to learn their proprietary syntax and markup. I then have to learn how their compiler works behind the scenes when its time to debug the code I wrote. When I compile a React-style component into ES7 and run it in the brower, I have to deal with webpack for imports and I have to understand that JSX is really just JS functions. Otherwise, what I wrote is what I'll see. https://cdnjs.cloudflare.com/ajax/libs/preact/8.5.2/preact.min.js https://cdnjs.cloudflare.com/ajax/libs/preact/8.5.2/preact.m...
- arxpoetica 7y agoThis statement makes no sense: > I have to learn their proprietary syntax and markup. One of Svelte's raison d'etre is to "use the language" and err on less proprietary syntax / api / markup. Of the big three (not including Svelte), Svelte uses far less proprietary syntax, boilerplate, and API coverage. It errs on using as much native JS, CSS, and HTML as possible.