@angular/ssr 22.0.0-rc.2 → 22.0.0-rc.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/ssr",
3
- "version": "22.0.0-rc.2",
3
+ "version": "22.0.0-rc.3",
4
4
  "description": "Angular server side rendering utilities",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -37,12 +37,12 @@
37
37
  },
38
38
  "devDependencies": {
39
39
  "@angular-devkit/schematics": "workspace:*",
40
- "@angular/common": "22.0.0-rc.1",
41
- "@angular/compiler": "22.0.0-rc.1",
42
- "@angular/core": "22.0.0-rc.1",
43
- "@angular/platform-browser": "22.0.0-rc.1",
44
- "@angular/platform-server": "22.0.0-rc.1",
45
- "@angular/router": "22.0.0-rc.1",
40
+ "@angular/common": "22.0.0-rc.2",
41
+ "@angular/compiler": "22.0.0-rc.2",
42
+ "@angular/core": "22.0.0-rc.2",
43
+ "@angular/platform-browser": "22.0.0-rc.2",
44
+ "@angular/platform-server": "22.0.0-rc.2",
45
+ "@angular/router": "22.0.0-rc.2",
46
46
  "@schematics/angular": "workspace:*",
47
47
  "beasties": "0.4.2"
48
48
  },
package/types/ssr.d.ts CHANGED
@@ -237,6 +237,16 @@ declare function withRoutes(routes: ServerRoute[]): ServerRenderingFeature<Serve
237
237
  * @see {@link https://angular.dev/ecosystem/service-workers/app-shell App shell pattern on Angular.dev}
238
238
  */
239
239
  declare function withAppShell(component: Type<unknown> | (() => Promise<Type<unknown> | DefaultExport<Type<unknown>>>)): ServerRenderingFeature<ServerRenderingFeatureKind.AppShell>;
240
+ /**
241
+ * Options for configuring server-side rendering.
242
+ */
243
+ interface ServerRenderingOptions {
244
+ /**
245
+ * The maximum allowed response body size when using the Fetch API.
246
+ * @default 1MB
247
+ */
248
+ maxResponseBodySize: number;
249
+ }
240
250
  /**
241
251
  * Configures server-side rendering for an Angular application.
242
252
  *
@@ -274,6 +284,45 @@ declare function withAppShell(component: Type<unknown> | (() => Promise<Type<unk
274
284
  * @see {@link withAppShell} configures the application shell
275
285
  */
276
286
  declare function provideServerRendering(...features: ServerRenderingFeature<ServerRenderingFeatureKind>[]): EnvironmentProviders;
287
+ /**
288
+ * Configures server-side rendering for an Angular application with additional options.
289
+ *
290
+ * This function sets up the necessary providers for server-side rendering, including
291
+ * support for server routes and app shell. It combines features configured using
292
+ * `withRoutes` and `withAppShell` to provide a comprehensive server-side rendering setup.
293
+ *
294
+ * @param options - Configuration options for server-side rendering.
295
+ * @param features - Optional features to configure additional server rendering behaviors.
296
+ * @returns An `EnvironmentProviders` instance with the server-side rendering configuration.
297
+ *
298
+ * @example
299
+ * Basic example of how you can enable server-side rendering with options in your application
300
+ * when using the `bootstrapApplication` function:
301
+ *
302
+ * ```ts
303
+ * import { bootstrapApplication, BootstrapContext } from '@angular/platform-browser';
304
+ * import { provideServerRendering, withRoutes, withAppShell } from '@angular/ssr';
305
+ * import { AppComponent } from './app/app.component';
306
+ * import { SERVER_ROUTES } from './app/app.server.routes';
307
+ * import { AppShellComponent } from './app/app-shell.component';
308
+ *
309
+ * const bootstrap = (context: BootstrapContext) =>
310
+ * bootstrapApplication(AppComponent, {
311
+ * providers: [
312
+ * provideServerRendering(
313
+ * { maxResponseBodySize: 1024 * 1024 }, // 1MB limit
314
+ * withRoutes(SERVER_ROUTES),
315
+ * withAppShell(AppShellComponent),
316
+ * ),
317
+ * ],
318
+ * }, context);
319
+ *
320
+ * export default bootstrap;
321
+ * ```
322
+ * @see {@link withRoutes} configures server-side routing
323
+ * @see {@link withAppShell} configures the application shell
324
+ */
325
+ declare function provideServerRendering(options: ServerRenderingOptions, ...features: ServerRenderingFeature<ServerRenderingFeatureKind>[]): EnvironmentProviders;
277
326
 
278
327
  /**
279
328
  * Represents the serialized format of a route tree as an array of node metadata objects.
@@ -918,4 +967,4 @@ type RequestHandlerFunction = (request: Request) => Promise<Response | null> | n
918
967
  declare function createRequestHandler(handler: RequestHandlerFunction): RequestHandlerFunction;
919
968
 
920
969
  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 };
921
- export type { RequestHandlerFunction, ServerRoute, ServerRouteClient, ServerRouteCommon, ServerRoutePrerender, ServerRoutePrerenderWithParams, ServerRouteServer };
970
+ export type { RequestHandlerFunction, ServerRenderingOptions, ServerRoute, ServerRouteClient, ServerRouteCommon, ServerRoutePrerender, ServerRoutePrerenderWithParams, ServerRouteServer };