by pil0u · 3y ago · 0 comments
For the 3 years I have played with the web, I have been seduced to dive into a framework that is "fullstack" JavaScript to learn the language that is seemingly everywhere and "here to stay".
I have seen dozens of articles like this one for all the major frameworks around - some not really maintained over time. I cannot find, in the JS ecosystem, the stability I know in the Rails ecosystem. I fall in a state where I search for objective arguments, hesitate, and end up not taking any decision.
For those who know better, what is your current bet for a JavaScript (or TypeScript for that matter) framework that will last* the next 15 years? Is Svelte on the list?
* maintained, with a rich and alive ecosystem
Difficult to say what the replacement will be, but I suspect it will be some form of plain JS + MVVM architecture, with a VM (view model) with two-way bindings, possibly natively part of the DOM, or even the DOM itself being optimised and async-ed to a point where virtual DOM diffing and similar approaches are obsolete, and an M (model) basically providing a client-side interface for the server API with some level of local caching, and providing an event listener interface for the VM to update itself. You may recognise some of these features from much older libraries, but I think a lot of them will be available natively in browsers (hopefully standardised, or in a darker timeline, fragmented between major browser vendors).
Another possibility is HTMX-like partial updates getting more native browser support, essentially blurring the line between multi-page applications and SPAs.
By 2030 I think a more interesting possibility is WASM everywhere. Now all language ecosystems ask whether they want to provide some frameworks or DSL for their users to deploy to web.
Basically he says that we should use WASM for stuff like Figma (which already does use it) or other types of web apps while keeping the DOM for content based websites.
Even if this happens to React, it means it will still be maintained and stable for at least another 15 year.
I also think React will evolve and adapt (see RSC which is kinda what you describe). The beauty of React in this aspect is that the scope is quite narrow so it can evolve, as it has done in the past.
For one, in Svelte you're getting a legible stack trace - something that JS frameworks stopped delivering over a decade ago.
To finally know which change triggered the rendering that errored out just by looking at the stack trace is a game changer.
Lit is a great tool to create your own framework while keeping it integrated with other lit-based frameworks and any other framework as it is based on custom Elements so it is an excellent way to write components that can be used together with React, vue, svelte. Another great advantage is that Lit already have top class UI libraries like shoelace, ui5, Lion and many more.
I don't know "better", but FWIW I just went through this same exercise and landed on TypeScript and Vue, with Vite as my build system. Vue is 9 years old (vs. React's 10), and I'm reasonably sure that I'm not going to need to learn a new front-end framework before 2040 unless I want to.
I think the jury's still out on whether Svelte will be around that long, although I'm rooting for it. IMHO, the key will be the ecosystem that grows (or doesn't) around it.
I switched to it from React + Webpack, and it's so much better.
Maybe not, but there is a good chance that Vue in 2040 is nothing like Vue today.
Things change all the time. It’s okay.
For 15 years: My bet is on React, see the amount of apps currently build on React, see multiple large companies backing it, see the #huge ecosystem, all the jobs. Even if it goes out of fashion we'll see another 15 years of it.
Other mentioning React will be like jQuery supports my point: Out of fashion, but well maintained and still used a lot. (Side note: Rails is also like that imo).
Svelte does an interesting thing with the compiler, but otherwise not that revolutionary, and in some parts questionable. In terms of longevity they have a ways to go.
But 15 year longevity seems like a strange criteria to me. Is the app you are building really that important that it will need to survive 15 years, but not important enough to update it to newer tech?
I think it's also good to realize that all the options are largely similar and only differ on details. It's a different flavor of the same thing. Learn one and you will be able to pick up the others very easily.
I find that's not uncommon in large corporations. The app does what it does, and nobody particularly wants to rewrite it. It gradually both petrifies and rots, and yet a ton of workflows go through it.
For that scenario you want it in a framework that lasts, even if it's not the best one. Some poor schmuck has to keep it limping along, and then pass it off to some other poor schmuck.
Eventually the whole thing comes crashing down and you have to deal with Conway's Law -- the whole corporate structure has been built to reflect the scope of that elderly piece of software and everything cobbled to deal with it. You get to re-do it in the latest-and-greatest -- but hopefully one that will last another 15 years.
Whereas JavaScript is a primitive, and frameworks have gone and come based on the needs of the time.
Depending on your web stack, you probably have a very different view of JavaScript. And actually I’d rather view it as that; JavaScript in the context of a web stack is just an extension of the serving framework.
If you say the backend is just a simple REST API, then you fall into the SSR or not camp. If you’re not in SSR, I guess it doesn’t matter. But these days, things aren’t trending towards SSR.
So your question actually boils down to, which set of JavaScript libraries will be maintained for a given stack. So the answer is: the most popular JS framework for any established full stack web framework.
If not SSR though, I’d say react. Because it’s cheap and ubiquitous.
Ember.js and Angular.
And I wouldn't call React a framework, it's a view library.
Let me explain.
While there was a new React router coming out every week in early 2010s, some teams picked a batteries included framework such as Ember.js and focused on productivity and shipping rather than bikeshedding which router to use or what folder structure to have.
And those teams have been upgrading their apps for over a decade since the early Ember.js versions (some even upgraded from before Ember was forked from Apple's SproutCore).
Intercom swears by it https://www.intercom.com/blog/evolution-of-ember-at-intercom...
So do some Ember apps at Apple, LinkedIn, Microsoft and Heroku that have been going through this journey for years.
And they will carry on.
There's a new and faster rendering library out on the block?
That's easy. We'll just replace the rendering engine.
That's what Ember.js did in mid-late 2010s with Glimmer.js, where they dropped-in a complete replacement of Ember.js rendering engine with full backwards compatibility which was beating React in some benchmarks.
https://auth0.com/blog/face-off-virtual-dom-vs-incremental-d...
So frameworks such as Ember.js, Ruby on Rails and others will still be there in 15 years, alive, with people interested in productivity rather than tinkering keeping them fresh and alive.
View libraries? Yes, but in the same sense jQuery is today. It's there, it's being patched, thousands of sites use it, but there'll be better ways to do it.
Might as well have said Dojo and Knockout, it would have meant the same thing.
Neither will ever be popular.
Because it's always be easier to learn and spin-up an Express.js or any front-end library with a single index.html and tinker away.
> than into doing anything relevant outside the Ember community in the last decade.
Quite dishonest, and not sure why you're turning this into measuring exercise, so I won't bite.
> Might as well have said Dojo and Knockout, it would have meant the same thing.
Someone should tell Apple, HashiCorp, DigitalOcean and Microsoft they're not cool anymore releasing new stuff in Ember.js, must pick a new JavaScript framework of the year!
If you're going to call me a liar though you need to do better. What has Ember done but continually play catch up for years and years on end? Here, go look yourself: https://github.com/emberjs/ember.js/releases How many years do you have to scroll back to find anything that influenced anything outside of Ember? The last influential ideas might have been EmberObject to fill gaps in the Javascript language before ES6 became a thing, or the idea of Ember Data as a front end opinionated ORM, though that has mixed results depending on your backend team's buy in.
> Someone should tell Apple, HashiCorp, DigitalOcean and Microsoft they're not cool anymore releasing new stuff in Ember.js, must pick a new JavaScript framework of the year!
Or I can just look at what front end jobs these companies are posting: https://www.indeed.com/q-apple-web-developer-jobs.html?vjk=b... https://www.indeed.com/jobs?q=hashicorp+front+end&l=&vjk=90c... https://www.indeed.com/jobs?q=Microsoft+web+development&l=&s...
and plainly see that they're not Ember, they're entirely React.
I can find ONE mention of Ember from your company list, and it's a nice-to-have skill for a backend role: https://www.indeed.com/viewjob?jk=7751f4d47fbf9760&tk=1h9hc6...
If we're going to suggest any dishonesty is taking place, it would be the implication that these companies are Ember shops and not just dealing with lamentable choices that happen to still be in production and too costly to replace.
I'm surprised by the number of people swearing by React as if it's some holy grail of UI technology that will never die. Popularity is meaningful, but only for a while.
Just like there used to be a jQuery plugin for anything you wanted, there’s probably a similar React solution for anything you want. Outside of React or Vue you’re often reinventing a wheel. It’s doable but not productive.
If I had to make a project, I would bet on vue because it is community funded
We're approaching the diminishing returns when it comes to front end frameworks. All the big ones are decent. I don't feel a need to have a better framework.
My bottleneck is how fast I can write logic and CSS. With complex components a lot of time is spent on managing state correctly, implementing all the minute details that the designers came up with.
- Some older language or tech is upgraded and crosses over via WASM
- Immediate mode GUIs rendered with Canvas
- Heavier reliance on the base web standards without as much build processes. Either SSR like HTMX or an event driven rehash of MVC for SPAs.
oh god, what would that mean for the web? an unreadable mangle of JS, HTML, and CSS, even when it's in source code format? count me out!
Nobody is going to pay programmers to write clean code if AI can write working code for 0.0001% of the price.
See: creative software like Adobe CC that technically saves to common formats
You'll be arranging UI blocks in augmented reality IDE completely powered by AI. AI will use WASM and upon request it will gladly convert to your language/framework of choice so you can view its source. Us old timers won't trust that it converted the code correctly for us to read, but the kids won't care. They'll just give it a new context/edge case examples, and have the AI rewrite everything on demand whenever they run into a problem. Looking at code will be outdated.
I see that mind often and it makes me very sad. 40+ years of computer science, bookshelves, many now must-read classics, written on software maintenance, and this is what we end up with: just throw it out.
I despise this mindset in other industries (electronics, phones, toys, furniture) where, instead of designing stuff to both last, and be repairable, we just buy a new couch, phone, or blender once anything breaks. And I dislike it even more in software.
I honestly cannot, an will not accept the common statement by random web agency that rebuilding this bakeries WordPress site from scratch, is cheaper than salvaging and repairing it. Nor that rebuilding some Rails backend in Go, or Nest.js the easiest. I mean: I know it often is the cheapest or easiest. But only because those in charge of the previous version never bothered about maintainability.
It’s the difference between manufacturing denim and selling jeans. The denim business is forever. The jeans business is constantly changing.
It's not always a bad thing. It gives you the chance to do it better.
When is the last time you looked at your work from 10 years ago and thought you'd do it exactly the same way today?
And the cost to destroy and rebuild software is so much smaller than other industries that produce things that exist in the physical world. Why not take advantage of that?
Also: job creation.
The amount of frontend JS developers is many times larger than the amount of Ruby on Rails developers so the fact that there is less "stability" is hardly surprising.
My advice is - if you want something that will be stable for 15 years, look for something that has already been stable for 15 years.
care to share a link, blog post, or study? i've built at this point dozens of apps on react, no "instabilities" to call home about
That said, I think it's becoming increasingly hard to see what value React specifically (as opposed to any other framework) is bringing to new projects. It's slow and heavy, but without the pre-made structure that you get from, say, Angular. It has a great ecosystem, but it's typically harder to integrate with non-React projects libraries.
I know Vercel/NextJS are pushing really hard to make the big advantage of React be server-side rendering, islands, suspense, etc - the idea that you can build your entire app in React, but shipping only the code needed to change the few pieces that actually get updated in the UI. There's some merit to this in that all your templating/rendering lives in one place (and you get to use frontend templating tools, which at this point are pretty good), but I think React is the worst framework to take advantage of this idea. Partly that's because it's just very big and slow, and shipping smaller bundles is going to have diminishing returns when React is already half your bundle size, but mainly that's because React doesn't really have the architecture for these sorts of situations. There is a big assumption in React that it controls the world, which makes things like nested island very hard, and means that you need to ship lots of rendering code even if the only thing changing on screen is a CSS class.
I'm talking a lot about why React isn't a good candidate for the future, which isn't really answering your question, but that's because it truly is the elephant in the room in these discussions. No-one ever got fired for choosing React, and probably won't for the foreseeable future, even if it isn't perfect.
My answer, though, is Vue. Personally, it doesn't do a lot for me, I just like JSX too much and find the excessive Proxy stuff too complicated. But they've got one big advantage over React right now, and that's that they have the right architecture: signals. Signals, when done right, are a great way of skipping a lot of work and VDOM-based updates by directly updating the changes attributes. For example, if you have a class name that depends on some data, and that data changes, you don't rerender the entire component, you just update the class name directly.
Currently Vue doesn't do that, but they're working on a new renderer that takes a lot of the idea from SolidJS, and that will drastically improve performance and decrease bundle size (they've released performance benchmarks that have Vue beating Svelte, although obviously take that with a grain of salt!). This is great for client-side rendering, but the best big improvement would obviously be to do less rendering overall. This comes back to Vercel and their big push for islands. One of the things you can do with Signals is, rather than do the whole SSR/hydration dance that Vercel are doing, is to ship only the signals (i.e. the application state and instructions needed to update the page). At that point, you don't even need a client-side renderer - everything just gets updated in the DOM directly. This is the direction that projects like QwikJS are going in.
Of the three big frameworks, the only one that's really in a state to take advantage of these advanced is Vue. The React team aren't interested in exploring signals right now, and while the Angular team are moving in the direction, there's a lot of legacy stuff there that's going to make large changes hard.
The other alternatives are smaller frameworks like SolidJS, Svelte, etc, but I think they're just too small to really get a huge amount of market share. They make great testbeds for new ideas, but are too nice overall.
That said, if you're interested in the craft of frontend development, give SolidJS a go. It's pretty much pure signals, but with a React-like interface. You can explore the compiled output and get an idea of what the compiler is actually doing, and the whole thing is amazingly lightweight and fast - only marginal overheads compared to vanilla code, but with a declarative structure.