@angular/ssr 19.0.2 → 19.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/node.mjs.map +1 -1
- package/fesm2022/ssr.mjs +123 -66
- package/fesm2022/ssr.mjs.map +1 -1
- package/index.d.ts +52 -26
- package/node/index.d.ts +1 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -35,6 +35,10 @@ export declare class AngularAppEngine {
|
|
|
35
35
|
* The manifest for the server application.
|
|
36
36
|
*/
|
|
37
37
|
private readonly manifest;
|
|
38
|
+
/**
|
|
39
|
+
* The number of entry points available in the server application's manifest.
|
|
40
|
+
*/
|
|
41
|
+
private readonly entryPointsCount;
|
|
38
42
|
/**
|
|
39
43
|
* A cache that holds entry points, keyed by their potential locale string.
|
|
40
44
|
*/
|
|
@@ -89,12 +93,12 @@ export declare class AngularAppEngine {
|
|
|
89
93
|
*/
|
|
90
94
|
declare interface AngularAppEngineManifest {
|
|
91
95
|
/**
|
|
92
|
-
* A
|
|
93
|
-
* Each entry
|
|
96
|
+
* A readonly record of entry points for the server application.
|
|
97
|
+
* Each entry consists of:
|
|
94
98
|
* - `key`: The base href for the entry point.
|
|
95
99
|
* - `value`: A function that returns a promise resolving to an object of type `EntryPointExports`.
|
|
96
100
|
*/
|
|
97
|
-
readonly entryPoints:
|
|
101
|
+
readonly entryPoints: Readonly<Record<string, (() => Promise<EntryPointExports>) | undefined>>;
|
|
98
102
|
/**
|
|
99
103
|
* The base path for the server application.
|
|
100
104
|
* This is used to determine the root path of the application.
|
|
@@ -107,12 +111,17 @@ declare interface AngularAppEngineManifest {
|
|
|
107
111
|
*/
|
|
108
112
|
declare interface AngularAppManifest {
|
|
109
113
|
/**
|
|
110
|
-
*
|
|
111
|
-
*
|
|
114
|
+
* The base href for the application.
|
|
115
|
+
* This is used to determine the root path of the application.
|
|
116
|
+
*/
|
|
117
|
+
readonly baseHref: string;
|
|
118
|
+
/**
|
|
119
|
+
* A readonly record of assets required by the server application.
|
|
120
|
+
* Each entry consists of:
|
|
112
121
|
* - `key`: The path of the asset.
|
|
113
|
-
* - `value`:
|
|
122
|
+
* - `value`: An object of type `ServerAsset`.
|
|
114
123
|
*/
|
|
115
|
-
readonly assets:
|
|
124
|
+
readonly assets: Readonly<Record<string, ServerAsset | undefined>>;
|
|
116
125
|
/**
|
|
117
126
|
* The bootstrap mechanism for the server application.
|
|
118
127
|
* A function that returns a promise that resolves to an `NgModule` or a function
|
|
@@ -269,13 +278,24 @@ declare class AngularServerApp {
|
|
|
269
278
|
*/
|
|
270
279
|
private handleRendering;
|
|
271
280
|
/**
|
|
272
|
-
*
|
|
281
|
+
* Constructs the asset path on the server based on the provided HTTP request.
|
|
273
282
|
*
|
|
274
|
-
*
|
|
275
|
-
*
|
|
276
|
-
* if the
|
|
283
|
+
* This method processes the incoming request URL to derive a path corresponding
|
|
284
|
+
* to the requested asset. It ensures the path points to the correct file (e.g.,
|
|
285
|
+
* `index.html`) and removes any base href if it is not part of the asset path.
|
|
286
|
+
*
|
|
287
|
+
* @param request - The incoming HTTP request object.
|
|
288
|
+
* @returns The server-relative asset path derived from the request.
|
|
277
289
|
*/
|
|
278
|
-
private
|
|
290
|
+
private buildServerAssetPathFromRequest;
|
|
291
|
+
/**
|
|
292
|
+
* Runs the registered transform hooks on the given HTML content.
|
|
293
|
+
*
|
|
294
|
+
* @param html - The raw HTML content to be transformed.
|
|
295
|
+
* @param url - The URL associated with the HTML content, used for context during transformations.
|
|
296
|
+
* @returns A promise that resolves to the transformed HTML string.
|
|
297
|
+
*/
|
|
298
|
+
private runTransformsOnHtml;
|
|
279
299
|
}
|
|
280
300
|
|
|
281
301
|
/**
|
|
@@ -473,8 +493,6 @@ export declare enum PrerenderFallback {
|
|
|
473
493
|
* @param options - (Optional) An object containing additional configuration options for server routes.
|
|
474
494
|
* @returns An `EnvironmentProviders` instance with the server routes configuration.
|
|
475
495
|
*
|
|
476
|
-
* @returns An `EnvironmentProviders` object that contains the server routes configuration.
|
|
477
|
-
*
|
|
478
496
|
* @see {@link ServerRoute}
|
|
479
497
|
* @see {@link ServerRoutesConfigOptions}
|
|
480
498
|
* @developerPreview
|
|
@@ -694,7 +712,7 @@ declare type RouteTreeNodeMetadataWithoutRoute = Omit<RouteTreeNodeMetadata, 'ro
|
|
|
694
712
|
declare type SerializableRouteTreeNode = ReadonlyArray<RouteTreeNodeMetadata>;
|
|
695
713
|
|
|
696
714
|
/**
|
|
697
|
-
* Represents
|
|
715
|
+
* Represents a server asset stored in the manifest.
|
|
698
716
|
*/
|
|
699
717
|
declare interface ServerAsset {
|
|
700
718
|
/**
|
|
@@ -844,23 +862,31 @@ export declare function ɵdestroyAngularServerApp(): void;
|
|
|
844
862
|
* Asynchronously extracts routes from the Angular application configuration
|
|
845
863
|
* and creates a `RouteTree` to manage server-side routing.
|
|
846
864
|
*
|
|
847
|
-
* @param
|
|
848
|
-
*
|
|
849
|
-
*
|
|
850
|
-
*
|
|
851
|
-
*
|
|
852
|
-
*
|
|
853
|
-
*
|
|
854
|
-
*
|
|
855
|
-
*
|
|
856
|
-
*
|
|
865
|
+
* @param options - An object containing the following options:
|
|
866
|
+
* - `url`: The URL for server-side rendering. The URL is used to configure `ServerPlatformLocation`. This configuration is crucial
|
|
867
|
+
* for ensuring that API requests for relative paths succeed, which is essential for accurate route extraction.
|
|
868
|
+
* See:
|
|
869
|
+
* - https://github.com/angular/angular/blob/d608b857c689d17a7ffa33bbb510301014d24a17/packages/platform-server/src/location.ts#L51
|
|
870
|
+
* - https://github.com/angular/angular/blob/6882cc7d9eed26d3caeedca027452367ba25f2b9/packages/platform-server/src/http.ts#L44
|
|
871
|
+
* - `manifest`: An optional `AngularAppManifest` that contains the application's routing and configuration details.
|
|
872
|
+
* If not provided, the default manifest is retrieved using `getAngularAppManifest()`.
|
|
873
|
+
* - `invokeGetPrerenderParams`: A boolean flag indicating whether to invoke `getPrerenderParams` for parameterized SSG routes
|
|
874
|
+
* to handle prerendering paths. Defaults to `false`.
|
|
875
|
+
* - `includePrerenderFallbackRoutes`: A flag indicating whether to include fallback routes in the result. Defaults to `true`.
|
|
876
|
+
* - `signal`: An optional `AbortSignal` that can be used to abort the operation.
|
|
857
877
|
*
|
|
858
878
|
* @returns A promise that resolves to an object containing:
|
|
859
879
|
* - `routeTree`: A populated `RouteTree` containing all extracted routes from the Angular application.
|
|
860
880
|
* - `appShellRoute`: The specified route for the app-shell, if configured.
|
|
861
881
|
* - `errors`: An array of strings representing any errors encountered during the route extraction process.
|
|
862
882
|
*/
|
|
863
|
-
export declare function ɵextractRoutesAndCreateRouteTree(
|
|
883
|
+
export declare function ɵextractRoutesAndCreateRouteTree(options: {
|
|
884
|
+
url: URL;
|
|
885
|
+
manifest?: AngularAppManifest;
|
|
886
|
+
invokeGetPrerenderParams?: boolean;
|
|
887
|
+
includePrerenderFallbackRoutes?: boolean;
|
|
888
|
+
signal?: AbortSignal;
|
|
889
|
+
}): Promise<{
|
|
864
890
|
routeTree: RouteTree;
|
|
865
891
|
appShellRoute?: string;
|
|
866
892
|
errors: string[];
|
package/node/index.d.ts
CHANGED
|
@@ -187,6 +187,6 @@ export declare type NodeRequestHandlerFunction = (req: IncomingMessage, res: Ser
|
|
|
187
187
|
* @returns A promise that resolves once the streaming operation is complete.
|
|
188
188
|
* @developerPreview
|
|
189
189
|
*/
|
|
190
|
-
export declare function writeResponseToNodeResponse(source: Response, destination: ServerResponse | Http2ServerResponse
|
|
190
|
+
export declare function writeResponseToNodeResponse(source: Response, destination: ServerResponse | Http2ServerResponse): Promise<void>;
|
|
191
191
|
|
|
192
192
|
export { }
|