@angular/ssr 19.0.2 → 19.0.3

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/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 map of entry points for the server application.
93
- * Each entry in the map consists of:
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: ReadonlyMap<string, () => Promise<EntryPointExports>>;
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
- * A map of assets required by the server application.
111
- * Each entry in the map consists of:
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`: A function returning a promise that resolves to the file contents of the asset.
122
+ * - `value`: An object of type `ServerAsset`.
114
123
  */
115
- readonly assets: ReadonlyMap<string, ServerAsset>;
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
- * Returns a promise that rejects if the request is aborted.
281
+ * Constructs the asset path on the server based on the provided HTTP request.
282
+ *
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.
289
+ */
290
+ private buildServerAssetPathFromRequest;
291
+ /**
292
+ * Runs the registered transform hooks on the given HTML content.
273
293
  *
274
- * @param request - The HTTP request object being monitored for abortion.
275
- * @returns A promise that never resolves and rejects with an `AbortError`
276
- * if the request is aborted.
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.
277
297
  */
278
- private waitForRequestAbort;
298
+ private runTransformsOnHtml;
279
299
  }
280
300
 
281
301
  /**
@@ -694,7 +714,7 @@ declare type RouteTreeNodeMetadataWithoutRoute = Omit<RouteTreeNodeMetadata, 'ro
694
714
  declare type SerializableRouteTreeNode = ReadonlyArray<RouteTreeNodeMetadata>;
695
715
 
696
716
  /**
697
- * Represents of a server asset stored in the manifest.
717
+ * Represents a server asset stored in the manifest.
698
718
  */
699
719
  declare interface ServerAsset {
700
720
  /**
@@ -844,23 +864,31 @@ export declare function ɵdestroyAngularServerApp(): void;
844
864
  * Asynchronously extracts routes from the Angular application configuration
845
865
  * and creates a `RouteTree` to manage server-side routing.
846
866
  *
847
- * @param url - The URL for server-side rendering. The URL is used to configure `ServerPlatformLocation`. This configuration is crucial
848
- * for ensuring that API requests for relative paths succeed, which is essential for accurate route extraction.
849
- * See:
850
- * - https://github.com/angular/angular/blob/d608b857c689d17a7ffa33bbb510301014d24a17/packages/platform-server/src/location.ts#L51
851
- * - https://github.com/angular/angular/blob/6882cc7d9eed26d3caeedca027452367ba25f2b9/packages/platform-server/src/http.ts#L44
852
- * @param manifest - An optional `AngularAppManifest` that contains the application's routing and configuration details.
853
- * If not provided, the default manifest is retrieved using `getAngularAppManifest()`.
854
- * @param invokeGetPrerenderParams - A boolean flag indicating whether to invoke `getPrerenderParams` for parameterized SSG routes
855
- * to handle prerendering paths. Defaults to `false`.
856
- * @param includePrerenderFallbackRoutes - A flag indicating whether to include fallback routes in the result. Defaults to `true`.
867
+ * @param options - An object containing the following options:
868
+ * - `url`: The URL for server-side rendering. The URL is used to configure `ServerPlatformLocation`. This configuration is crucial
869
+ * for ensuring that API requests for relative paths succeed, which is essential for accurate route extraction.
870
+ * See:
871
+ * - https://github.com/angular/angular/blob/d608b857c689d17a7ffa33bbb510301014d24a17/packages/platform-server/src/location.ts#L51
872
+ * - https://github.com/angular/angular/blob/6882cc7d9eed26d3caeedca027452367ba25f2b9/packages/platform-server/src/http.ts#L44
873
+ * - `manifest`: An optional `AngularAppManifest` that contains the application's routing and configuration details.
874
+ * If not provided, the default manifest is retrieved using `getAngularAppManifest()`.
875
+ * - `invokeGetPrerenderParams`: A boolean flag indicating whether to invoke `getPrerenderParams` for parameterized SSG routes
876
+ * to handle prerendering paths. Defaults to `false`.
877
+ * - `includePrerenderFallbackRoutes`: A flag indicating whether to include fallback routes in the result. Defaults to `true`.
878
+ * - `signal`: An optional `AbortSignal` that can be used to abort the operation.
857
879
  *
858
880
  * @returns A promise that resolves to an object containing:
859
881
  * - `routeTree`: A populated `RouteTree` containing all extracted routes from the Angular application.
860
882
  * - `appShellRoute`: The specified route for the app-shell, if configured.
861
883
  * - `errors`: An array of strings representing any errors encountered during the route extraction process.
862
884
  */
863
- export declare function ɵextractRoutesAndCreateRouteTree(url: URL, manifest?: AngularAppManifest, invokeGetPrerenderParams?: boolean, includePrerenderFallbackRoutes?: boolean): Promise<{
885
+ export declare function ɵextractRoutesAndCreateRouteTree(options: {
886
+ url: URL;
887
+ manifest?: AngularAppManifest;
888
+ invokeGetPrerenderParams?: boolean;
889
+ includePrerenderFallbackRoutes?: boolean;
890
+ signal?: AbortSignal;
891
+ }): Promise<{
864
892
  routeTree: RouteTree;
865
893
  appShellRoute?: string;
866
894
  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<Http2ServerRequest>): Promise<void>;
190
+ export declare function writeResponseToNodeResponse(source: Response, destination: ServerResponse | Http2ServerResponse): Promise<void>;
191
191
 
192
192
  export { }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/ssr",
3
- "version": "19.0.2",
3
+ "version": "19.0.3",
4
4
  "description": "Angular server side rendering utilities",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/angular/angular-cli",