Skip to content

Commit cdfc50c

Browse files
committedMar 13, 2025
feat(@angular/ssr): stabilize AngularNodeAppEngine, AngularAppEngine, and provideServerRouting APIs
This commit promotes the `AngularNodeAppEngine`, `AngularAppEngine`, and `provideServerRouting` APIs from dev preview to stable. These APIs enhance server-side rendering (SSR) capabilities in Angular applications, improving routing and server integration for better performance and reliability.
1 parent b9591eb commit cdfc50c

File tree

8 files changed

+0
-22
lines changed

8 files changed

+0
-22
lines changed
 

‎packages/angular/ssr/node/src/app-engine.ts

-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ import { createWebRequestFromNodeRequest } from './request';
1818
*
1919
* @remarks This class should be instantiated once and used as a singleton across the server-side
2020
* application to ensure consistent handling of rendering requests and resource management.
21-
*
22-
* @developerPreview
2321
*/
2422
export class AngularNodeAppEngine {
2523
private readonly angularAppEngine = new AngularAppEngine();

‎packages/angular/ssr/node/src/handler.ts

-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import type { IncomingMessage, ServerResponse } from 'node:http';
1616
* @param next - A callback function that signals the completion of the middleware or forwards the error if provided.
1717
*
1818
* @returns A Promise that resolves to void or simply void. The handler can be asynchronous.
19-
* @developerPreview
2019
*/
2120
export type NodeRequestHandlerFunction = (
2221
req: IncomingMessage,
@@ -66,7 +65,6 @@ export type NodeRequestHandlerFunction = (
6665
* res.send('Hello from Fastify with Node Next Handler!');
6766
* }));
6867
* ```
69-
* @developerPreview
7068
*/
7169
export function createNodeRequestHandler<T extends NodeRequestHandlerFunction>(handler: T): T {
7270
(handler as T & { __ng_node_request_handler__?: boolean })['__ng_node_request_handler__'] = true;

‎packages/angular/ssr/node/src/module.ts

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import { fileURLToPath } from 'node:url';
2323
*
2424
* @param url The URL of the module to check. This should typically be `import.meta.url`.
2525
* @returns `true` if the provided URL represents the main entry point, otherwise `false`.
26-
* @developerPreview
2726
*/
2827
export function isMainModule(url: string): boolean {
2928
return url.startsWith('file:') && argv[1] === fileURLToPath(url);

‎packages/angular/ssr/node/src/request.ts

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ const HTTP2_PSEUDO_HEADERS = new Set([':method', ':scheme', ':authority', ':path
2727
*
2828
* @param nodeRequest - The Node.js request object (`IncomingMessage` or `Http2ServerRequest`) to convert.
2929
* @returns A Web Standard `Request` object.
30-
* @developerPreview
3130
*/
3231
export function createWebRequestFromNodeRequest(
3332
nodeRequest: IncomingMessage | Http2ServerRequest,

‎packages/angular/ssr/node/src/response.ts

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import type { Http2ServerResponse } from 'node:http2';
1919
* @param source - The web-standard `Response` object to stream from.
2020
* @param destination - The Node.js response object (`ServerResponse` or `Http2ServerResponse`) to stream into.
2121
* @returns A promise that resolves once the streaming operation is complete.
22-
* @developerPreview
2322
*/
2423
export async function writeResponseToNodeResponse(
2524
source: Response,

‎packages/angular/ssr/src/app-engine.ts

-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ import { joinUrlParts } from './utils/url';
1919
*
2020
* @remarks This class should be instantiated once and used as a singleton across the server-side
2121
* application to ensure consistent handling of rendering requests and resource management.
22-
*
23-
* @developerPreview
2422
*/
2523
export class AngularAppEngine {
2624
/**

‎packages/angular/ssr/src/handler.ts

-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
* @param request - The incoming HTTP request object.
1313
* @returns A Promise resolving to a `Response` object, `null`, or directly a `Response`,
1414
* supporting both synchronous and asynchronous handling.
15-
* @developerPreview
1615
*/
1716
export type RequestHandlerFunction = (
1817
request: Request,
@@ -39,7 +38,6 @@ export type RequestHandlerFunction = (
3938
* const handler = toWebHandler(app);
4039
* export default createRequestHandler(handler);
4140
* ```
42-
* @developerPreview
4341
*/
4442
export function createRequestHandler(handler: RequestHandlerFunction): RequestHandlerFunction {
4543
(handler as RequestHandlerFunction & { __ng_request_handler__?: boolean })[

‎packages/angular/ssr/src/routes/route-config.ts

-11
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ const APP_SHELL_ROUTE = 'ng-app-shell';
2424
/**
2525
* Identifies a particular kind of `ServerRoutesFeatureKind`.
2626
* @see {@link ServerRoutesFeature}
27-
* @developerPreview
2827
*/
2928
enum ServerRoutesFeatureKind {
3029
AppShell,
@@ -33,7 +32,6 @@ enum ServerRoutesFeatureKind {
3332
/**
3433
* Helper type to represent a server routes feature.
3534
* @see {@link ServerRoutesFeatureKind}
36-
* @developerPreview
3735
*/
3836
interface ServerRoutesFeature<FeatureKind extends ServerRoutesFeatureKind> {
3937
ɵkind: FeatureKind;
@@ -44,7 +42,6 @@ interface ServerRoutesFeature<FeatureKind extends ServerRoutesFeatureKind> {
4442
* Different rendering modes for server routes.
4543
* @see {@link provideServerRouting}
4644
* @see {@link ServerRoute}
47-
* @developerPreview
4845
*/
4946
export enum RenderMode {
5047
/** Server-Side Rendering (SSR) mode, where content is rendered on the server for each request. */
@@ -61,7 +58,6 @@ export enum RenderMode {
6158
* Defines the fallback strategies for Static Site Generation (SSG) routes when a pre-rendered path is not available.
6259
* This is particularly relevant for routes with parameterized URLs where some paths might not be pre-rendered at build time.
6360
* @see {@link ServerRoutePrerenderWithParams}
64-
* @developerPreview
6561
*/
6662
export enum PrerenderFallback {
6763
/**
@@ -85,7 +81,6 @@ export enum PrerenderFallback {
8581

8682
/**
8783
* Common interface for server routes, providing shared properties.
88-
* @developerPreview
8984
*/
9085
export interface ServerRouteCommon {
9186
/** The path associated with this route. */
@@ -101,7 +96,6 @@ export interface ServerRouteCommon {
10196
/**
10297
* A server route that uses Client-Side Rendering (CSR) mode.
10398
* @see {@link RenderMode}
104-
* @developerPreview
10599
*/
106100
export interface ServerRouteClient extends ServerRouteCommon {
107101
/** Specifies that the route uses Client-Side Rendering (CSR) mode. */
@@ -111,7 +105,6 @@ export interface ServerRouteClient extends ServerRouteCommon {
111105
/**
112106
* A server route that uses Static Site Generation (SSG) mode.
113107
* @see {@link RenderMode}
114-
* @developerPreview
115108
*/
116109
export interface ServerRoutePrerender extends Omit<ServerRouteCommon, 'status'> {
117110
/** Specifies that the route uses Static Site Generation (SSG) mode. */
@@ -126,7 +119,6 @@ export interface ServerRoutePrerender extends Omit<ServerRouteCommon, 'status'>
126119
* @see {@link RenderMode}
127120
* @see {@link ServerRoutePrerender}
128121
* @see {@link PrerenderFallback}
129-
* @developerPreview
130122
*/
131123
export interface ServerRoutePrerenderWithParams extends Omit<ServerRoutePrerender, 'fallback'> {
132124
/**
@@ -171,7 +163,6 @@ export interface ServerRoutePrerenderWithParams extends Omit<ServerRoutePrerende
171163
/**
172164
* A server route that uses Server-Side Rendering (SSR) mode.
173165
* @see {@link RenderMode}
174-
* @developerPreview
175166
*/
176167
export interface ServerRouteServer extends ServerRouteCommon {
177168
/** Specifies that the route uses Server-Side Rendering (SSR) mode. */
@@ -181,7 +172,6 @@ export interface ServerRouteServer extends ServerRouteCommon {
181172
/**
182173
* Server route configuration.
183174
* @see {@link provideServerRouting}
184-
* @developerPreview
185175
*/
186176
export type ServerRoute =
187177
| ServerRouteClient
@@ -221,7 +211,6 @@ export const SERVER_ROUTES_CONFIG = new InjectionToken<ServerRoutesConfig>('SERV
221211
*
222212
* @see {@link ServerRoute}
223213
* @see {@link withAppShell}
224-
* @developerPreview
225214
*/
226215
export function provideServerRouting(
227216
routes: ServerRoute[],

0 commit comments

Comments
 (0)
Please sign in to comment.