Live data from Hacker News

None of my projects want to be SPAs

whatisjasongoldstein.com

11–20 of 362 posts

Re: None of my projects want to be SPAs

#11
post #10
post #9

Why do people insist on comparing the initial frontload of a SPA to the page load of every page in their SSR web app? Once a SPA is loaded you can send tiny crumbs of data faster than any significant SSR.

> Why do people insist on comparing the initial frontload of a SPA to the page load of every page in their SSR web app? Because a user doesn't care if it's the initial frontload or not.

Prerender the initial page and they won't notice any difference.

Re: None of my projects want to be SPAs

#12
post #10
post #9

Why do people insist on comparing the initial frontload of a SPA to the page load of every page in their SSR web app? Once a SPA is loaded you can send tiny crumbs of data faster than any significant SSR.

> Why do people insist on comparing the initial frontload of a SPA to the page load of every page in their SSR web app? Because a user doesn't care if it's the initial frontload or not.

[deleted]

Re: None of my projects want to be SPAs

#14
post #11
post #10

Earlier quoted context omitted.

> Why do people insist on comparing the initial frontload of a SPA to the page load of every page in their SSR web app? Because a user doesn't care if it's the initial frontload or not.

Prerender the initial page and they won't notice any difference.

yeah there are a few ways to reduce the initial load time, but my point is it's valid to compare the initial load to every page in an SSR (for most use cases).

Re: None of my projects want to be SPAs

#15
There are lots of applications which don't really benefit from being an SPA (blogs, books, etc.). As soon as you start thinking about meaningful interactions you quickly start having to pile enough JavaScript into the HTML that you quickly run into a mess - defining ways to marshal data back and forth with an ad-hoc structure.

While SPA tooling like React are incomplete since they don't provide all of the client/server data communications that comes for free with a server side application. That is starting to become more "standard" as GraphQL and Apollo start filling the gap of boilerplate. Though of course wrapping your head around GraphQL takes a bit of work for anybody who's spent their life with REST.

Most applications should be SPAs to create the interactions that users expect.

Re: None of my projects want to be SPAs

#17
post #9

Why do people insist on comparing the initial frontload of a SPA to the page load of every page in their SSR web app? Once a SPA is loaded you can send tiny crumbs of data faster than any significant SSR.

> Once a SPA is loaded you can send tiny crumbs of data faster than any significant SSR.

You can, but often that's not what's happening.

E.g. crates.io is currently built as an SPA. It is first receiving a HTML page that loads a javscript file, that performs an XHR request (actually, multiple) that answers with JSON that is used to create the final DOM of the page. The Javascript file is cached but that's about it, it still involves one additional needless roundtrip for the website.

The JSON sent is so badly designed that it alone is far more than the final DOM of the page.

Jus check out this: https://crates.io/crates/winapi

vs this: https://crates.rs/crates/winapi

Only the XHR requests for the crates.io page take up 99 KB uncompressed, while the entire crates.rs winapi page takes 103 KB uncompressed.

Re: None of my projects want to be SPAs

#18

For CRUD apps, using Rails etc. with Turbolinks[1] is the best way to go IMO. It gives you the SPA feel without the headache. In all SPAs, we load JSON, with Turbolinks, we load HTML of that page alone (without the CSS, JS etc). [1] https://github.com/turbolinks/turbolinks

Can you use Turbolinks with a Java backend?

Re: None of my projects want to be SPAs

#19
post #9

Why do people insist on comparing the initial frontload of a SPA to the page load of every page in their SSR web app? Once a SPA is loaded you can send tiny crumbs of data faster than any significant SSR.

Once it's loaded. But not all users have a fast Internet connection, even in the USA. So I'm not sure you can expect them to wait for your 1MB javascript bundle to load.

Re: None of my projects want to be SPAs

#20
post #9

Why do people insist on comparing the initial frontload of a SPA to the page load of every page in their SSR web app? Once a SPA is loaded you can send tiny crumbs of data faster than any significant SSR.

Until you open some link in the app in a new tab, and a whole new ship must be built before it sets sail.
Post reply on HN