@angular/platform-server 14.0.0-next.9 → 14.0.0-rc.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 +1 @@
1
- {"version":3,"file":"init.mjs","sources":["../../../../../../packages/platform-server/src/domino_adapter.ts","../../../../../../packages/platform-server/init/src/shims.ts","../../../../../../packages/platform-server/init/src/init.ts","../../../../../../packages/platform-server/init/public_api.ts","../../../../../../packages/platform-server/init/index.ts","../../../../../../packages/platform-server/init/init.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ɵsetRootDomAdapter as setRootDomAdapter} from '@angular/common';\nimport {ɵBrowserDomAdapter as BrowserDomAdapter} from '@angular/platform-browser';\nimport * as domino from 'domino';\n\nexport function setDomTypes() {\n // Make all Domino types available in the global env.\n Object.assign(global, domino.impl);\n (global as any)['KeyboardEvent'] = domino.impl.Event;\n}\n\n/**\n * Parses a document string to a Document object.\n */\nexport function parseDocument(html: string, url = '/') {\n let window = domino.createWindow(html, url);\n let doc = window.document;\n return doc;\n}\n\n/**\n * Serializes a document to string.\n */\nexport function serializeDocument(doc: Document): string {\n return (doc as any).serialize();\n}\n\n/**\n * DOM Adapter for the server platform based on https://github.com/fgnass/domino.\n */\nexport class DominoAdapter extends BrowserDomAdapter {\n static override makeCurrent() {\n setDomTypes();\n setRootDomAdapter(new DominoAdapter());\n }\n\n override readonly supportsDOMEvents = false;\n private static defaultDoc: Document;\n\n override createHtmlDocument(): Document {\n return parseDocument('<html><head><title>fakeTitle</title></head><body></body></html>');\n }\n\n override getDefaultDocument(): Document {\n if (!DominoAdapter.defaultDoc) {\n DominoAdapter.defaultDoc = domino.createDocument();\n }\n return DominoAdapter.defaultDoc;\n }\n\n override isElementNode(node: any): boolean {\n return node ? node.nodeType === DominoAdapter.defaultDoc.ELEMENT_NODE : false;\n }\n override isShadowRoot(node: any): boolean {\n return node.shadowRoot == node;\n }\n\n /** @deprecated No longer being used in Ivy code. To be removed in version 14. */\n override getGlobalEventTarget(doc: Document, target: string): EventTarget|null {\n if (target === 'window') {\n return doc.defaultView;\n }\n if (target === 'document') {\n return doc;\n }\n if (target === 'body') {\n return doc.body;\n }\n return null;\n }\n\n override getBaseHref(doc: Document): string {\n // TODO(alxhub): Need relative path logic from BrowserDomAdapter here?\n return doc.documentElement!.querySelector('base')?.getAttribute('href') || '';\n }\n\n override dispatchEvent(el: Node, evt: any) {\n el.dispatchEvent(evt);\n\n // Dispatch the event to the window also.\n const doc = el.ownerDocument || el;\n const win = (doc as any).defaultView;\n if (win) {\n win.dispatchEvent(evt);\n }\n }\n\n override getUserAgent(): string {\n return 'Fake user agent';\n }\n\n override getCookie(name: string): string {\n throw new Error('getCookie has not been implemented');\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {setDomTypes} from '../../src/domino_adapter';\n\n/**\n * Apply the necessary shims to make DOM globals (such as `Element`, `HTMLElement`, etc.) available\n * on the environment.\n */\nexport function applyShims(): void {\n setDomTypes();\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @module\n * @description\n * Entry point for all initialization APIs of the platform-server package.\n */\n\nimport {applyShims} from './shims';\n\napplyShims();\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @module\n * @description\n * Entry point for all public APIs of this package.\n */\nexport * from './src/init';\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// This file is not used to build this module. It is only used during editing\n// by the TypeScript language service and during build for verifcation. `ngc`\n// replaces this file with production index.ts when it rewrites private symbol\n// names.\n\nexport * from './public_api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["BrowserDomAdapter","setRootDomAdapter"],"mappings":"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"}
1
+ {"version":3,"file":"init.mjs","sources":["../../../../../../packages/platform-server/init/src/shims.ts","../../../../../../packages/platform-server/init/src/init.ts","../../../../../../packages/platform-server/init/public_api.ts","../../../../../../packages/platform-server/init/index.ts","../../../../../../packages/platform-server/init/init.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {ɵsetDomTypes} from '@angular/platform-server';\n\n/**\n * Apply the necessary shims to make DOM globals (such as `Element`, `HTMLElement`, etc.) available\n * on the environment.\n */\nexport function applyShims(): void {\n ɵsetDomTypes();\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @module\n * @description\n * Entry point for all initialization APIs of the platform-server package.\n */\n\nimport {applyShims} from './shims';\n\napplyShims();\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @module\n * @description\n * Entry point for all public APIs of this package.\n */\nexport * from './src/init';\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// This file is not used to build this module. It is only used during editing\n// by the TypeScript language service and during build for verifcation. `ngc`\n// replaces this file with production index.ts when it rewrites private symbol\n// names.\n\nexport * from './public_api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;;;AAMG;AAGH;;;AAGG;SACa,UAAU,GAAA;AACxB,IAAA,YAAY,EAAE,CAAC;AACjB;;ACfA;;;;;;AAMG;AAUH,UAAU,EAAE;;AChBZ;;;;;;AAMG;;ACNH;;;;;;AAMG;;ACNH;;AAEG"}
@@ -1,12 +1,12 @@
1
1
  /**
2
- * @license Angular v14.0.0-next.9
2
+ * @license Angular v14.0.0-rc.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, Injector, Optional, ViewEncapsulation, RendererStyleFlags2, PLATFORM_ID, PLATFORM_INITIALIZER, ɵALLOW_MULTIPLE_PLATFORMS, RendererFactory2, NgZone, Testability, NgModule, ɵsetDocument, createPlatformFactory, platformCore, APP_ID, ApplicationRef, ɵisPromise, Version } from '@angular/core';
9
+ import { Injectable, Inject, InjectionToken, Injector, Optional, ViewEncapsulation, RendererStyleFlags2, PLATFORM_ID, PLATFORM_INITIALIZER, ɵALLOW_MULTIPLE_PLATFORMS, RendererFactory2, NgZone, Testability, ɵTESTABILITY, NgModule, ɵsetDocument, createPlatformFactory, platformCore, APP_ID, ApplicationRef, ɵisPromise, importProvidersFrom, ɵinternalBootstrapApplication, Version } from '@angular/core';
10
10
  import * as i1 from '@angular/platform-browser';
11
11
  import { ɵBrowserDomAdapter, ɵflattenStyles, ɵNAMESPACE_URIS, ɵshimContentAttribute, ɵshimHostAttribute, ɵSharedStylesHost, ɵTRANSITION_ID, EVENT_MANAGER_PLUGINS, BrowserModule, ɵescapeHtml, TransferState } from '@angular/platform-browser';
12
12
  import * as domino from 'domino';
@@ -137,9 +137,9 @@ class PlatformState {
137
137
  return this._doc;
138
138
  }
139
139
  }
140
- PlatformState.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.9", ngImport: i0, type: PlatformState, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
141
- PlatformState.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.9", ngImport: i0, type: PlatformState });
142
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.9", ngImport: i0, type: PlatformState, decorators: [{
140
+ PlatformState.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.2", ngImport: i0, type: PlatformState, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
141
+ PlatformState.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-rc.2", ngImport: i0, type: PlatformState });
142
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.2", ngImport: i0, type: PlatformState, decorators: [{
143
143
  type: Injectable
144
144
  }], ctorParameters: function () {
145
145
  return [{ type: undefined, decorators: [{
@@ -162,8 +162,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.9",
162
162
  */
163
163
  const INITIAL_CONFIG = new InjectionToken('Server.INITIAL_CONFIG');
164
164
  /**
165
- * A function that will be executed when calling `renderModuleFactory` or `renderModule` just
166
- * before current platform state is rendered to string.
165
+ * A function that will be executed when calling `renderApplication`, `renderModuleFactory` or
166
+ * `renderModule` just before current platform state is rendered to string.
167
167
  *
168
168
  * @publicApi
169
169
  */
@@ -183,9 +183,9 @@ class ServerXhr {
183
183
  return new xhr2.XMLHttpRequest();
184
184
  }
185
185
  }
186
- ServerXhr.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.9", ngImport: i0, type: ServerXhr, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
187
- ServerXhr.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.9", ngImport: i0, type: ServerXhr });
188
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.9", ngImport: i0, type: ServerXhr, decorators: [{
186
+ ServerXhr.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.2", ngImport: i0, type: ServerXhr, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
187
+ ServerXhr.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-rc.2", ngImport: i0, type: ServerXhr });
188
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.2", ngImport: i0, type: ServerXhr, decorators: [{
189
189
  type: Injectable
190
190
  }] });
