@angular/ssr 21.2.0 → 22.0.0-next.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/ssr",
3
- "version": "21.2.0",
3
+ "version": "22.0.0-next.0",
4
4
  "description": "Angular server side rendering utilities",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -17,10 +17,10 @@
17
17
  "tslib": "^2.3.0"
18
18
  },
19
19
  "peerDependencies": {
20
- "@angular/common": "^21.0.0",
21
- "@angular/core": "^21.0.0",
22
- "@angular/platform-server": "^21.0.0",
23
- "@angular/router": "^21.0.0"
20
+ "@angular/common": "^22.0.0-next.0",
21
+ "@angular/core": "^22.0.0-next.0",
22
+ "@angular/platform-server": "^22.0.0-next.0",
23
+ "@angular/router": "^22.0.0-next.0"
24
24
  },
25
25
  "peerDependenciesMeta": {
26
26
  "@angular/platform-server": {
@@ -29,12 +29,12 @@
29
29
  },
30
30
  "devDependencies": {
31
31
  "@angular-devkit/schematics": "workspace:*",
32
- "@angular/common": "21.2.0",
33
- "@angular/compiler": "21.2.0",
34
- "@angular/core": "21.2.0",
35
- "@angular/platform-browser": "21.2.0",
36
- "@angular/platform-server": "21.2.0",
37
- "@angular/router": "21.2.0",
32
+ "@angular/common": "22.0.0-next.0",
33
+ "@angular/compiler": "22.0.0-next.0",
34
+ "@angular/core": "22.0.0-next.0",
35
+ "@angular/platform-browser": "22.0.0-next.0",
36
+ "@angular/platform-server": "22.0.0-next.0",
37
+ "@angular/router": "22.0.0-next.0",
38
38
  "@schematics/angular": "workspace:*",
39
39
  "beasties": "0.4.1"
40
40
  },
@@ -42,7 +42,7 @@
42
42
  "schematics": "./schematics/collection.json",
43
43
  "repository": {
44
44
  "type": "git",
45
- "url": "https://github.com/angular/angular-cli.git"
45
+ "url": "git+https://github.com/angular/angular-cli.git"
46
46
  },
47
47
  "module": "./fesm2022/ssr.mjs",
48
48
  "typings": "./types/ssr.d.ts",
@@ -86,6 +86,14 @@ declare class AngularAppEngine {
86
86
  * @private
87
87
  */
88
88
  static ɵallowStaticRouteRender: boolean;
89
+ /**
90
+ * A flag to enable or disable the allowed hosts check.
91
+ *
92
+ * Typically used during development to avoid the allowed hosts check.
93
+ *
94
+ * @private
95
+ */
96
+ static ɵdisableAllowedHostsCheck: boolean;
89
97
  /**
90
98
  * Hooks for extending or modifying the behavior of the server application.
91
99
  * These hooks are used by the Angular CLI when running the development server and
@@ -129,8 +137,8 @@ declare class AngularAppEngine {
129
137
  * @remarks
130
138
  * To prevent potential Server-Side Request Forgery (SSRF), this function verifies the hostname
131
139
  * of the `request.url` against a list of authorized hosts.
132
- * If the hostname is not recognized and `allowedHosts` is not empty, a Client-Side Rendered (CSR) version of the
133
- * page is returned otherwise a 400 Bad Request is returned.
140
+ * If the hostname is not recognized a 400 Bad Request is returned.
141
+ *
134
142
  * Resolution:
135
143
  * Authorize your hostname by configuring `allowedHosts` in `angular.json` in:
136
144
  * `projects.[project-name].architect.build.options.security.allowedHosts`.
@@ -182,10 +190,9 @@ declare class AngularAppEngine {
182
190
  /**
183
191
  * Handles validation errors by logging the error and returning an appropriate response.
184
192
  *
193
+ * @param url - The URL of the request.
185
194
  * @param error - The validation error to handle.
186
- * @param request - The HTTP request that caused the validation error.
187
- * @returns A promise that resolves to a `Response` object with a 400 status code if allowed hosts are configured,
188
- * or `null` if allowed hosts are not configured (in which case the request is served client-side).
195
+ * @returns A `Response` object with a 400 status code.
189
196
  */
190
197
  private handleValidationError;
191
198
  }
package/types/node.d.ts CHANGED
@@ -92,8 +92,7 @@ declare class AngularNodeAppEngine {
92
92
  * @remarks
93
93
  * To prevent potential Server-Side Request Forgery (SSRF), this function verifies the hostname
94
94
  * of the `request.url` against a list of authorized hosts.
95
- * If the hostname is not recognized and `allowedHosts` is not empty, a Client-Side Rendered (CSR) version of the
96
- * page is returned otherwise a 400 Bad Request is returned.
95
+ * If the hostname is not recognized a 400 Bad Request is returned.
97
96
  *
98
97
  * Resolution:
99
98
  * Authorize your hostname by configuring `allowedHosts` in `angular.json` in:
package/types/ssr.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Type, EnvironmentProviders, Provider, ApplicationRef } from '@angular/core';
1
+ import { Type, EnvironmentProviders, Provider, ApplicationRef, InjectionToken } from '@angular/core';
2
2
  import { DefaultExport } from '@angular/router';
3
3
  import { BootstrapContext } from '@angular/platform-browser';
4
4
  import { Hooks } from './_app-engine-chunk.js';
@@ -571,6 +571,15 @@ declare function setAngularAppManifest(manifest: AngularAppManifest): void;
571
571
  */
572
572
  declare function setAngularAppEngineManifest(manifest: AngularAppEngineManifest): void;
573
573
 
574
+ /**
575
+ * A DI token that indicates whether the application is in the process of discovering routes.
576
+ *
577
+ * This token is provided with the value `true` when route discovery is active, allowing other
578
+ * parts of the application to conditionally execute logic. For example, it can be used to
579
+ * disable features or behaviors that are not necessary or might interfere with the route
580
+ * discovery process.
581
+ */
582
+ declare const IS_DISCOVERING_ROUTES: InjectionToken<boolean>;
574
583
  /**
575
584
  * Result of extracting routes from an Angular application.
576
585
  */
@@ -908,5 +917,5 @@ type RequestHandlerFunction = (request: Request) => Promise<Response | null> | n
908
917
  */
909
918
  declare function createRequestHandler(handler: RequestHandlerFunction): RequestHandlerFunction;
910
919
 
911
- export { PrerenderFallback, RenderMode, createRequestHandler, provideServerRendering, withAppShell, withRoutes, InlineCriticalCssProcessor as ɵInlineCriticalCssProcessor, destroyAngularServerApp as ɵdestroyAngularServerApp, extractRoutesAndCreateRouteTree as ɵextractRoutesAndCreateRouteTree, getOrCreateAngularServerApp as ɵgetOrCreateAngularServerApp, getRoutesFromAngularRouterConfig as ɵgetRoutesFromAngularRouterConfig, setAngularAppEngineManifest as ɵsetAngularAppEngineManifest, setAngularAppManifest as ɵsetAngularAppManifest };
920
+ export { IS_DISCOVERING_ROUTES, PrerenderFallback, RenderMode, createRequestHandler, provideServerRendering, withAppShell, withRoutes, InlineCriticalCssProcessor as ɵInlineCriticalCssProcessor, destroyAngularServerApp as ɵdestroyAngularServerApp, extractRoutesAndCreateRouteTree as ɵextractRoutesAndCreateRouteTree, getOrCreateAngularServerApp as ɵgetOrCreateAngularServerApp, getRoutesFromAngularRouterConfig as ɵgetRoutesFromAngularRouterConfig, setAngularAppEngineManifest as ɵsetAngularAppEngineManifest, setAngularAppManifest as ɵsetAngularAppManifest };
912
921
  export type { RequestHandlerFunction, ServerRoute, ServerRouteClient, ServerRouteCommon, ServerRoutePrerender, ServerRoutePrerenderWithParams, ServerRouteServer };