Understanding the Single Page Application Execution Process

The following steps summarize the single page application (SPA) execution process:

  1. The SPA URL is accessed by clicking a link to the SPA or manually entering the URL in a browser.

  2. The associated SPA server script runs before any client-side code is served to the browser.

    The SPA server script implements and exports the initializeSpa function. This function receives a context parameter object, which contains an API that can modify the response by adding styles.

    The system verifies whether the current user is part of the allowed audience specified in the SPA definition. Next, it runs the initializeSpa function from the SPA server script.

  3. The SPA client script is loaded when the rest of the page elements (that is, the NetSuite center) have finished loading.

    The SPA client script implements and exports the run function, which is the entry point function called when the SPA executes. This function can return a promise or any other type of data.

    The SPA client script loads the root component where the application is initialized.

    The SPA displays a loading icon until the run entry point function returns. If it returns a promise, the SPA displays a loading icon until the promise has been resolved or rejected.

  4. The content of the SPA appears in the browser.

For information about creating SPAs, see Single Page Application Creation And Development.

Related Topics

Introduction to Single Page Applications
NetSuite User Interface Framework for Single Page Applications
Single Page Application Creation And Development
Single Page Application Management

General Notices