Dynamic Route Loading in Single-Page Applications

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Single-page applications (SPAs) face challenges with lengthy loading times and cumbersome development due to the need for a single route handler to access all possible routes and dependencies at loading time, which can be inefficient and difficult to manage, especially in large applications with multiple development teams.

Innovation Solution

Implementing a route handler that dynamically loads routes and dependency information on a client device, where the route handler initially lacks access to all routes, and upon receiving an unknown route request, sends a request to a server to retrieve the necessary route and dependency information, allowing for efficient loading of modules as needed.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Loss of time

If a single route handler includes all possible routes and dependencies at loading time, then page refresh is avoided and time to page view is minimal, but the loading time and memory footprint of the SPA become significant

Engineering Contradiction:
Improvetime to page viewVSAvoidloading time and memory footprint
Core Design Contradiction:
Loss of timeVSQuantity of substance

Solution Approach 1:

The route handler transitions from a static structure (including all routes at loading time) to a dynamic structure that loads routes on-demand. The system dynamically determines which routes to load based on actual user navigation needs, allowing the application to maintain fast page view times while reducing initial loading requirements.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

Routes and their dependencies are extracted from the initial SPA bundle and loaded separately when needed. Instead of including all routes upfront, the system extracts only the necessary routes based on user actions, reducing the initial memory footprint and loading time while maintaining quick access to frequently used routes.

Inventive Principle:
Principle #2Taking out (Extraction)

2Ease of operation

If a single route handler has access to all routes and dependencies at loading time, then the SPA provides fluid navigation, but developing and maintaining the route handler becomes cumbersome for large applications

Engineering Contradiction:
Improvefluid navigationVSAvoiddevelopment and maintenance complexity
Core Design Contradiction:
Ease of operationVSEase of manufacture

Solution Approach 1:

The monolithic route handler is segmented into multiple modular route handlers, each responsible for specific routes. This segmentation allows different development teams to work on different route modules independently, reducing complexity while maintaining the ability to provide fluid navigation across the entire application through coordinated route loading.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

A universal route loading mechanism is created that can handle multiple route types and dependencies through a common interface. This multi-functional system manages both simple and complex routes uniformly, reducing development complexity while preserving fluid navigation capabilities across diverse route scenarios.

Inventive Principle:
Principle #6Universality (Multi-functionality)

3Ease of manufacture

If separate route handlers are developed for each module, then development complexity is reduced, but users cannot access all modules associated with the SPA

Engineering Contradiction:
Improvedevelopment complexityVSAvoidmodule accessibility
Core Design Contradiction:
Ease of manufactureVSAdaptability or versatility

Solution Approach 1:

Multiple separate route handlers are merged into a unified route management system that maintains the modular benefits of separate handlers while providing global access to all routes. The system combines individual module route handlers with a central coordination layer that enables cross-module navigation, preserving both development simplicity and application versatility.

Inventive Principle:
Principle #5Merging (Combining)

Solution Approach 2:

An intermediary route management layer is introduced between individual module route handlers and the user interface. This mediator coordinates route loading across modules, allowing users to access any module in the SPA while maintaining the development simplicity of separate route handlers through a standardized interface.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS9967309B2Dynamic loading of routes in a single-page application
Publication Date: 2018.05.08 MICROSOFT TECHNOLOGY LICENSING LLC
  • US9967309B2 patent drawing
  • US9967309B2 patent drawing
  • US9967309B2 patent drawing

AI summary

Techniques for dynamically loading route and dependency information in a single-page application (SPA) that executes on a client device are provided. In one technique, a SPA includes a route handler that receives a requested route. The route handler determines whether the requested route matches any route in a list of routes. The only route that the request route may “match” is a wildcard route, which is associated with a function, when called with the requested route as input, causes a server request to be generated and transmitted from the client device to a server. The server responds with the requested route, dependency information for the requested route, and, optionally, one or more other routes, which may be “child” routes of the requested route. A module instance is generated based on the dependency information and loaded into the SPA.