Live data from Hacker News

Single Page Application Is Not a Silver Bullet

blog.bloomca.me

41–50 of 111 posts

Re: Single Page Application Is Not a Silver Bullet

#41

Earlier quoted context omitted.

That's usually just a lack of basic engineering practices common to well-implemented SPAs. All requests below the SPA's root should be forwarded to the SPA root, which appropriately then routes the request to the proper views and controllers. Proper usage of resource IDs in these URLs allows a newly initialized application model to populate and serve the appropriate content for the appropriate views.

The point is that browsers already have built-in code to interact with links and such in a predictable and straightforward manner, and your suggestion that "a lack of basic engineering practices", implying all SPAs need to reimplement that functionality, shows just how absurd the situation is.

One path to a SPA that supports all those features without implementing them, and is also "progressive" (i.e., the first request comes from the server so that it's fast even on mobile, and search engines and non-javascript browsers are supported) would be:

- Implement a non-SPA web app in Node.js

- Include (parts of) the server-side code in a Service Worker. That way, after the SW is installed, the SW would handle requests instead of the server.

- Polyfill the missing parts. For example, you could polyfill the database to store updates when offline and sync them later.

Maybe you could make a framework where you can share code between Node.js and the Service Worker, similarly to how you can do server-side React today.

Re: Single Page Application Is Not a Silver Bullet

#42
I thought gatsbyjs was a nice medium ground. You have the familiarity of a single-page app in terms of stack and yet have the quick loading times and back button, SEO all of that since it produces a static site. I thought it was genius but I'm biased because I like react.

Re: Single Page Application Is Not a Silver Bullet

#43

TBH most of the cons stated in this article are just because of bad programming, not because it's a SPA > broken “back” button (sometimes it works properly, but in general people don’t trust it) If your UX is good, the user will notice data is refreshed when going back. All current top tier SPA Frameworks have support for correct HTML5 routing. > broken “open in a new tab” behaviour – people like to handle links in o…

No. Because it is an SPA, it means there is more work to restore the default behavior of the back button. That's the way he should have articulated his point. You also mention HTML5 routing.. Ok now you have to configure your web server to properly parse the URL and understand what it's conveying.

And all of that work is already done for you in all modern major SPA frameworks.

Re: Single Page Application Is Not a Silver Bullet

#44

I thought gatsbyjs was a nice medium ground. You have the familiarity of a single-page app in terms of stack and yet have the quick loading times and back button, SEO all of that since it produces a static site. I thought it was genius but I'm biased because I like react.

Agreed. The old CERN website is pretty fast, but Gatsby actually loads subsequent pages much faster — hardly any discernible delay.

Re: Single Page Application Is Not a Silver Bullet

#45

I thought gatsbyjs was a nice medium ground. You have the familiarity of a single-page app in terms of stack and yet have the quick loading times and back button, SEO all of that since it produces a static site. I thought it was genius but I'm biased because I like react.

Funny you mention it, I just started looking into rewriting my portfolio website (http://sdegutis.com) from a custom node-based static site generator to use Gatsby.js, in order to get more practice with React.js. Really curious to hear what other HN regulars who've used Gatsby think of it...

Re: Single Page Application Is Not a Silver Bullet

#46
One thing I'm noticing about SPAs is that they're often slower to load, but the slowness and loading animations gives me a higher perception of the quality of the application.

The same application loading and doing things instantly as server-side templates feels comparatively cheap and un-modern.

What is wrong with me?

Re: Single Page Application Is Not a Silver Bullet

#47

I thought gatsbyjs was a nice medium ground. You have the familiarity of a single-page app in terms of stack and yet have the quick loading times and back button, SEO all of that since it produces a static site. I thought it was genius but I'm biased because I like react.

Funny you mention it, I just started looking into rewriting my portfolio website ( http://sdegutis.com ) from a custom node-based static site generator to use Gatsby.js, in order to get more practice with React.js. Really curious to hear what other HN regulars who've used Gatsby think of it...

I used it actually because I love react but needed to work with a great designer who already knew sass and I needed to include react components but also wanted to hook it up with a cms too. Check check check... keeps going and produces a static site. Wow. Even the designer could use this and modify things for simple components, not knowing react. I'm pretty happy so far.

Re: Single Page Application Is Not a Silver Bullet

#48
I recently started blogging again, and I chose to go with a static site generator. It's fast, really fast. Loading a whole page with each click is so much faster than visiting most of the sites I visit each day.

I'll never get why we collectively decided that it's reasonable to grant every random website in the world execute permissions on our machines.

Re: Single Page Application Is Not a Silver Bullet

#49
Over 90% of my web browsing is done with JavaScript turned off. When I hit an spa blog I sometimes read it, sometimes not. Clearly if the owner of the blog is so insensitive as to make it an spa, they don't care about the content and especially don't care about their readers. That's fine. There's plenty of other content on the web to read. I don't understand why it's normal to let strangers run code on my computer. Yes, the masses are ignorant of the consequences, but I think that's slowly going away as me generations grow up with the internet. Anyway, the upside is that over 90% of web pages I visit load under a second. Imo, people who make their blog, marketing site, etc. an spa blindly don't care about their content, presentation, or the reader. Why would the reader care about them?

Re: Single Page Application Is Not a Silver Bullet

#50
I was thinking about this recently watching a major web app throw a bunch of errors and slowdownsall to do with its SPA features. If it was just a normal web app it would be so much faster and more usable. It seems crazy to me that we have faster and faster computers and internet connections, and yet we've added all this new latency to the software we use.

I find the list of pros somewhat unconvincing.

For a lot of applications, a reload is no hardship, and is faster than most SPA interactions I see.

For a lot of granualar actions, jquery, while not sexy, is not harder to maintain than a full SPA would be.

The alleged development efficiency of decoupling front from back really needs context and argument.

As I see things, there are a lot of web projects where a normal app with a little progressive enhancement is a good solution.

Post reply on HN