Questions tagged [single-page-application]

A single-page application (SPA) is a web application that fits on a single web page with the goal of providing a more fluid user experience akin to a desktop application.

A single-page application (SPA), also known as single-page interface (SPI), is a web application or web site that fits on a single web page with the goal of providing a more fluid user experience akin to a desktop application.

In an SPA, either all necessary code – HTML, JavaScript, and CSS – is retrieved with a single page load, or partial changes are performed loading new code on demand from the web server, usually driven by user actions. The page does not automatically reload during user interaction with the application, nor does control transfer to another page. Updates to the displayed page may or may not involve interaction with a server.

Resources

5306 questions
386
votes
3 answers

SPA best practices for authentication and session management

When building SPA style applications using frameworks like Angular, Ember, React, etc. what do people believe to be some best practices for authentication and session management? I can think of a couple of ways of considering approaching the…
356
votes
21 answers

How to Detect Browser Back Button event - Cross Browser

How do you definitively detect whether or not the user has pressed the back button in the browser? How do you enforce the use of an in-page back button inside a single page web application using a #URL system? Why on earth don't browser back…
215
votes
11 answers

Single Page Application: advantages and disadvantages

I've read about SPA and it advantages. I find most of them unconvincing. There are 3 advantages that arouse my doubts. Question: Can you act as advocate of SPA and prove that I am wrong about first three statements? ===…
VB_
  • 45,112
  • 42
  • 145
  • 293
154
votes
2 answers

Is store.dispatch in Redux synchronous or asynchronous

I realize this is a basic question but I had no luck finding the answer elsewhere. Is store.dispatch synchronous or asynchronous in Redux ? In case it is asynchronous is there a possibility to add a callback after the action has been propagated as…
ps-aux
  • 11,627
  • 25
  • 81
  • 128
146
votes
6 answers

How to make a SPA SEO crawlable?

I've been working on how to make a SPA crawlable by google based on google's instructions. Even though there are quite a few general explanations I couldn't find anywhere a more thorough step-by-step tutorial with actual examples. After having…
beamish
  • 2,827
  • 3
  • 15
  • 16
141
votes
2 answers

CSRF Token necessary when using Stateless(= Sessionless) Authentication?

Is it necessary to use CSRF Protection when the application relies on stateless authentication (using something like HMAC)? Example: We've got a single page app (otherwise we have to append the token on each link:
106
votes
12 answers

Could not find the implementation for builder @angular-devkit/build-angular:dev-server on ng serve command

I tried to update the angular CLI following this, but now I can't run my app. When I try to run the command ng serve, it gives me this error: Could not find the implementation for builder @angular-devkit/build-angular:dev-server Error: Could not…
user2748531
  • 1,213
  • 4
  • 12
  • 21
94
votes
7 answers

How to force update Single Page Application (SPA) pages?

In fully server side based rendering (non Web 2.0), deploying server side code would directly update client side pages upon page reload. In contrast, in React based Single Page Application, even after React components were updated, there would be…
Pahlevi Fikri Auliya
  • 4,157
  • 8
  • 35
  • 71
92
votes
8 answers

Difference between [ngClass] vs [class] binding

What is the difference in Angular 2 between the following snippets:
81
votes
12 answers

How to compress URL parameters

Say I have a single-page application that uses a third party API for content. The app’s logic is in-browser only; there is no backend I can write to. To allow deep-linking into the state of the app, I use pushState() to keep track of a few variables…
Jan Lehnardt
  • 2,619
  • 1
  • 17
  • 14
79
votes
9 answers

How should I configure create-react-app to serve app from subdirectory?

I have classic web application rendered on server. I want to create admin panel as single page application in React. I want to server admin panel from https://smyapp.example.com/admin/. I try to use create-react-app but it assumes that i serve SPA…
guest
  • 1,696
  • 4
  • 20
  • 31
77
votes
9 answers

Vue.js computed property not updating

I'm using a Vue.js computed property but am running into an issue: The computed method IS being called at the correct times, but the value returned by the computed method is being ignored! My method computed: { filteredClasses() { let classes…
Jared Loomis
  • 795
  • 1
  • 5
  • 8
62
votes
2 answers

In a single-page app, what is the right way to deal with wrong URLs (404 errors)?

I am currently writing a web application using angularjs, but I think this question applies to any client-side javascript framework that does routing on the client side (as angular does). In a single-page app, what is the right way to deal with…
60
votes
9 answers

Spring catch all route for index.html

I'm developing a spring backend for a react-based single page application where I'm using react-router for client-side routing. Beside the index.html page the backend serves data on the path /api/**. In order to serve my index.html from…
oli
  • 691
  • 1
  • 8
  • 13
54
votes
7 answers

How to disable caching of single page application HTML file served through IIS?

I have a single page application (angular-js) which is served through IIS. How do I prevent caching of HTML files? The solution needs to be achieved by changing content within either index.html or the web.config, as access to IIS through a…
Andrew
  • 5,525
  • 5
  • 36
  • 40
1
2 3
99 100