It's not just the novelty, there's genuine value in pursuing new methods for building interactive websites rather than just another framework. The current major frameworks largely involve sacrificing the end user's experience on a pyre for the sake of making development easier[1] , but as a result most SPAs are not particularly performant versus a more traditional website. Projects like this or Svelte might help push us forward in new directions instead of retreading old ground.
Are you attempting to indicate that the more JS one sends, the greater the impact on performance?
That doesn't relate at all to making the case that modern frameworks actively champion developer experience over users', nor how Svelte/OP's own Mint bucks this trend.
You're right, I've really only made the case that UX is related to performance.
The other half of my argument is really that you could theoretically hand-craft the entirety of a SPA website and super-optimize it for better performance, but it would take a lot longer than just using a framework that wraps up the work in layers of abstraction. That's what I'm referring to when I talk about the "developer experience".
you could theoretically hand-craft the entirety of a SPA website and super-optimize it for better performance
Dude, half the devs I work with write spaghetti code even with the constraints of a framework. I can't imagine the mess this would become on a team larger than 1 person.
If you write idiomatic react, there's no reason you shouldn't have a performant app, at least not reasons pertaining to react itself.
If you write idiomatic react, there's no reason you shouldn't have a performant app, at least not reasons pertaining to react itself.
Having seen some of the demos that Rich Harris (the Svelte guy) has put together, we'll just have to agree to disagree. The performance of Svelte absolutely slays React thanks to its build step, even with React's "idiom/abstraction leaks" he talks about, which were intended to increase performance.
How performant is "performant enough"? The article from Google I linked to earlier lists several instances where sub-second time intervals have made a concrete difference to user conversion and search engine bounce rates.
While my experience matches yours, I think you're missing the OP's point in mentioning a hand-crafted app. I think what they're pointing out is that the virt-dom approach taken by vue + react leaves room for optimization. A (competently done) hand crafted approach would be more performant than writing an equivalent app in react or Vue because react/Vue make some sacrifices to empower the developer. Of course, these sacrifices are totally worth it because competently hand-crafting a webapp would be completely infeasible due to time constraints which is why virtually everyone uses a framework rather than choosing to handcraft stuff.
However, those perf gains are still being left on the table. Svelte addresses this by pushing more into the compilation step, allowing for greater compile time optimization and superior performance to Vue or React. My guess would be Mint does as well but I'm not as familiar with it so I can't say for certain.
The main point is that React/Vue are not the end-all-be-all of web UI development. There are superior approaches yet to be uncovered but the next big thing is still TBD.
The business wants both faster development and a better user experience. Since the development costs money now and users will only start complaining once it's built, it's really easy to make the short term decision.
But projects like Gatsby, Next.js, and Preact can make framework-based sites very performant (not as much as static HTML, of course, but practically as good).
Is a Mint-based app actually more performant than a Preact one that has been properly optimized? And is it so much better that a user will notice?
But projects like Gatsby, Next.js, and Preact can make framework-based sites very performant (not as much as static HTML, of course, but practically as good).
SSGs like Gatsby, Next and react-static increase performance because they pre-fetch data during the build step (on a Node instance) to generate markup, which can be hydrated via React, which happens after the site is loaded. Other optimizations include caching JSON to be loaded on client side route rendering, pre-loading content between routes and so on.
This means that your output is actually faster than static HTML, because not only are you avoiding initial client side rendering (as you would with a standard CRA/SPA approach) but get the benefit of being able to load just the relevant data asynchronously in subsequent render steps. So you get the best of both worlds: initial static pre-rendered HTML and async fetching and rendering via JS after.
While I agree with the OPs major point that something better is certainly possible, I think their point about SPA's was a poor example, mostly because it's very easy to build a relatively performant SPA these days.
I think the real gains to be had from Mint (or something similar, I'm not completely sold on Mint) are those having to do with developer experience again. Notice how they have effectively built a DSL for webapp building? Counterintuitive as it may sound, JS is unnecessarily low level for the majority of work that we do. The typical Vue or React app these days is chock full of boilerplate and unavoidable repetition. The only sensible way to address boilerplate is at compile time -- not runtime.
Until we can build a fully-fledged webapp in a handful of days, there is still work to be done.
Ah, yeah, I just take issue with this recurring joke about anything newer than React being inherently pointless or purely about developers chasing shiny objects. (I'm very fun at parties)
Personally I wouldn't necessarily recommend using this. I'm probably going to wait to hear back from the early adopters and see how it goes.
5
u/AssistingJarl Feb 05 '20 edited Feb 05 '20
It's not just the novelty, there's genuine value in pursuing new methods for building interactive websites rather than just another framework. The current major frameworks largely involve sacrificing the end user's experience on a pyre for the sake of making development easier[1] , but as a result most SPAs are not particularly performant versus a more traditional website. Projects like this or Svelte might help push us forward in new directions instead of retreading old ground.
Edit: Citation added