10 ms·
React is now the de facto choice and much less painful than past de facto choices, is my take on why. It has a mature and healthy ecosystem, and its relatively
by jrajav 3y ago
React is now the de facto choice and much less painful than past de facto choices, is my take on why. It has a mature and healthy ecosystem, and its relatively small surface makes it easy to learn and predictable, while declarative GUI in general is low on footguns compared to ye ol two-way data binding.
Many of the competitors springing up define themselves in terms of React, either as an improvement or a foil. But if you're just trying to get things done, it's hard to go wrong with it - and in a practical sense, not a "nobody got fired" sense.
- simonsarris 3y agohaha, I basically feel this way about Svelte/Kit. It's not mature, but the surface is so small and learning curve so pleasant that it's our go to choice now for internal webapps. (We have no external webapps because my company, funny enough, builds a JavaScript framework!)
- steve_taylor 3y ago> not mature Svelte was first released in 2016 and has become bigger than its original creator, Rich Harris. It has quite a thriving ecosystem and a big community. The tooling around it is more mature than React's has ever been. > surface is so small I actually find the opposite to be true. React still has a relatively small API surface area. One-way data flow makes it easier to understand. However, a smaller surface means arguably less expressivity, so I think Svelte's bigger learning curve is worth it. You can learn about 90% of React in a weekend and be productive. You can learn about 20% of Svelte in a weekend and also be somewhat productive, but you need to learn about 60-70% more to use Svelte as it's intended, rather than as a React alternative.
- pcstl 3y agoHow is Svelte intended to be used that is so hard to learn?
- deleted 3y ago[deleted]
- v3ss0n 3y agoThis is wrong in so many levels. You need to learn useState,useEffects in react. You only need to learn how to put {varName} in svelte.
- fomine3 3y agouseState and useEffect are quite simple small elegant API. It does not mean it's very easy to use for newbie. Maybe like Lisp?
- pwdisswordfishc 3y agoOh sure, useState and useEffect are very simple. Your app built upon them, on the other hand…
- scotty79 3y agoYou don't need to learn useEffect until you need to plug arbitrary js libs and components into react. That's the intended use of useEffect. Using it for anything else is usually a bad idea.
- revskill 3y agoHow can you "fetch something when your state change ?". It's the main use case for useEffect.
- deleted 3y ago[deleted]
- scotty79 3y agoYou can just trigger fetch in the function that does the state change.
- shortcake27 3y agoAgreed, this is the correct approach. Overusing effects makes control flow difficult to understand and has many unintended consequences. The misuse of effects is so widespread the React team had to address it with Strict mode in React 18.
- solumunus 3y agoI think Svelte has a much smaller learning curve, personally. If you know Javascript there's hardly anything to learn.
- karaterobot 3y agoI'm not a web dev anymore, I stopped right around the time hooks became a thing in React, and while Svelte was an exciting technology no big players had adopted yet. In fact the last thing I did for my old job was a little make-work exploration to test whether Svelte was was ready for them to use in prime time. My conclusion was that it was remarkably slick and empowering, but was not ready yet due to the lack of ecosystem support. It's cool that Svelte and its community has continued to grow to the point where it is a legitimate contender. I'll be honest, I never liked React very much and would love to see it dethroned, even though I have almost no stake in that anymore!
- asguy 3y ago> lack of ecosystem support .. is the “Nobody Got Fired For Buying (IBM|Microsoft|Cisco)” for the 2020s
- dimmke 3y agoI’ve been working with Svelte very heavily since November of last year. It’s been a real journey with Svelte and SvelteKit over the last 7 months, seeing things change rapidly. I think one of the coolest things is that it has galvanized frameworks to become SPA framework agnostic. Like NextAuth.js -> Auth.js React Query -> Tanstack Query So at the very least, I think we are probably headed towards a plurality where it is practical to use Vue, React, Svelte or Solid though I do hope Svelte “wins” in the end. I have to say, I still don’t think it’s to the point where it can be foisted on a team of mediocre developers in some kind of enterprise setting. Some of the libraries that exist for SvelteKit that I consider super critical are very small and maintained by one or two people. I recently took on some freelance work for the first time in like 6 years, just to work on another large SK codebase and saw a lot of the same problems I encountered approached differently. I think there’s some key things that need to make it into core still.
- scotty79 3y agoHow's Svelte different from AngularJS 1? I have such bad memories that I refuse to touch any code-in-html framework with a 10 foot pole.
- mrieck 3y agoDoesn't sound like a very promising company if your own developers rather use a different framework than dogfood their own. Isn't that kind of admitting defeat?
- simonsarris 3y agoWe develop and sell a visual Diagramming library, not an SPA framework. There is no overlap.
- hellojason 3y agoI believe WordPress choosing React as its frontend framework of choice further solidified this point.
- square_usual 3y agoReact doesn't have a "relatively small surface" any more, because even the React team doesn't recommend that you use "just" React. It's all frameworks on top of React like Next or Remix, and those are more complex, have many involved concepts and come with footguns. I have seen many, many sites switch to Next and completely bungle it, making the user experience worse than it was before the change. (Of course, even React itself has gotten fairly complex with Hooks, Suspense and the dreaded Server Components.)
- gejose 3y ago> I have seen many, many sites switch to Next and completely bungle it, making the user experience worse than it was before the change. What are some specific sites you've seen that adopted react and ended up worse as a result of it? > doesn't have a "relatively small surface" any more, because even the React team doesn't recommend that you use "just" React Isn't this evidence of it having a relatively small surface area that frameworks and other tools can build on top of, much like html, css etc?
- square_usual 3y ago> Isn't this evidence of it having a relatively small surface area that frameworks and other tools can build on top of, much like html, css etc? No? You can build on top of a large surface area, too? Of course, the funny thing is, even if you are right and React has a "relatively small surface area" (relative being the operative word,) what good is it when the creators of the framework say that you shouldn't use that surface area directly? > What are some specific sites you've seen that adopted react and ended up worse as a result of it? I don't think you're arguing in very good faith, but one recent example is the Indian grocery delivery service bigbasket. They switched from mostly-server-rendered to Next, and the new version was downright horrid for a while, and is only barely usable now. The most cruel part of the joke is that the next.js version is currently only shown to logged in users, so you can blissfully shop for a while, get to the cart and then be hit with the awful new UI.
- darepublic 3y ago
- austin-cheney 3y agoI remember hearing exactly the same words about jQuery a decade ago. This is bias stacked on comfort using a bandwagon mythology as a qualifier.
- SkyPuncher 3y agoJquery worked for a world that was mostly html with some sticking a of JavaScript. In fact, it still does. React is just a better approach to building all-encompassing SPAs.
- TechBro8615 3y agoHold that thought. Many people are saying React has jumped the shark with the complexity of server components and tight coupling with favored frameworks like Next.js I wouldn't be surprised to see some movement toward simpler but equally robust frameworks like Vue or Svelte.
- theironhammer 3y agoOr SolidJS which uses Signals.
- TechBro8615 3y agoI actually really enjoyed programming with Qt in C++ using "signals and slots," about ten years ago for a school project. Perhaps it was ahead of its time.
- oliwarner 3y ago> React is now the de facto choice I contract for a few companies and everyone seems to have a different take on the industry standard. React may well be biggest, but I don't think it's possible dominance is the reason there are fewer framework posts on HN recently.