191
191
  class ZoneMacroTaskWrapper {
@@ -389,9 +389,9 @@ class ServerPlatformLocation {
389
389
  return undefined;
390
390
  }
391
391
  }
392
- ServerPlatformLocation.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.9", ngImport: i0, type: ServerPlatformLocation, deps: [{ token: DOCUMENT }, { token: INITIAL_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
393
- ServerPlatformLocation.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.9", ngImport: i0, type: ServerPlatformLocation });
394
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.9", ngImport: i0, type: ServerPlatformLocation, decorators: [{
392
+ ServerPlatformLocation.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.2", ngImport: i0, type: ServerPlatformLocation, deps: [{ token: DOCUMENT }, { token: INITIAL_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
393
+ ServerPlatformLocation.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-rc.2", ngImport: i0, type: ServerPlatformLocation });
394
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.2", ngImport: i0, type: ServerPlatformLocation, decorators: [{
395
395
  type: Injectable
396
396
  }], ctorParameters: function () {
397
397
  return [{ type: undefined, decorators: [{
@@ -435,9 +435,9 @@ class ServerEventManagerPlugin /* extends EventManagerPlugin which is private */
435
435
  return this.addEventListener(target, eventName, handler);
436
436
  }
437
437
  }
438
- ServerEventManagerPlugin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.9", ngImport: i0, type: ServerEventManagerPlugin /* extends EventManagerPlugin which is private */, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
439
- ServerEventManagerPlugin.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.9", ngImport: i0, type: ServerEventManagerPlugin /* extends EventManagerPlugin which is private */ });
440
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.9", ngImport: i0, type: ServerEventManagerPlugin /* extends EventManagerPlugin which is private */, decorators: [{
438
+ ServerEventManagerPlugin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.2", ngImport: i0, type: ServerEventManagerPlugin /* extends EventManagerPlugin which is private */, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
439
+ ServerEventManagerPlugin.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-rc.2", ngImport: i0, type: ServerEventManagerPlugin /* extends EventManagerPlugin which is private */ });
440
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.2", ngImport: i0, type: ServerEventManagerPlugin /* extends EventManagerPlugin which is private */, decorators: [{
441
441
  type: Injectable
442
442
  }], ctorParameters: function () {
443
443
  return [{ type: undefined, decorators: [{
@@ -492,9 +492,9 @@ class ServerRendererFactory2 {
492
492
  begin() { }
493
493
  end() { }
494
494
  }
495
- ServerRendererFactory2.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.9", ngImport: i0, type: ServerRendererFactory2, deps: [{ token: i1.EventManager }, { token: i0.NgZone }, { token: DOCUMENT }, { token: i1.ɵSharedStylesHost }], target: i0.ɵɵFactoryTarget.Injectable });
496
- ServerRendererFactory2.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.9", ngImport: i0, type: ServerRendererFactory2 });
497
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.9", ngImport: i0, type: ServerRendererFactory2, decorators: [{
495
+ ServerRendererFactory2.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.2", ngImport: i0, type: ServerRendererFactory2, deps: [{ token: i1.EventManager }, { token: i0.NgZone }, { token: DOCUMENT }, { token: i1.ɵSharedStylesHost }], target: i0.ɵɵFactoryTarget.Injectable });
496
+ ServerRendererFactory2.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-rc.2", ngImport: i0, type: ServerRendererFactory2 });
497
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.2", ngImport: i0, type: ServerRendererFactory2, decorators: [{
498
498
  type: Injectable
499
499
  }], ctorParameters: function () {
500
500
  return [{ type: i1.EventManager }, { type: i0.NgZone }, { type: undefined, decorators: [{
@@ -747,9 +747,9 @@ class ServerStylesHost extends ɵSharedStylesHost {
747
747
  this._styleNodes.forEach(styleNode => styleNode.remove());
748
748
  }
749
749
  }
750
- ServerStylesHost.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.9", ngImport: i0, type: ServerStylesHost, deps: [{ token: DOCUMENT }, { token: ɵTRANSITION_ID, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
751
- ServerStylesHost.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.9", ngImport: i0, type: ServerStylesHost });
752
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.9", ngImport: i0, type: ServerStylesHost, decorators: [{
750
+ ServerStylesHost.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.2", ngImport: i0, type: ServerStylesHost, deps: [{ token: DOCUMENT }, { token: ɵTRANSITION_ID, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
751
+ ServerStylesHost.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-rc.2", ngImport: i0, type: ServerStylesHost });
752
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.2", ngImport: i0, type: ServerStylesHost, decorators: [{
753
753
  type: Injectable
754
754
  }], ctorParameters: function () {
755
755
  return [{ type: undefined, decorators: [{
@@ -770,9 +770,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.9",
770
770
  * Use of this source code is governed by an MIT-style license that can be
771
771
  * found in the LICENSE file at https://angular.io/license
772
772
  */
773
- function notSupported(feature) {
774
- throw new Error(`platform-server does not support '${feature}'.`);
775
- }
776
773
  const INTERNAL_SERVER_PLATFORM_PROVIDERS = [
777
774
  { provide: DOCUMENT, useFactory: _document, deps: [Injector] },
778
775
  { provide: PLATFORM_ID, useValue: ɵPLATFORM_SERVER_ID },
@@ -811,15 +808,16 @@ const SERVER_RENDER_PROVIDERS = [
811
808
  */
812
809
  class ServerModule {
813
810
  }
814
- ServerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.9", ngImport: i0, type: ServerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
815
- ServerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "14.0.0-next.9", ngImport: i0, type: ServerModule, imports: [HttpClientModule, NoopAnimationsModule], exports: [BrowserModule] });
816
- ServerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.0-next.9", ngImport: i0, type: ServerModule, providers: [
811
+ ServerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.2", ngImport: i0, type: ServerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
812
+ ServerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.0-rc.2", ngImport: i0, type: ServerModule, imports: [HttpClientModule, NoopAnimationsModule], exports: [BrowserModule] });
813
+ ServerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.0-rc.2", ngImport: i0, type: ServerModule, providers: [
817
814
  SERVER_RENDER_PROVIDERS,
818
815
  SERVER_HTTP_PROVIDERS,
819
816
  { provide: Testability, useValue: null },
817
+ { provide: ɵTESTABILITY, useValue: null },
820
818
  { provide: ViewportScroller, useClass: ɵNullViewportScroller },
821
- ], imports: [[HttpClientModule, NoopAnimationsModule], BrowserModule] });
822
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.9", ngImport: i0, type: ServerModule, decorators: [{
819
+ ], imports: [HttpClientModule, NoopAnimationsModule, BrowserModule] });
820
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.2", ngImport: i0, type: ServerModule, decorators: [{
823
821
  type: NgModule,
824
822
  args: [{
825
823
  exports: [BrowserModule],
@@ -828,6 +826,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.9",
828
826
  SERVER_RENDER_PROVIDERS,
829
827
  SERVER_HTTP_PROVIDERS,
830
828
  { provide: Testability, useValue: null },
829
+ { provide: ɵTESTABILITY, useValue: null },
831
830
  { provide: ViewportScroller, useClass: ɵNullViewportScroller },
832
831
  ],
833
832
  }]
@@ -875,9 +874,9 @@ function serializeTransferStateFactory(doc, appId, transferStore) {
875
874
  */
876
875
  class ServerTransferStateModule {
877
876
  }
878
- ServerTransferStateModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.9", ngImport: i0, type: ServerTransferStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
879
- ServerTransferStateModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "14.0.0-next.9", ngImport: i0, type: ServerTransferStateModule });
880
- ServerTransferStateModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.0-next.9", ngImport: i0, type: ServerTransferStateModule, providers: [
877
+ ServerTransferStateModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.2", ngImport: i0, type: ServerTransferStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
878
+ ServerTransferStateModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.0-rc.2", ngImport: i0, type: ServerTransferStateModule });
879
+ ServerTransferStateModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.0-rc.2", ngImport: i0, type: ServerTransferStateModule, providers: [
881
880
  TransferState, {
882
881
  provide: BEFORE_APP_SERIALIZED,
883
882
  useFactory: serializeTransferStateFactory,
@@ -885,7 +884,7 @@ ServerTransferStateModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0
885
884
  multi: true,
886
885
  }
887
886
  ] });
