As an avid developer of SPAs (currently working on one for my own blog frontend) I'd say a lot if this stems from people being convinced SPAs 1) provide a faster development cycle, 2) they believe that they've offloaded all need for optimization on the framework they use and 3) "serious" development teams build SPAs. Anecdotally I find SPAs, while I'm more comfortable developing them, will take longer to build. You n…
I’ve used React in the past and I believe what you’re mentioning is very React specific. Angular has lazy and eager loading, which reduces bundle sizes. It also doesn’t require so many frameworks to manage manually. They are still there, but they are sort of imported automatically by angular cli so it doesn’t take a lot of mental overhead. Some issues I had, though, were with bugs in newer versions. Some of those iss…
Single Page Application Is Not a Silver Bullet
81–90 of 111 posts
Re: Single Page Application Is Not a Silver Bullet
#82Earlier quoted context omitted.
I’ve used React in the past and I believe what you’re mentioning is very React specific. Angular has lazy and eager loading, which reduces bundle sizes. It also doesn’t require so many frameworks to manage manually. They are still there, but they are sort of imported automatically by angular cli so it doesn’t take a lot of mental overhead. Some issues I had, though, were with bugs in newer versions. Some of those iss…
is there a way for React to do eager loading? i asked around on twitter but got told "thats not React's job".
Re: Single Page Application Is Not a Silver Bullet
#83As an avid developer of SPAs (currently working on one for my own blog frontend) I'd say a lot if this stems from people being convinced SPAs 1) provide a faster development cycle, 2) they believe that they've offloaded all need for optimization on the framework they use and 3) "serious" development teams build SPAs. Anecdotally I find SPAs, while I'm more comfortable developing them, will take longer to build. You n…
Re: Single Page Application Is Not a Silver Bullet
#84Earlier quoted context omitted.
There's nothing to reimplement. Browsers navigate based on URLs, so if the URL for a page in an SPA isn't enough to load the full state on a fresh pageview, then it won't work. So it's absolutely about proper engineering to make sure pages have working direct URLs rather than just relying on other navigation while the app is already open.
Sure there’s something to reimplement. Ensuring that changes to the view state are represented in the URL bar isn’t trivial. Should a popup dialog be reflected in the URL state? Should a confirmation prompt? What about browsing a hierarchy of menus? With web pages as documents that only use JavaScript to “decorate” things, you get this for free. And it’s likely aligned with what users expect.
> Should a popup dialog be reflected in the URL state? Should a confirmation prompt? What about browsing a hierarchy of menus?
These aren't examples of problems with SPAs, they are examples of things that do not cleanly map to URL routing in general. You could ask all of these same questions of a normal web page and they would have the same answers.
Re: Single Page Application Is Not a Silver Bullet
#85Earlier quoted context omitted.
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.
The fundamental difference between a SPA and traditional website is that the routing and compositing of views is generally handled by the client rather than the server. It doesn't make sense to call something that doesn't respect that design a SPA. A poorly implemented SPA is what I would call that.
Hackers News '18, folks.
Re: Single Page Application Is Not a Silver Bullet
#86I always thought the decision was: - Content site = NOT single-page-app - Application = single-page-app Maybe there's more of a gray area between content sites and applications these days, but I think it's still pretty obvious: If most of the user's time is spent reading content, it's a content site.
The problem is even content is becoming functional with interactive charts, infographics and figures, videos, media, filtering, sorting - then the site will eventually need comments, ads, subscribing, favoriting, upvoting, login, lazy load next article, infinite scroll, etc. Yes, a pure content site shouldn't be an spa, but how long can you survive running a pure content site? Information is complex and the web allow…
The idea is to load only the React components and the data needed for each route at load time. An example of a page generated with this technique: http://inflacao.org/series/
Re: Single Page Application Is Not a Silver Bullet
#87I've worked on a number of SPA's over the years and I always run into the problem of getting my team to give a shit about performance. "We're not Google," they protest. Frankly for a lot of people it's the trade-off of slow client performance for development velocity. It's much easier to just throw on another state for new functionality than it is to consider what parts of the page can be static and how they can be r…
Surely if you can't produce an SPA with equivalent or better performance than a more traditional architecture then - don't build an SPA. Or even better use a simpler solution that gives me 80% of the benefits of an SPA: Turbolinks, PJAX, intercooler.js or even a light sprinkling of good old AJAX. Does anyone remember "progressive enhancement"?
As long as your backend is fast enough, it feels like navigating a SPA.
Re: Single Page Application Is Not a Silver Bullet
#88One 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
#89Frankly SPAs should be served up via a whole different channel, they are effectively an abuse of web tech to NIHing the likes of VNC.
Re: Single Page Application Is Not a Silver Bullet
#90Earlier quoted context omitted.
The problem is even content is becoming functional with interactive charts, infographics and figures, videos, media, filtering, sorting - then the site will eventually need comments, ads, subscribing, favoriting, upvoting, login, lazy load next article, infinite scroll, etc. Yes, a pure content site shouldn't be an spa, but how long can you survive running a pure content site? Information is complex and the web allow…
What are static 2d representations? You can do everything you mentioned without an spa just fine. Plenty of content sites (the majority, actually) survive just fine.