@angular/platform-server 16.0.0-next.1 → 16.0.0-next.2

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v16.0.0-next.1
2
+ * @license Angular v16.0.0-next.2
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -23,10 +23,10 @@ const platformServerTesting = createPlatformFactory(ɵplatformCoreDynamicTesting
23
23
  */
24
24
  class ServerTestingModule {
25
25
  }
26
- ServerTestingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: ServerTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
27
- ServerTestingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.0-next.1", ngImport: i0, type: ServerTestingModule, imports: [NoopAnimationsModule], exports: [BrowserDynamicTestingModule] });
28
- ServerTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: ServerTestingModule, providers: ɵSERVER_RENDER_PROVIDERS, imports: [NoopAnimationsModule, BrowserDynamicTestingModule] });
29
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: ServerTestingModule, decorators: [{
26
+ ServerTestingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.2", ngImport: i0, type: ServerTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
27
+ ServerTestingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.0-next.2", ngImport: i0, type: ServerTestingModule, imports: [NoopAnimationsModule], exports: [BrowserDynamicTestingModule] });
28
+ ServerTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.0-next.2", ngImport: i0, type: ServerTestingModule, providers: ɵSERVER_RENDER_PROVIDERS, imports: [NoopAnimationsModule, BrowserDynamicTestingModule] });
29
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.2", ngImport: i0, type: ServerTestingModule, decorators: [{
30
30
  type: NgModule,
31
31
  args: [{
32
32
  exports: [BrowserDynamicTestingModule],
package/fesm2020/init.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v16.0.0-next.1
2
+ * @license Angular v16.0.0-next.2
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1,12 +1,12 @@
1
1
  /**
2
- * @license Angular v16.0.0-next.1
2
+ * @license Angular v16.0.0-next.2
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
6
6
 
7
7
  import { ɵsetRootDomAdapter, DOCUMENT, XhrFactory, PlatformLocation, ɵgetDOM, ɵPLATFORM_SERVER_ID, ViewportScroller, ɵNullViewportScroller } from '@angular/common';
8
8
  import * as i0 from '@angular/core';
9
- import { Injectable, Inject, InjectionToken, inject, EnvironmentInjector, Optional, ViewEncapsulation, RendererStyleFlags2, APP_ID, ɵescapeTransferStateContent, NgModule, Injector, PLATFORM_ID, PLATFORM_INITIALIZER, ɵALLOW_MULTIPLE_PLATFORMS, RendererFactory2, NgZone, Testability, ɵTESTABILITY, ɵsetDocument, createPlatformFactory, platformCore, Renderer2, ApplicationRef, ɵisPromise, importProvidersFrom, ɵinternalCreateApplication, Version } from '@angular/core';
9
+ import { Injectable, Inject, InjectionToken, inject, EnvironmentInjector, Optional, ViewEncapsulation, RendererStyleFlags2, APP_ID, ɵescapeTransferStateContent, NgModule, Injector, PLATFORM_ID, PLATFORM_INITIALIZER, ɵALLOW_MULTIPLE_PLATFORMS, RendererFactory2, NgZone, Testability, ɵTESTABILITY, ɵsetDocument, createPlatformFactory, platformCore, Renderer2, ApplicationRef, ɵIS_HYDRATION_FEATURE_ENABLED, ɵannotateForHydration, ɵisPromise, importProvidersFrom, ɵinternalCreateApplication, ɵgetComponentDef, Version } from '@angular/core';
10
10
  import * as i1 from '@angular/platform-browser';
11
11
  import { ɵBrowserDomAdapter, ɵshimStyles, ɵNAMESPACE_URIS, ɵshimContentAttribute, ɵshimHostAttribute, ɵSharedStylesHost, ɵTRANSITION_ID, TransferState, EVENT_MANAGER_PLUGINS, BrowserModule } from '@angular/platform-browser';
12
12
  import { ɵAnimationEngine } from '@angular/animations/browser';
@@ -20085,9 +20085,9 @@ class PlatformState {
20085
20085
  return this._doc;
20086
20086
  }
20087
20087
  }
20088
- PlatformState.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: PlatformState, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
20089
- PlatformState.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: PlatformState });
20090
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: PlatformState, decorators: [{
20088
+ PlatformState.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.2", ngImport: i0, type: PlatformState, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
20089
+ PlatformState.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.2", ngImport: i0, type: PlatformState });
20090
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.2", ngImport: i0, type: PlatformState, decorators: [{
20091
20091
  type: Injectable
20092
20092
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
20093
20093
  type: Inject,
@@ -20101,7 +20101,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.1",
20101
20101
  */
20102
20102
  const INITIAL_CONFIG = new InjectionToken('Server.INITIAL_CONFIG');
20103
20103
  /**
20104
- * A function that will be executed when calling `renderApplication`, `renderModuleFactory` or
20104
+ * A function that will be executed when calling `renderApplication` or
20105
20105
  * `renderModule` just before current platform state is rendered to string.
20106
20106
  *
20107
20107
  * @publicApi
@@ -20115,9 +20115,9 @@ class ServerXhr {
20115
20115
  return new xhr2.XMLHttpRequest();
20116
20116
  }
20117
20117
  }
20118
- ServerXhr.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: ServerXhr, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
20119
- ServerXhr.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: ServerXhr });
20120
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: ServerXhr, decorators: [{
20118
+ ServerXhr.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.2", ngImport: i0, type: ServerXhr, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
20119
+ ServerXhr.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.2", ngImport: i0, type: ServerXhr });
20120
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.2", ngImport: i0, type: ServerXhr, decorators: [{
20121
20121
  type: Injectable
20122
20122
  }] });
20123
20123
  class ZoneMacroTaskWrapper {
@@ -20313,9 +20313,9 @@ class ServerPlatformLocation {
20313
20313
  return undefined;
20314
20314
  }
20315
20315
  }
20316
- ServerPlatformLocation.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: ServerPlatformLocation, deps: [{ token: DOCUMENT }, { token: INITIAL_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
20317
- ServerPlatformLocation.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: ServerPlatformLocation });
20318
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: ServerPlatformLocation, decorators: [{
20316
+ ServerPlatformLocation.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.2", ngImport: i0, type: ServerPlatformLocation, deps: [{ token: DOCUMENT }, { token: INITIAL_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
20317
+ ServerPlatformLocation.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.2", ngImport: i0, type: ServerPlatformLocation });
20318
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.2", ngImport: i0, type: ServerPlatformLocation, decorators: [{
20319
20319
  type: Injectable
20320
20320
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
20321
20321
  type: Inject,
@@ -20350,9 +20350,9 @@ class ServerEventManagerPlugin /* extends EventManagerPlugin which is private */
20350
20350
  return this.addEventListener(target, eventName, handler);
20351
20351
  }
20352
20352
  }
20353
- ServerEventManagerPlugin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: ServerEventManagerPlugin /* extends EventManagerPlugin which is private */, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
20354
- ServerEventManagerPlugin.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: ServerEventManagerPlugin /* extends EventManagerPlugin which is private */ });
20355
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: ServerEventManagerPlugin /* extends EventManagerPlugin which is private */, decorators: [{
20353
+ ServerEventManagerPlugin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.2", ngImport: i0, type: ServerEventManagerPlugin /* extends EventManagerPlugin which is private */, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
20354
+ ServerEventManagerPlugin.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.2", ngImport: i0, type: ServerEventManagerPlugin /* extends EventManagerPlugin which is private */ });
20355
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.2", ngImport: i0, type: ServerEventManagerPlugin /* extends EventManagerPlugin which is private */, decorators: [{
20356
20356
  type: Injectable
20357
20357
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
20358
20358
  type: Inject,
@@ -20398,9 +20398,9 @@ class ServerRendererFactory2 {
20398
20398
  begin() { }
20399
20399
  end() { }
20400
20400
  }
20401
- ServerRendererFactory2.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: ServerRendererFactory2, deps: [{ token: i1.EventManager }, { token: i0.NgZone }, { token: DOCUMENT }, { token: i1.ɵSharedStylesHost }], target: i0.ɵɵFactoryTarget.Injectable });
20402
- ServerRendererFactory2.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: ServerRendererFactory2 });
20403
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: ServerRendererFactory2, decorators: [{
20401
+ ServerRendererFactory2.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.2", ngImport: i0, type: ServerRendererFactory2, deps: [{ token: i1.EventManager }, { token: i0.NgZone }, { token: DOCUMENT }, { token: i1.ɵSharedStylesHost }], target: i0.ɵɵFactoryTarget.Injectable });
20402
+ ServerRendererFactory2.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.2", ngImport: i0, type: ServerRendererFactory2 });
20403
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.2", ngImport: i0, type: ServerRendererFactory2, decorators: [{
20404
20404
  type: Injectable
20405
20405
  }], ctorParameters: function () { return [{ type: i1.EventManager }, { type: i0.NgZone }, { type: undefined, decorators: [{
20406
20406
  type: Inject,
@@ -20649,9 +20649,9 @@ class ServerStylesHost extends ɵSharedStylesHost {
20649
20649
  super.ngOnDestroy();
20650
20650
  }
20651
20651
  }
20652
- ServerStylesHost.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: ServerStylesHost, deps: [{ token: DOCUMENT }, { token: ɵTRANSITION_ID, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
20653
- ServerStylesHost.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: ServerStylesHost });
20654
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: ServerStylesHost, decorators: [{
20652
+ ServerStylesHost.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.2", ngImport: i0, type: ServerStylesHost, deps: [{ token: DOCUMENT }, { token: ɵTRANSITION_ID, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
20653
+ ServerStylesHost.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.2", ngImport: i0, type: ServerStylesHost });
20654
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.2", ngImport: i0, type: ServerStylesHost, decorators: [{
20655
20655
  type: Injectable
20656
20656
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
20657
20657
  type: Inject,
@@ -20702,10 +20702,10 @@ function serializeTransferStateFactory(doc, appId, transferStore) {
20702
20702
  */
20703
20703
  class ServerTransferStateModule {
20704
20704
  }
20705
- ServerTransferStateModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: ServerTransferStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
20706
- ServerTransferStateModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.0-next.1", ngImport: i0, type: ServerTransferStateModule });
20707
- ServerTransferStateModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: ServerTransferStateModule });
20708
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: ServerTransferStateModule, decorators: [{
20705
+ ServerTransferStateModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.2", ngImport: i0, type: ServerTransferStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
20706
+ ServerTransferStateModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.0-next.2", ngImport: i0, type: ServerTransferStateModule });
20707
+ ServerTransferStateModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.0-next.2", ngImport: i0, type: ServerTransferStateModule });
20708
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.2", ngImport: i0, type: ServerTransferStateModule, decorators: [{
20709
20709
  type: NgModule,
20710
20710
  args: [{}]
20711
20711
  }] });
@@ -20748,9 +20748,9 @@ const SERVER_RENDER_PROVIDERS = [
20748
20748
  */
20749
20749
  class ServerModule {
20750
20750
  }
20751
- ServerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: ServerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
20752
- ServerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.0-next.1", ngImport: i0, type: ServerModule, imports: [HttpClientModule, NoopAnimationsModule], exports: [BrowserModule] });
20753
- ServerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: ServerModule, providers: [
20751
+ ServerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.2", ngImport: i0, type: ServerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
20752
+ ServerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.0-next.2", ngImport: i0, type: ServerModule, imports: [HttpClientModule, NoopAnimationsModule], exports: [BrowserModule] });
20753
+ ServerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.0-next.2", ngImport: i0, type: ServerModule, providers: [
20754
20754
  TRANSFER_STATE_SERIALIZATION_PROVIDERS,
20755
20755
  SERVER_RENDER_PROVIDERS,
20756
20756
  SERVER_HTTP_PROVIDERS,
@@ -20758,7 +20758,7 @@ ServerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
20758
20758
  { provide: ɵTESTABILITY, useValue: null },
20759
20759
  { provide: ViewportScroller, useClass: ɵNullViewportScroller },
20760
20760
  ], imports: [HttpClientModule, NoopAnimationsModule, BrowserModule] });
20761
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: ServerModule, decorators: [{
20761
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.2", ngImport: i0, type: ServerModule, decorators: [{
20762
20762
  type: NgModule,
20763
20763
  args: [{
20764
20764
  exports: [BrowserModule],
@@ -20836,6 +20836,9 @@ the server-rendered app can be properly bootstrapped into a client app.`);
20836
20836
  appendServerContextInfo(serverContext, applicationRef);
20837
20837
  const platformState = platform.injector.get(PlatformState);
20838
20838
  const asyncPromises = [];
20839
+ if (applicationRef.injector.get(ɵIS_HYDRATION_FEATURE_ENABLED, false)) {
20840
+ ɵannotateForHydration(applicationRef, platformState.getDocument());
20841
+ }
20839
20842
  // Run any BEFORE_APP_SERIALIZED callbacks just before rendering to string.
20840
20843
  const callbacks = environmentInjector.get(BEFORE_APP_SERIALIZED, null);
20841
20844
  if (callbacks) {
@@ -20907,70 +20910,22 @@ function renderModule(moduleType, options) {
20907
20910
  const platform = _getPlatform(platformDynamicServer, { document, url, platformProviders });
20908
20911
  return _render(platform, platform.bootstrapModule(moduleType));
20909
20912
  }
20910
- /**
20911
- * Bootstraps an instance of an Angular application and renders it to a string.
20912
- *
20913
- * Note: the root component passed into this function *must* be a standalone one (should have the
20914
- * `standalone: true` flag in the `@Component` decorator config).
20915
- *
20916
- * ```typescript
20917
- * @Component({
20918
- * standalone: true,
20919
- * template: 'Hello world!'
20920
- * })
20921
- * class RootComponent {}
20922
- *
20923
- * const output: string = await renderApplication(RootComponent, {appId: 'server-app'});
20924
- * ```
20925
- *
20926
- * @param rootComponent A reference to a Standalone Component that should be rendered.
20927
- * @param options Additional configuration for the render operation:
20928
- * - `appId` - a string identifier of this application. The appId is used to prefix all
20929
- * server-generated stylings and state keys of the application in TransferState
20930
- * use-cases.
20931
- * - `document` - the document of the page to render, either as an HTML string or
20932
- * as a reference to the `document` instance.
20933
- * - `url` - the URL for the current render request.
20934
- * - `providers` - set of application level providers for the current render request.
20935
- * - `platformProviders` - the platform level providers for the current render request.
20936
- *
20937
- * @returns A Promise, that returns serialized (to a string) rendered page, once resolved.
20938
- *
20939
- * @publicApi
20940
- * @developerPreview
20941
- */
20942
- function renderApplication(rootComponent, options) {
20943
- const { document, url, platformProviders, appId } = options;
20913
+ function renderApplication(rootComponentOrBootstrapFn, options) {
20914
+ const { document, url, platformProviders, appId = '' } = options;
20944
20915
  const platform = _getPlatform(platformDynamicServer, { document, url, platformProviders });
20916
+ if (isBootstrapFn(rootComponentOrBootstrapFn)) {
20917
+ return _render(platform, rootComponentOrBootstrapFn());
20918
+ }
20945
20919
  const appProviders = [
20946
20920
  importProvidersFrom(BrowserModule.withServerTransition({ appId })),
20947
20921
  importProvidersFrom(ServerModule),
20948
20922
  ...(options.providers ?? []),
20949
20923
  ];
20950
- return _render(platform, ɵinternalCreateApplication({ rootComponent, appProviders }));
20924
+ return _render(platform, ɵinternalCreateApplication({ rootComponent: rootComponentOrBootstrapFn, appProviders }));
20951
20925
  }
20952
- /**
20953
- * Bootstraps an application using provided {@link NgModuleFactory} and serializes the page content
20954
- * to string.
20955
- *
20956
- * @param moduleFactory An instance of the {@link NgModuleFactory} that should be used for
20957
- * bootstrap.
20958
- * @param options Additional configuration for the render operation:
20959
- * - `document` - the document of the page to render, either as an HTML string or
20960
- * as a reference to the `document` instance.
20961
- * - `url` - the URL for the current render request.
20962
- * - `extraProviders` - set of platform level providers for the current render request.
20963
- *
20964
- * @publicApi
20965
- *
20966
- * @deprecated
20967
- * This symbol is no longer necessary as of Angular v13.
20968
- * Use {@link renderModule} API instead.
20969
- */
20970
- function renderModuleFactory(moduleFactory, options) {
20971
- const { document, url, extraProviders: platformProviders } = options;
20972
- const platform = _getPlatform(platformServer, { document, url, platformProviders });
20973
- return _render(platform, platform.bootstrapModuleFactory(moduleFactory));
20926
+ function isBootstrapFn(value) {
20927
+ // We can differentiate between a component and a bootstrap function by reading `cmp`:
20928
+ return typeof value === 'function' && !ɵgetComponentDef(value);
20974
20929
  }
20975
20930
 
20976
20931
  /**
@@ -20981,7 +20936,7 @@ function renderModuleFactory(moduleFactory, options) {
20981
20936
  /**
20982
20937
  * @publicApi
20983
20938
  */
20984
- const VERSION = new Version('16.0.0-next.1');
20939
+ const VERSION = new Version('16.0.0-next.2');
20985
20940
 
20986
20941
  /// <reference types="node" />
20987
20942
  // This file only reexports content of the `src` folder. Keep it that way.
@@ -20992,5 +20947,5 @@ const VERSION = new Version('16.0.0-next.1');
20992
20947
  * Generated bundle index. Do not edit.
20993
20948
  */
20994
20949
 
20995
- export { BEFORE_APP_SERIALIZED, INITIAL_CONFIG, PlatformState, ServerModule, ServerTransferStateModule, VERSION, platformDynamicServer, platformServer, renderApplication, renderModule, renderModuleFactory, INTERNAL_SERVER_PLATFORM_PROVIDERS as ɵINTERNAL_SERVER_PLATFORM_PROVIDERS, SERVER_CONTEXT as ɵSERVER_CONTEXT, SERVER_RENDER_PROVIDERS as ɵSERVER_RENDER_PROVIDERS, ServerRendererFactory2 as ɵServerRendererFactory2, setDomTypes as ɵsetDomTypes };
20950
+ export { BEFORE_APP_SERIALIZED, INITIAL_CONFIG, PlatformState, ServerModule, ServerTransferStateModule, VERSION, platformDynamicServer, platformServer, renderApplication, renderModule, INTERNAL_SERVER_PLATFORM_PROVIDERS as ɵINTERNAL_SERVER_PLATFORM_PROVIDERS, SERVER_CONTEXT as ɵSERVER_CONTEXT, SERVER_RENDER_PROVIDERS as ɵSERVER_RENDER_PROVIDERS, ServerRendererFactory2 as ɵServerRendererFactory2, setDomTypes as ɵsetDomTypes };
20996
20951
  //# sourceMappingURL=platform-server.mjs.map