@angular/ssr 21.0.0-next.4 → 21.0.0-next.6

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.0.0-next.4",
3
+ "version": "21.0.0-next.6",
4
4
  "description": "Angular server side rendering utilities",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -29,12 +29,12 @@
29
29
  },
30
30
  "devDependencies": {
31
31
  "@angular-devkit/schematics": "workspace:*",
32
- "@angular/common": "21.0.0-next.3",
33
- "@angular/compiler": "21.0.0-next.3",
34
- "@angular/core": "21.0.0-next.3",
35
- "@angular/platform-browser": "21.0.0-next.3",
36
- "@angular/platform-server": "21.0.0-next.3",
37
- "@angular/router": "21.0.0-next.3",
32
+ "@angular/common": "21.0.0-next.5",
33
+ "@angular/compiler": "21.0.0-next.5",
34
+ "@angular/core": "21.0.0-next.5",
35
+ "@angular/platform-browser": "21.0.0-next.5",
36
+ "@angular/platform-server": "21.0.0-next.5",
37
+ "@angular/router": "21.0.0-next.5",
38
38
  "@schematics/angular": "workspace:*",
39
39
  "beasties": "0.3.5"
40
40
  },
@@ -45,17 +45,17 @@
45
45
  "url": "https://github.com/angular/angular-cli.git"
46
46
  },
47
47
  "module": "./fesm2022/ssr.mjs",
48
- "typings": "./index.d.ts",
48
+ "typings": "./types/ssr.d.ts",
49
49
  "exports": {
50
50
  "./package.json": {
51
51
  "default": "./package.json"
52
52
  },
53
53
  ".": {
54
- "types": "./index.d.ts",
54
+ "types": "./types/ssr.d.ts",
55
55
  "default": "./fesm2022/ssr.mjs"
56
56
  },
57
57
  "./node": {
58
- "types": "./node/index.d.ts",
58
+ "types": "./types/node.d.ts",
59
59
  "default": "./fesm2022/node.mjs"
60
60
  }
61
61
  }
@@ -118,7 +118,7 @@ type NodeRequestHandlerFunction = (req: IncomingMessage, res: ServerResponse, ne
118
118
  * } catch (error) {
119
119
  * next(error);
120
120
  * }
121
- * }));
121
+ * });
122
122
  * ```
123
123
  *
124
124
  * @example
@@ -128,8 +128,7 @@ type NodeRequestHandlerFunction = (req: IncomingMessage, res: ServerResponse, ne
128
128
  * export default createNodeRequestHandler(async (req, res) => {
129
129
  * await app.ready();
130
130
  * app.server.emit('request', req, res);
131
- * res.send('Hello from Fastify with Node Next Handler!');
132
- * }));
131
+ * });
133
132
  * ```
134
133
  */
135
134
  declare function createNodeRequestHandler<T extends NodeRequestHandlerFunction>(handler: T): T;
@@ -786,11 +786,10 @@ declare class AngularServerApp {
786
786
  */
787
787
  private readonly textDecoder;
788
788
  /**
789
- * Cache for storing critical CSS for pages.
790
- * Stores a maximum of MAX_INLINE_CSS_CACHE_ENTRIES entries.
789
+ * A cache that stores critical CSS to avoid re-processing for every request, improving performance.
790
+ * This cache uses a Least Recently Used (LRU) eviction policy.
791
791
  *
792
- * Uses an LRU (Least Recently Used) eviction policy, meaning that when the cache is full,
793
- * the least recently accessed page's critical CSS will be removed to make space for new entries.
792
+ * @see {@link MAX_INLINE_CSS_CACHE_ENTRIES} for the maximum number of entries this cache can hold.
794
793
  */
795
794
  private readonly criticalCssLRUCache;
796
795
  /**
@@ -812,7 +811,6 @@ declare class AngularServerApp {
812
811
  *
813
812
  * @param request - The incoming HTTP request for serving a static page.
814
813
  * @param matchedRoute - The metadata of the matched route for rendering.
815
- * If not provided, the method attempts to find a matching route based on the request URL.
816
814
  * @returns A promise that resolves to a `Response` object if the prerendered page is found, or `null`.
817
815
  */
818
816
  private handleServe;
@@ -822,12 +820,28 @@ declare class AngularServerApp {
822
820
  *
823
821
  * @param request - The incoming HTTP request to be processed.
824
822
  * @param matchedRoute - The metadata of the matched route for rendering.
825
- * If not provided, the method attempts to find a matching route based on the request URL.
826
823
  * @param requestContext - Optional additional context for rendering, such as request metadata.
827
824
  *
828
825
  * @returns A promise that resolves to the rendered response, or null if no matching route is found.
829
826
  */
830
827
  private handleRendering;
828
+ /**
829
+ * Inlines critical CSS into the given HTML content.
830
+ *
831
+ * @param html The HTML content to process.
832
+ * @param url The URL associated with the request, for logging purposes.
833
+ * @returns A promise that resolves to the HTML with inlined critical CSS.
834
+ */
835
+ private inlineCriticalCss;
836
+ /**
837
+ * Inlines critical CSS into the given HTML content.
838
+ * This method uses a cache to avoid reprocessing the same HTML content multiple times.
839
+ *
840
+ * @param html The HTML content to process.
841
+ * @param url The URL associated with the request, for logging purposes.
842
+ * @returns A promise that resolves to the HTML with inlined critical CSS.
843
+ */
844
+ private inlineCriticalCssWithCache;
831
845
  /**
832
846
  * Constructs the asset path on the server based on the provided HTTP request.
833
847
  *