top | item 23117991

(no title)

aardvark1 | 5 years ago

Superior in what way? Do you really trust that SvelteJS is going to be a better product in 5 years over something like React that Facebook invests millions of dollars every year?

discuss

order

dwoot|5 years ago

I don't think anyone is going to sell you on something else, you seem very ingrained in the React ecosystem. More dollars doesn't equate to "better product" down the road. Angular came and is still a part of Google. Would anyone starting a new project use it over something like VueJS or React today? Probably not. Right? So that sort of tosses your argument out the window.

I don't do JavaScript professionally anymore, but I've worked with jQuery, BackboneJS, lots of AngularJS, some Elm, some VueJS, and some React, but being the curious person that I am, in search of greener pastures, I checked out Svelte, by first watching Rich Harris' video https://www.youtube.com/watch?v=AdNJ3fydeao on "Thinking Reactivity", then seeing the benchmarks: https://twitter.com/Rich_Harris/status/1200807516529147904, and watching Rich and Dan Abramov spar a bit over their challenges. From an outsider with no skin in the JS game, it is clear that Svelte seems far superior now and into the future...

1. it is a compiler (it's like comparing C/C++ to Python) 2. the joy of out-of-the-box animations that use the GPU in CSS (reminds me of the joy of using jQuery for the first time w/ it's OOB animations) 3. you can drop in any other JS lib (doesn't have to be in a particular JS framework ecosystem) and have it inter-op! This is huge! It's because it's literally like writing vanilla JS 4. no need to learn some new syntax like JSX (not a huge fan)

Just take a peek. If you don't like Svelte, so be it, but at least you know what it is that you don't like rather than turning a blind eye because you don't want to be convinced -- that's tunnel vision.

I was trying to decide between React/Vue/Svelte for a project I started recently, and after having attempted to build to-do apps in each, I landed on Svelte.

aardvark1|5 years ago

I am not at all a React fanboy, I'm just using is a metaphor for Vue/Angular/React. You're selling Angular short it's still a great framework that is very popular, even better than React for some use cases as it has more out of the box and is more opinionated

thinkloop|5 years ago

A hello world react app with everything you would typically need (redux, router, etc.) starts at 100K+. Svelte is a couple K.

A react app has massive abstraction to render on every frame, Svelte compiles out the framework to render instant straight vanilla js (wins all perf tests).

Pre-compiling allows for beautiful syntax and more flexible app structure, since you aren't limited to the runtime.

SSR and code-splitting are significantly easier and more straightforward.

React is designed for a billion-user site and it shows.

There really is zero cost to pre-compiling except mind-share, and only benefits. Of course an F100 company has many concerns above tech awesomeness, so no judgement on your selection criteria. But I assure you this movement is coming, react/vue/angular will adapt/change and/or people will move to Svelte-like solutions.

You can already see it happening in the article facebook released today [1]:

"By using rems, we can respect user-specified defaults and are able to provide controls for customizing font size without requiring changes to the stylesheet. Designs, however, are usually created using CSS pixel values. Manually converting to rems adds engineering overhead and the potential for bugs, so we have our build tool do this conversion for us."

[1] https://news.ycombinator.com/item?id=23116300

nicoburns|5 years ago

I'm not convinced that the 100kb is what's causing the perf problems though. It's not that hard to make a React app that loads almost instantly. There are lots of huge, slow react apps, but that's due to poor engineering choices not the framework.

lhorie|5 years ago

That may be the case for React, but the vast majority of your stack (e.g. react-router, react-redux, styled-components, etc) certainly don't have millions of dollars being poured into them. The base frameworks are very very similar in terms of what types of features they provide.

aardvark1|5 years ago

The author of redux works at Facebook