@angular/ssr
Advanced tools
Comparing version 19.0.2 to 19.0.3
@@ -39,2 +39,6 @@ import type { ApplicationRef } from '@angular/core'; | ||
/** | ||
* The number of entry points available in the server application's manifest. | ||
*/ | ||
private readonly entryPointsCount; | ||
/** | ||
* A cache that holds entry points, keyed by their potential locale string. | ||
@@ -93,8 +97,8 @@ */ | ||
/** | ||
* A map of entry points for the server application. | ||
* Each entry in the map consists of: | ||
* A readonly record of entry points for the server application. | ||
* Each entry consists of: | ||
* - `key`: The base href for the entry point. | ||
* - `value`: A function that returns a promise resolving to an object of type `EntryPointExports`. | ||
*/ | ||
readonly entryPoints: ReadonlyMap<string, () => Promise<EntryPointExports>>; | ||
readonly entryPoints: Readonly<Record<string, (() => Promise<EntryPointExports>) | undefined>>; | ||
/** | ||
@@ -112,8 +116,13 @@ * The base path for the server application. | ||
/** | ||
* A map of assets required by the server application. | ||
* Each entry in the map consists of: | ||
* The base href for the application. | ||
* This is used to determine the root path of the application. | ||
*/ | ||
readonly baseHref: string; | ||
/** | ||
* A readonly record of assets required by the server application. | ||
* Each entry consists of: | ||
* - `key`: The path of the asset. | ||
* - `value`: A function returning a promise that resolves to the file contents of the asset. | ||
* - `value`: An object of type `ServerAsset`. | ||
*/ | ||
readonly assets: ReadonlyMap<string, ServerAsset>; | ||
readonly assets: Readonly<Record<string, ServerAsset | undefined>>; | ||
/** | ||
@@ -275,9 +284,20 @@ * The bootstrap mechanism for the server application. | ||
/** | ||
* Returns a promise that rejects if the request is aborted. | ||
* Constructs the asset path on the server based on the provided HTTP request. | ||
* | ||
* @param request - The HTTP request object being monitored for abortion. | ||
* @returns A promise that never resolves and rejects with an `AbortError` | ||
* if the request is aborted. | ||
* This method processes the incoming request URL to derive a path corresponding | ||
* to the requested asset. It ensures the path points to the correct file (e.g., | ||
* `index.html`) and removes any base href if it is not part of the asset path. | ||
* | ||
* @param request - The incoming HTTP request object. | ||
* @returns The server-relative asset path derived from the request. | ||
*/ | ||
private waitForRequestAbort; | ||
private buildServerAssetPathFromRequest; | ||
/** | ||
* Runs the registered transform hooks on the given HTML content. | ||
* | ||
* @param html - The raw HTML content to be transformed. | ||
* @param url - The URL associated with the HTML content, used for context during transformations. | ||
* @returns A promise that resolves to the transformed HTML string. | ||
*/ | ||
private runTransformsOnHtml; | ||
} | ||
@@ -701,3 +721,3 @@ | ||
/** | ||
* Represents of a server asset stored in the manifest. | ||
* Represents a server asset stored in the manifest. | ||
*/ | ||
@@ -852,12 +872,14 @@ declare interface ServerAsset { | ||
* | ||
* @param url - The URL for server-side rendering. The URL is used to configure `ServerPlatformLocation`. This configuration is crucial | ||
* for ensuring that API requests for relative paths succeed, which is essential for accurate route extraction. | ||
* See: | ||
* - https://github.com/angular/angular/blob/d608b857c689d17a7ffa33bbb510301014d24a17/packages/platform-server/src/location.ts#L51 | ||
* - https://github.com/angular/angular/blob/6882cc7d9eed26d3caeedca027452367ba25f2b9/packages/platform-server/src/http.ts#L44 | ||
* @param manifest - An optional `AngularAppManifest` that contains the application's routing and configuration details. | ||
* If not provided, the default manifest is retrieved using `getAngularAppManifest()`. | ||
* @param invokeGetPrerenderParams - A boolean flag indicating whether to invoke `getPrerenderParams` for parameterized SSG routes | ||
* to handle prerendering paths. Defaults to `false`. | ||
* @param includePrerenderFallbackRoutes - A flag indicating whether to include fallback routes in the result. Defaults to `true`. | ||
* @param options - An object containing the following options: | ||
* - `url`: The URL for server-side rendering. The URL is used to configure `ServerPlatformLocation`. This configuration is crucial | ||
* for ensuring that API requests for relative paths succeed, which is essential for accurate route extraction. | ||
* See: | ||
* - https://github.com/angular/angular/blob/d608b857c689d17a7ffa33bbb510301014d24a17/packages/platform-server/src/location.ts#L51 | ||
* - https://github.com/angular/angular/blob/6882cc7d9eed26d3caeedca027452367ba25f2b9/packages/platform-server/src/http.ts#L44 | ||
* - `manifest`: An optional `AngularAppManifest` that contains the application's routing and configuration details. | ||
* If not provided, the default manifest is retrieved using `getAngularAppManifest()`. | ||
* - `invokeGetPrerenderParams`: A boolean flag indicating whether to invoke `getPrerenderParams` for parameterized SSG routes | ||
* to handle prerendering paths. Defaults to `false`. | ||
* - `includePrerenderFallbackRoutes`: A flag indicating whether to include fallback routes in the result. Defaults to `true`. | ||
* - `signal`: An optional `AbortSignal` that can be used to abort the operation. | ||
* | ||
@@ -869,3 +891,9 @@ * @returns A promise that resolves to an object containing: | ||
*/ | ||
export declare function ɵextractRoutesAndCreateRouteTree(url: URL, manifest?: AngularAppManifest, invokeGetPrerenderParams?: boolean, includePrerenderFallbackRoutes?: boolean): Promise<{ | ||
export declare function ɵextractRoutesAndCreateRouteTree(options: { | ||
url: URL; | ||
manifest?: AngularAppManifest; | ||
invokeGetPrerenderParams?: boolean; | ||
includePrerenderFallbackRoutes?: boolean; | ||
signal?: AbortSignal; | ||
}): Promise<{ | ||
routeTree: RouteTree; | ||
@@ -872,0 +900,0 @@ appShellRoute?: string; |
@@ -190,4 +190,4 @@ import { ApplicationRef } from '@angular/core'; | ||
*/ | ||
export declare function writeResponseToNodeResponse(source: Response, destination: ServerResponse | Http2ServerResponse<Http2ServerRequest>): Promise<void>; | ||
export declare function writeResponseToNodeResponse(source: Response, destination: ServerResponse | Http2ServerResponse): Promise<void>; | ||
export { } |
{ | ||
"name": "@angular/ssr", | ||
"version": "19.0.2", | ||
"version": "19.0.3", | ||
"description": "Angular server side rendering utilities", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1628225
14929