Understanding the Single Page Application Execution Process
The following steps summarize the single page application (SPA) execution process:
-
You can access the SPA by clicking a link or by typing the URL in your browser.
-
The SPA server script runs before any client-side code goes to the browser.
The SPA server script implements and exports the
initializeSpa
function, which receives a context object with an API that can modify the response by adding styles.The system checks if the user is in the allowed audience set in the SPA definition, then runs the
initializeSpa
function from the SPA server script. -
The SPA client script loads after the rest of the page elements (like the NetSuite center) finish loading.
The SPA client script implements and exports the
run
function, which acts as the SPA's entry point and can return a promise or any other type of data.The SPA client script loads the root component to initialize the application.
The SPA shows a loading icon until the
run
function returns. If it returns a promise, the icon stays until the promise is resolved or rejected. -
The SPA content appears in the browser.
For information about creating SPAs, see Single Page Application Creation And Development.