@angular/ssr 21.0.0-next.1 → 21.0.0-next.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
@@ -1,5 +1,6 @@
1
1
  import { Type, EnvironmentProviders, Provider, ApplicationRef } from '@angular/core';
2
2
  import { DefaultExport } from '@angular/router';
3
+ import { BootstrapContext } from '@angular/platform-browser';
3
4
  import Beasties from './third_party/beasties';
4
5
 
5
6
  /**
@@ -249,20 +250,23 @@ declare function withAppShell(component: Type<unknown> | (() => Promise<Type<unk
249
250
  * when using the `bootstrapApplication` function:
250
251
  *
251
252
  * ```ts
252
- * import { bootstrapApplication } from '@angular/platform-browser';
253
+ * import { bootstrapApplication, BootstrapContext } from '@angular/platform-browser';
253
254
  * import { provideServerRendering, withRoutes, withAppShell } from '@angular/ssr';
254
255
  * import { AppComponent } from './app/app.component';
255
256
  * import { SERVER_ROUTES } from './app/app.server.routes';
256
257
  * import { AppShellComponent } from './app/app-shell.component';
257
258
  *
258
- * bootstrapApplication(AppComponent, {
259
- * providers: [
260
- * provideServerRendering(
261
- * withRoutes(SERVER_ROUTES),
262
- * withAppShell(AppShellComponent)
263
- * )
264
- * ]
265
- * });
259
+ * const bootstrap = (context: BootstrapContext) =>
260
+ * bootstrapApplication(AppComponent, {
261
+ * providers: [
262
+ * provideServerRendering(
263
+ * withRoutes(SERVER_ROUTES),
264
+ * withAppShell(AppShellComponent),
265
+ * ),
266
+ * ],
267
+ * }, context);
268
+ *
269
+ * export default bootstrap;
266
270
  * ```
267
271
  * @see {@link withRoutes} configures server-side routing
268
272
  * @see {@link withAppShell} configures the application shell
@@ -435,7 +439,7 @@ declare class RouteTree<AdditionalMetadata extends Record<string, unknown> = {}>
435
439
  * - A reference to an Angular component or module (`Type<unknown>`) that serves as the root of the application.
436
440
  * - A function that returns a `Promise<ApplicationRef>`, which resolves with the root application reference.
437
441
  */
438
- type AngularBootstrap = Type<unknown> | (() => Promise<ApplicationRef>);
442
+ type AngularBootstrap = Type<unknown> | ((context: BootstrapContext) => Promise<ApplicationRef>);
439
443
 
440
444
  /**
441
445
  * Represents a server asset stored in the manifest.
package/node/index.d.ts CHANGED
@@ -1,10 +1,11 @@
1
1
  import { Type, ApplicationRef, StaticProvider } from '@angular/core';
2
+ import { BootstrapContext } from '@angular/platform-browser';
2
3
  import { IncomingMessage, ServerResponse } from 'node:http';
3
4
  import { Http2ServerRequest, Http2ServerResponse } from 'node:http2';
4
5
 
5
6
  interface CommonEngineOptions {
6
7
  /** A method that when invoked returns a promise that returns an `ApplicationRef` instance once resolved or an NgModule. */
7
- bootstrap?: Type<{}> | (() => Promise<ApplicationRef>);
8
+ bootstrap?: Type<{}> | ((context: BootstrapContext) => Promise<ApplicationRef>);
8
9
  /** A set of platform level providers for all requests. */
9
10
  providers?: StaticProvider[];
10
11
  /** Enable request performance profiling data collection and printing the results in the server console. */
@@ -12,7 +13,7 @@ interface CommonEngineOptions {
12
13
  }
13
14
  interface CommonEngineRenderOptions {
14
15
  /** A method that when invoked returns a promise that returns an `ApplicationRef` instance once resolved or an NgModule. */
15
- bootstrap?: Type<{}> | (() => Promise<ApplicationRef>);
16
+ bootstrap?: Type<{}> | ((context: BootstrapContext) => Promise<ApplicationRef>);
16
17
  /** A set of platform level providers for the current request. */
17
18
  providers?: StaticProvider[];
18
19
  url?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/ssr",
3
- "version": "21.0.0-next.1",
3
+ "version": "21.0.0-next.3",
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.0",
33
- "@angular/compiler": "21.0.0-next.0",
34
- "@angular/core": "21.0.0-next.0",
35
- "@angular/platform-browser": "21.0.0-next.0",
36
- "@angular/platform-server": "21.0.0-next.0",
37
- "@angular/router": "21.0.0-next.0",
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",
38
38
  "@schematics/angular": "workspace:*",
39
39
  "beasties": "0.3.5"
40
40
  },