Somehow the JS/Node dev community managed to re-invent JEE web profile, and is very close to re-invent Glassfish as well at that point, but worse because it didn't learn anything from Java enterprise... this madness needs to stop.
New React docs pretend SPAs don't exist anymore
11–20 of 225 posts
Re: New React docs pretend SPAs don't exist anymore
#12Re: New React docs pretend SPAs don't exist anymore
#13Hype driven developers/marketers believe the only type of websites that exists are those which need indexable content for SEO purposes. More news at 11
Re: New React docs pretend SPAs don't exist anymore
#14I just want to say, as a developer that just wants to get stuff done, I'm so annoyed by frameworks needing a meta framework, etc, etc. I want something as simple as CRA to be enough.
Re: New React docs pretend SPAs don't exist anymore
#15As far as I understand you can use these frameworks to write SPAs as well. I have no idea how well supported that use case is in the end. I find the idea that you want to handle data fetching and routing in a framework to be reasonably convincing. There are advantages here, and it's easy to get into a bit of a mess if you just fetch data in each component. The part that has stopped me from looking at the frameworks u…
You can do the same in Gatsby, but it's probably a waste of time.
But...
With an index.html file containing a createRoot(document.getElementById('root')).render() call, and parcel or vite or webpack, you can produce much the same thing.
Possible that next.js will give you easier access to some more interesting ways to split your JS bundle up - but also possible it will fight you if you continue to insist on not taking advantage of SSR.
Re: New React docs pretend SPAs don't exist anymore
#16I don't think that's a fair characterization of the "Start a New React Project" page [0]. Next.js is the first option listed and is described as a way to "create React apps of any size—from a mostly static blog to a complex dynamic application." This reads to me like "Next.js can do SPAs (like CRA) plus static sites and SSR". Next.js' site even says "The core of Next.js has been designed to enable starting as a stati…
We (just today) updated the Next.js docs linked based on feedback around this to make it more clear. Hopefully this helps, let me know if you have other feedback.
Re: New React docs pretend SPAs don't exist anymore
#17I don't think that's a fair characterization of the "Start a New React Project" page [0]. Next.js is the first option listed and is described as a way to "create React apps of any size—from a mostly static blog to a complex dynamic application." This reads to me like "Next.js can do SPAs (like CRA) plus static sites and SSR". Next.js' site even says "The core of Next.js has been designed to enable starting as a stati…
That said, I'm not sure why running `next export` is considered 'advanced'.
Re: New React docs pretend SPAs don't exist anymore
#18Off the top of my head, here are benefits to SPA:
- I can just serve a few static files from a CDN. Every user gets the same client.
- Most requests made by the application are actually smaller. I'm just loading the data I need, rather than the data, markup and styling.
- It's an actual client application talking to a data API. It's the same API the rest of my client applications are talking to, be it a mobile API, native, CLI, etc.
- It's a much easier mental model. Interactivity without having to give consideration to whether or not it will disrupt whether it can be rendered. I build my application like a realtime application and just make requests for the data I need when I need it
- I don't have to think about exposing backend secrets, or trying to do things I'm mistakenly assuming to necessarily run in one environment or the other
- I can be much more explicit about loading and caching data when I would like to
Even most of the cons of a SPA can be ameliorated. The biggest con is a larger up front load, but that can be mitigated by code splitting and lazy loading. The fact that it's a handful of static files means that the application is basically cached, too. And SPAs are for applications, not websites. Most people using SPAs want the application experience to be optimal, not necessarily their initial first time load. They want small requests, interactivity, live feedback. This is all possible with SSR, but nowhere near as simple.
Re: New React docs pretend SPAs don't exist anymore
#19I just want to say, as a developer that just wants to get stuff done, I'm so annoyed by frameworks needing a meta framework, etc, etc. I want something as simple as CRA to be enough.
Re: New React docs pretend SPAs don't exist anymore
#20Starting a "new react project" should be basically creating an HTML file, and adding a script tag linking to React the JS library. Why are these developers always trying to obfuscate everything with tons and tons of layers of indirection all the time? You don't need to "bundle" anything and certainly not use some server just to add Javascript to a page (unless it's a matter of CSP of course) and you should certainly…
It just makes sense when you take react as what it is: a library. Now, if you want amenities like a router you need to build it yourself or use something existing. 99.9% of people want this, so why not point them into the right direction?