News for hackers. Stuff that matters.
Re:The Disadvantages of Single Page Applications (2014) by stevedomin on Monday July 13, 2015 @03:50PM (#9880574)
As with everything, if you're going to do SPA, you should do it well. So far, one of the best SPA website I've seen is https://gocardless.com (disclaimer: I work there).

Once loaded it's probably one of the fastest website I've browsed, and it doesn't have any of the drawbacks you mentioned:

navigating to a new page is quick: ✓

navigating back is quick: ✓

remembering scroll position: ✓

cancelling navigation: ✗ but we won't allow duplicate requests so not an issue

SEO: ✓

Navigation and data loss: ? (no idea how we handle that tbh)

Navigation and loading CSS & JS: ✓ we load everything on the first load (~ 880kB) and that's it. I don't think it will ever be worst than MPA

Analytics: ✓

Automated functional testing: ✓ our unit + e2e test suites run in about 4 minutes (CI)

Our splash pages are open-sourced if you want to have a look at our setup: https://github.com/gocardless/splash-pages

Re:The Disadvantages of Single Page Applications (2014) by themgt on Monday July 13, 2015 @04:49PM (#9880967)
Except, I think this is actually somewhat an example of what the author is saying, because when I click around links:

* Support

* Guides

* Login

* Blog

are all outside the SPA, and some appear to be MPA apps. And perhaps once I logged in that would be its own new app as well?

So in that sense, your website in not an SPA, you have an app for getting new signups which is an SPA, and then you have a bunch of other SPA or MPA apps hooked up to that. As the author said, "Websites can still have Rich User Interfaces without cramming the entire site into one document."

I think the point is to find a balance and realize building your entire infrastructure into an SPA will indeed break the web and your user's experience, most likely. Having a mix of SPA/MPA apps that cover the various functionality you need, and using each where appropriate, is a much better use of resources and results in a better UX.

Re:The Disadvantages of Single Page Applications (2014) by stevedomin on Monday July 13, 2015 @07:24PM (#9881820)
You are right, we have multiple applications, it makes it way easier to maintain them. It would be a nightmare if everything (splash pages, dashboard, blog and any other app you can have) was bundled into a single application, be it SPA or MPA.

Agree, it's all about the user's experience for us, we use whatever tool we feel enable us to build the best UX (without breaking the web).

Re:The Disadvantages of Single Page Applications (2014) by mandeepj on Monday July 13, 2015 @06:09PM (#9881493)
>Since gocardless.com is entirely static, we're able to deploy and serve static HTML

Source - https://gocardless.com/blog/how-we-built-the-new-gocardless....

May be this is why your site is so fast. SPA apps are not entirely static.

Re:The Disadvantages of Single Page Applications (2014) by stevedomin on Tuesday July 14, 2015 @06:38AM (#9883900)
It's kind of a combination between a SPA and a static website.

We generate all the HTML pages so that they can serve as entrypoints, so when you go to https://gocardless.com/features we serve a fully rendered page to the browser, plus we load the rest of the website (that's why it's super snappy after the initial page load).

If you don't have javascript enabled, you'll still get fully rendered page.

Re:The Disadvantages of Single Page Applications (2014) by eCa on Tuesday July 14, 2015 @04:18AM (#9883472)
While it is very fast, I wouldn't consider that an application but rather a static website. In my view, an application needs to do work, usually dependent on user input. Otherwise, basically every website is an application.

The dashboard looks like a much better example of an SPA.

Re:The Disadvantages of Single Page Applications (2014) by virtualwhys on Monday July 13, 2015 @04:34PM (#9880866)
Cool site, I just checked out on Android phone, works (as in fits on screen) in landscape mode; otherwise not. As far as SPAs go the initial page load is relatively fast.

Mobile aside, what is really gained in the SPA approach here when you have what is essentially a brochure site? That is, there isn't a lot of content, and it's all static AFAICT, so why not just send the minimal amount of html over the wire and be done with it? Html fragments are already covered for FAQ et al so don't even need to make a round trip to the server.

Anyway, you'd get above checkmarks for free and, if you generate server-side content using a type safe language (Scala, OCaml, Haskell, C#, etc.), for the most part you'd avoid the code salad of client-side typing.

Obviously I have a server-side bias, am curious to see real world use cases where SPAs are a must vs. a trend.

Re:The Disadvantages of Single Page Applications (2014) by buckbova on Monday July 13, 2015 @04:41PM (#9880911)
I don't suspect he was referring to the gocardless product site, but instead the actual dashboard product.

https://gocardless.com/pro/#features

https://gocardless.com/features/#dashboard

Re:The Disadvantages of Single Page Applications (2014) by virtualwhys on Monday July 13, 2015 @05:05PM (#9881093)
That's where I was.

Not seeing any SPA requirement to click "Payment History" and js display a hidden layer.

Anyway, as far as SPA approaches go this site works well, pretty snappy, no FOUC, just pointing out that server-side + javascript for ajax/effects/transitions is also a viable means to creating a positive user experience.

Re:The Disadvantages of Single Page Applications (2014) by stevedomin on Monday July 13, 2015 @07:25PM (#9881827)
I was actually referring to the product site itself.

But you're right our dashboards are also SPA.

Re:The Disadvantages of Single Page Applications (2014) by freyr on Monday July 13, 2015 @08:21PM (#9882077)
I just wrote a post condemning the use of SPAs that emulate multi-page websites and basic browser functionality, but you provided an interesting counter-example. In fact, it goes to an extreme by being an "app" with minimal user interaction beyond basic navigation across pages.

It is quite fast, which is nice. One of my concerns about SPAs that emulate MPWs is that you're sacrificing speed for complexity, which generally leads to errors. But by serving up static content and limiting interactivity, you get the speed while keeping complexity manageable.

Re:The Disadvantages of Single Page Applications (2014) by LoSboccacc on Tuesday July 14, 2015 @05:32AM (#9883698)
I'm building a multi page app that has a single page which is extremely complex (it's an image based marketing tool, the complex page is the visual editor) and I'm finding browser extremely finicky in their memory management.

I don't know how making a real single page app could be possible for overly complex applications. More than once I managed to crash the chrome javascript engine in a way that could not be recovered even when reloading the page and nothing short of a task manager kill could restore functionality

we are probably abusing too much canvas (we use fabric.js for image maniulation), but adding and removing the canvas from the dom should be safe enough, as we make sure not to store anything outside the dom itself specifically to avoid leaking resources

everything in memory is attached to data entries or in event handlers and browsers should be able to clean up them when the nodes are removed, except they dont.

Re:The Disadvantages of Single Page Applications (2014) by spiffytech on Tuesday July 14, 2015 @11:40PM (#9889580)
In you have code that can reliably reproduce this, you can get a nice check from Chrome's bug bounty, or maybe even find a hacker to help you into pwn2own.
Re:The Disadvantages of Single Page Applications (2014) by fourstar on Monday July 13, 2015 @05:49PM (#9881382)
More details about SEO would be helpful, considering that's probably the MOST important aspect of going all SPA or not.

Are you doing some escape fragment/headless browser for googlebots?

Re:The Disadvantages of Single Page Applications (2014) by insin on Monday July 13, 2015 @06:21PM (#9881551)
It's pre-rendered on the server with React:

  <div class="site-wrapper"
       data-reactid=".20hl256vta8"
       data-react-checksum="-1018283815">
http://facebook.github.io/react/docs/top-level-api.html#reac...
Re:The Disadvantages of Single Page Applications (2014) by EugeneOZ on Tuesday July 14, 2015 @08:03AM (#9884177)
I can easily find in Google content of angularjs sites I created, and I did nothing for SEO :) google just can execute js and it's enough.
Re:The Disadvantages of Single Page Applications (2014) by arenaninja on Monday July 13, 2015 @05:49PM (#9881380)
Any idea why on https://gocardless.com/merchants/new, when the Email Address input has focus, Cmd+Left arrow do not navigate to the previous page? Once the input no longer has focus, I'm allowed to use the shortcut again.
Re:The Disadvantages of Single Page Applications (2014) by dfcowell on Monday July 13, 2015 @09:09PM (#9882256)
Probably because Cmd+left arrow is the system shortcut for "jump to the start of the current line." You'll see this behaviour when a form input has focus on any site.
Re:The Disadvantages of Single Page Applications (2014) by aaronem on Tuesday July 14, 2015 @12:41AM (#9882932)
Which, in turn, is why Cmd+[ and Cmd+] are by default bound to "Back" and "Forward" in at least Safari, Firefox, and Chrome.
Re:The Disadvantages of Single Page Applications (2014) by arenaninja on Tuesday July 14, 2015 @10:21AM (#9885060)
OHhh that's true. I've been curious why stuff like this breaks for months now. I use OSX at work, Ubuntu/Windows at home, and jumping between this many OSs I sometimes forget about the system bindings if I'm not in an IDE. Thanks!
Re:The Disadvantages of Single Page Applications (2014) by stevedomin on Monday July 13, 2015 @07:26PM (#9881831)
No idea why that's the case but I'll mention it to our front-end team
Re:The Disadvantages of Single Page Applications (2014) by minikomi on Tuesday July 14, 2015 @04:24AM (#9883491)
Wow! Very snappy.

    > customers in the UK and the Eurozone
Feel like this should be on the landing page though.
Re:The Disadvantages of Single Page Applications (2014) by monort on Tuesday July 14, 2015 @06:29AM (#9883881)
If I click on "learn more" then "find out the basics" and then click back, popup window stays on top.
Re:The Disadvantages of Single Page Applications (2014) by zkhalique on Monday July 13, 2015 @05:49PM (#9881386)
If you really wanted you could use the HTML5 history API, with a fallback to #hashtags.
Re:The Disadvantages of Single Page Applications (2014) by alanh on Monday July 13, 2015 @07:41PM (#9881890)
Better than falling back to #!hashbang / document fragment navigation - situation allowing - is falling back to a full web page load. (There is even tech allowing for graceful fallback to full form submissions in lieu of AJAX'd form submissions.)

Only ancient browsers fail to support the HTML5 History API. Currently, that is around 10% of the web. Your customers are likely to have a newer browser than IE 9 if they have a budget for technology at all.

http://caniuse.com/#feat=history

★ The problem with embracing the hash for navigation is that you are now committed to running JS on your root FOREVER to detect those URLs - or old bookmarks & links & social media posts will break ★

Re:The Disadvantages of Single Page Applications (2014) by mobiuscog on Tuesday July 14, 2015 @05:54AM (#9883770)
It would be extra nice if it had a fallback to work without Javascript (menus...).
Re:The Disadvantages of Single Page Applications (2014) by robbrulinski on Monday July 13, 2015 @05:30PM (#9881249)
The site is lightning fast! Very nice.
Re:The Disadvantages of Single Page Applications (2014) by amelius on Monday July 13, 2015 @05:46PM (#9881368)
Looks good. What kind of design patterns are you using to achieve this?
Re:The Disadvantages of Single Page Applications (2014) by stevedomin on Tuesday July 14, 2015 @06:41AM (#9883912)
Not sure what you mean by design pattern? It's a SPA, built with React, and pre-rendered.

You can check the source code here: https://github.com/gocardless/splash-pages