888
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.9", ngImport: i0, type: ServerTransferStateModule, decorators: [{
887
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.2", ngImport: i0, type: ServerTransferStateModule, decorators: [{
889
888
  type: NgModule,
890
889
  args: [{
891
890
  providers: [
@@ -907,27 +906,31 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.9",
907
906
  * found in the LICENSE file at https://angular.io/license
908
907
  */
909
908
  function _getPlatform(platformFactory, options) {
910
- const extraProviders = options.extraProviders ? options.extraProviders : [];
909
+ var _a;
910
+ const extraProviders = (_a = options.platformProviders) !== null && _a !== void 0 ? _a : [];
911
911
  return platformFactory([
912
912
  { provide: INITIAL_CONFIG, useValue: { document: options.document, url: options.url } },
913
913
  extraProviders
914
914
  ]);
915
915
  }
916
- function _render(platform, moduleRefPromise) {
917
- return moduleRefPromise.then((moduleRef) => {
918
- const transitionId = moduleRef.injector.get(ɵTRANSITION_ID, null);
916
+ function _render(platform, bootstrapPromise) {
917
+ return bootstrapPromise.then((moduleOrApplicationRef) => {
918
+ const environmentInjector = moduleOrApplicationRef.injector;
919
+ const transitionId = environmentInjector.get(ɵTRANSITION_ID, null);
919
920
  if (!transitionId) {
920
921
  throw new Error(`renderModule[Factory]() requires the use of BrowserModule.withServerTransition() to ensure
921
922
  the server-rendered app can be properly bootstrapped into a client app.`);
922
923
  }
923
- const applicationRef = moduleRef.injector.get(ApplicationRef);
924
+ const applicationRef = moduleOrApplicationRef instanceof ApplicationRef ?
925
+ moduleOrApplicationRef :
926
+ environmentInjector.get(ApplicationRef);
924
927
  return applicationRef.isStable.pipe((first((isStable) => isStable)))
925
928
  .toPromise()
926
929
  .then(() => {
927
930
  const platformState = platform.injector.get(PlatformState);
928
931
  const asyncPromises = [];
929
932
  // Run any BEFORE_APP_SERIALIZED callbacks just before rendering to string.
930
- const callbacks = moduleRef.injector.get(BEFORE_APP_SERIALIZED, null);
933
+ const callbacks = environmentInjector.get(BEFORE_APP_SERIALIZED, null);
931
934
  if (callbacks) {
932
935
  for (const callback of callbacks) {
933
936
  try {
@@ -971,9 +974,50 @@ the server-rendered app can be properly bootstrapped into a client app.`);
971
974
  * @publicApi
972
975
  */
973
976
  function renderModule(module, options) {
974
- const platform = _getPlatform(platformDynamicServer, options);
977
+ const { document, url, extraProviders: platformProviders } = options;
978
+ const platform = _getPlatform(platformDynamicServer, { document, url, platformProviders });
975
979
  return _render(platform, platform.bootstrapModule(module));
976
980
  }
981
+ /**
982
+ * Bootstraps an instance of an Angular application and renders it to a string.
983
+ *
984
+ * Note: the root component passed into this function *must* be a standalone one (should have the
985
+ * `standalone: true` flag in the `@Component` decorator config).
986
+ *
987
+ * ```typescript
988
+ * @Component({
989
+ * standalone: true,
990
+ * template: 'Hello world!'
991
+ * })
992
+ * class RootComponent {}
993
+ *
994
+ * const output: string = await renderApplication(RootComponent, {appId: 'server-app'});
995
+ * ```
996
+ *
997
+ * @param rootComponent A reference to a Standalone Component that should be rendered.
998
+ * @param options Additional configuration for the render operation:
999
+ * - `appId` - a string identifier of this application. The appId is used to prefix all
1000
+ * server-generated stylings and state keys of the application in TransferState
1001
+ * use-cases.
1002
+ * - `document` - the full document HTML of the page to render, as a string.
1003
+ * - `url` - the URL for the current render request.
1004
+ * - `providers` - set of application level providers for the current render request.
1005
+ * - `platformProviders` - the platform level providers for the current render request.
1006
+ * @returns A Promise, that returns serialized (to a string) rendered page, once resolved.
1007
+ *
1008
+ * @publicApi
1009
+ */
1010
+ function renderApplication(rootComponent, options) {
1011
+ var _a;
1012
+ const { document, url, platformProviders, appId } = options;
1013
+ const platform = _getPlatform(platformDynamicServer, { document, url, platformProviders });
1014
+ const appProviders = [
1015
+ importProvidersFrom(BrowserModule.withServerTransition({ appId })),
1016
+ importProvidersFrom(ServerModule),
1017
+ ...((_a = options.providers) !== null && _a !== void 0 ? _a : []),
1018
+ ];
1019
+ return _render(platform, ɵinternalBootstrapApplication({ rootComponent, appProviders }));
1020
+ }
977
1021
  /**
978
1022
  * Renders a {@link NgModuleFactory} to string.
979
1023
  *
@@ -988,7 +1032,8 @@ function renderModule(module, options) {
988
1032
  * Use {@link renderModule} API instead.
989
1033
  */
990
1034
  function renderModuleFactory(moduleFactory, options) {
991
- const platform = _getPlatform(platformServer, options);
1035
+ const { document, url, extraProviders: platformProviders } = options;
1036
+ const platform = _getPlatform(platformServer, { document, url, platformProviders });
992
1037
  return _render(platform, platform.bootstrapModuleFactory(moduleFactory));
993
1038
  }
994
1039
 
@@ -1010,7 +1055,7 @@ function renderModuleFactory(moduleFactory, options) {
1010
1055
  /**
1011
1056
  * @publicApi
1012
1057
  */
1013
- const VERSION = new Version('14.0.0-next.9');
1058
+ const VERSION = new Version('14.0.0-rc.2');
1014
1059
 
1015
1060
  /**
1016
1061
  * @license
@@ -1041,5 +1086,5 @@ const VERSION = new Version('14.0.0-next.9');
1041
1086
  * Generated bundle index. Do not edit.
1042
1087
  */
1043
1088
 
1044
- export { BEFORE_APP_SERIALIZED, INITIAL_CONFIG, PlatformState, ServerModule, ServerTransferStateModule, VERSION, platformDynamicServer, platformServer, renderModule, renderModuleFactory, INTERNAL_SERVER_PLATFORM_PROVIDERS as ɵINTERNAL_SERVER_PLATFORM_PROVIDERS, SERVER_RENDER_PROVIDERS as ɵSERVER_RENDER_PROVIDERS, ServerRendererFactory2 as ɵServerRendererFactory2 };
1089
+ 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_RENDER_PROVIDERS as ɵSERVER_RENDER_PROVIDERS, ServerRendererFactory2 as ɵServerRendererFactory2, setDomTypes as ɵsetDomTypes };
1045
1090
  //# sourceMappingURL=platform-server.mjs.map