@angular/platform-server 14.1.0-rc.0 → 14.2.0-next.0

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,14 +1,14 @@
1
1
  /**
2
- * @license Angular v14.1.0-rc.0
2
+ * @license Angular v14.2.0-next.0
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, ɵTESTABILITY, NgModule, ɵsetDocument, createPlatformFactory, platformCore, APP_ID, ApplicationRef, ɵisPromise, importProvidersFrom, ɵinternalBootstrapApplication, Version } from '@angular/core';
9
+ import { Injectable, Inject, InjectionToken, Injector, Optional, ViewEncapsulation, RendererStyleFlags2, APP_ID, NgModule, PLATFORM_ID, PLATFORM_INITIALIZER, ɵALLOW_MULTIPLE_PLATFORMS, RendererFactory2, NgZone, Testability, ɵTESTABILITY, ɵsetDocument, createPlatformFactory, platformCore, ApplicationRef, ɵisPromise, importProvidersFrom, ɵinternalCreateApplication, Version } from '@angular/core';
10
10
  import * as i1 from '@angular/platform-browser';
11
- import { ɵBrowserDomAdapter, ɵflattenStyles, ɵNAMESPACE_URIS, ɵshimContentAttribute, ɵshimHostAttribute, ɵSharedStylesHost, ɵTRANSITION_ID, EVENT_MANAGER_PLUGINS, BrowserModule, ɵescapeHtml, TransferState } from '@angular/platform-browser';
11
+ import { ɵBrowserDomAdapter, ɵflattenStyles, ɵNAMESPACE_URIS, ɵshimContentAttribute, ɵshimHostAttribute, ɵSharedStylesHost, ɵTRANSITION_ID, TransferState, ɵescapeHtml, EVENT_MANAGER_PLUGINS, BrowserModule } from '@angular/platform-browser';
12
12
  import * as domino from 'domino';
13
13
  import { ɵAnimationEngine } from '@angular/animations/browser';
14
14
  import { ɵHttpInterceptingHandler, HttpHandler, HttpBackend, HttpClientModule } from '@angular/common/http';
@@ -136,9 +136,9 @@ class PlatformState {
136
136
  return this._doc;
137
137
  }
138
138
  }
139
- PlatformState.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: PlatformState, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
140
- PlatformState.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: PlatformState });
141
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: PlatformState, decorators: [{
139
+ PlatformState.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0-next.0", ngImport: i0, type: PlatformState, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
140
+ PlatformState.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.0-next.0", ngImport: i0, type: PlatformState });
141
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0-next.0", ngImport: i0, type: PlatformState, decorators: [{
142
142
  type: Injectable
143
143
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
144
144
  type: Inject,
@@ -180,9 +180,9 @@ class ServerXhr {
180
180
  return new xhr2.XMLHttpRequest();
181
181
  }
182
182
  }
183
- ServerXhr.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: ServerXhr, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
184
- ServerXhr.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: ServerXhr });
185
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: ServerXhr, decorators: [{
183
+ ServerXhr.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0-next.0", ngImport: i0, type: ServerXhr, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
184
+ ServerXhr.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.0-next.0", ngImport: i0, type: ServerXhr });
185
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0-next.0", ngImport: i0, type: ServerXhr, decorators: [{
186
186
  type: Injectable
187
187
  }] });
188
188
  class ZoneMacroTaskWrapper {
@@ -386,9 +386,9 @@ class ServerPlatformLocation {
386
386
  return undefined;
387
387
  }
388
388
  }
389
- ServerPlatformLocation.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: ServerPlatformLocation, deps: [{ token: DOCUMENT }, { token: INITIAL_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
390
- ServerPlatformLocation.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: ServerPlatformLocation });
391
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: ServerPlatformLocation, decorators: [{
389
+ ServerPlatformLocation.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0-next.0", ngImport: i0, type: ServerPlatformLocation, deps: [{ token: DOCUMENT }, { token: INITIAL_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
390
+ ServerPlatformLocation.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.0-next.0", ngImport: i0, type: ServerPlatformLocation });
391
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0-next.0", ngImport: i0, type: ServerPlatformLocation, decorators: [{
392
392
  type: Injectable
393
393
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
394
394
  type: Inject,
@@ -430,9 +430,9 @@ class ServerEventManagerPlugin /* extends EventManagerPlugin which is private */
430
430
  return this.addEventListener(target, eventName, handler);
431
431
  }
432
432
  }
433
- ServerEventManagerPlugin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: ServerEventManagerPlugin /* extends EventManagerPlugin which is private */, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
434
- ServerEventManagerPlugin.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: ServerEventManagerPlugin /* extends EventManagerPlugin which is private */ });
435
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: ServerEventManagerPlugin /* extends EventManagerPlugin which is private */, decorators: [{
433
+ ServerEventManagerPlugin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0-next.0", ngImport: i0, type: ServerEventManagerPlugin /* extends EventManagerPlugin which is private */, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
434
+ ServerEventManagerPlugin.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.0-next.0", ngImport: i0, type: ServerEventManagerPlugin /* extends EventManagerPlugin which is private */ });
435
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0-next.0", ngImport: i0, type: ServerEventManagerPlugin /* extends EventManagerPlugin which is private */, decorators: [{
436
436
  type: Injectable
437
437
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
438
438
  type: Inject,
@@ -485,9 +485,9 @@ class ServerRendererFactory2 {
485
485
  begin() { }
486
486
  end() { }
487
487
  }
488
- ServerRendererFactory2.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: ServerRendererFactory2, deps: [{ token: i1.EventManager }, { token: i0.NgZone }, { token: DOCUMENT }, { token: i1.ɵSharedStylesHost }], target: i0.ɵɵFactoryTarget.Injectable });
489
- ServerRendererFactory2.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: ServerRendererFactory2 });
490
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: ServerRendererFactory2, decorators: [{
488
+ ServerRendererFactory2.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0-next.0", ngImport: i0, type: ServerRendererFactory2, deps: [{ token: i1.EventManager }, { token: i0.NgZone }, { token: DOCUMENT }, { token: i1.ɵSharedStylesHost }], target: i0.ɵɵFactoryTarget.Injectable });
489
+ ServerRendererFactory2.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.0-next.0", ngImport: i0, type: ServerRendererFactory2 });
490
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0-next.0", ngImport: i0, type: ServerRendererFactory2, decorators: [{
491
491
  type: Injectable
492
492
  }], ctorParameters: function () { return [{ type: i1.EventManager }, { type: i0.NgZone }, { type: undefined, decorators: [{
493
493
  type: Inject,
@@ -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.1.0-rc.0", 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.1.0-rc.0", ngImport: i0, type: ServerStylesHost });
752
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: ServerStylesHost, decorators: [{
750
+ ServerStylesHost.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0-next.0", 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.2.0-next.0", ngImport: i0, type: ServerStylesHost });
752
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0-next.0", ngImport: i0, type: ServerStylesHost, decorators: [{
753
753
  type: Injectable
754
754
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
755
755
  type: Inject,
@@ -761,6 +761,54 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-rc.0", ng
761
761
  args: [ɵTRANSITION_ID]
762
762
  }] }]; } });
763
763
 
764
+ /**
765
+ * @license
766
+ * Copyright Google LLC All Rights Reserved.
767
+ *
768
+ * Use of this source code is governed by an MIT-style license that can be
769
+ * found in the LICENSE file at https://angular.io/license
770
+ */
771
+ const TRANSFER_STATE_SERIALIZATION_PROVIDERS = [{
772
+ provide: BEFORE_APP_SERIALIZED,
773
+ useFactory: serializeTransferStateFactory,
774
+ deps: [DOCUMENT, APP_ID, TransferState],
775
+ multi: true,
776
+ }];
777
+ function serializeTransferStateFactory(doc, appId, transferStore) {
778
+ return () => {
779
+ if (transferStore.isEmpty) {
780
+ // The state is empty, nothing to transfer,
781
+ // avoid creating an extra `<script>` tag in this case.
782
+ return;
783
+ }
784
+ const script = doc.createElement('script');
785
+ script.id = appId + '-state';
786
+ script.setAttribute('type', 'application/json');
787
+ script.textContent = ɵescapeHtml(transferStore.toJson());
788
+ doc.body.appendChild(script);
789
+ };
790
+ }
791
+ /**
792
+ * NgModule to install on the server side while using the `TransferState` to transfer state from
793
+ * server to client.
794
+ *
795
+ * Note: this module is not needed if the `renderApplication` function is used.
796
+ * The `renderApplication` makes all providers from this module available in the application.
797
+ *
798
+ * @publicApi
799
+ * @deprecated no longer needed, you can inject the `TransferState` in an app without providing
800
+ * this module.
801
+ */
802
+ class ServerTransferStateModule {
803
+ }
804
+ ServerTransferStateModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0-next.0", ngImport: i0, type: ServerTransferStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
805
+ ServerTransferStateModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.0-next.0", ngImport: i0, type: ServerTransferStateModule });
806
+ ServerTransferStateModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.0-next.0", ngImport: i0, type: ServerTransferStateModule });
807
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0-next.0", ngImport: i0, type: ServerTransferStateModule, decorators: [{
808
+ type: NgModule,
809
+ args: [{}]
810
+ }] });
811
+
764
812
  /**
765
813
  * @license
766
814
  * Copyright Google LLC All Rights Reserved.
@@ -806,21 +854,23 @@ const SERVER_RENDER_PROVIDERS = [
806
854
  */
807
855
  class ServerModule {
808
856
  }
809
- ServerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: ServerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
810
- ServerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.0-rc.0", ngImport: i0, type: ServerModule, imports: [HttpClientModule, NoopAnimationsModule], exports: [BrowserModule] });
811
- ServerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: ServerModule, providers: [
857
+ ServerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0-next.0", ngImport: i0, type: ServerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
858
+ ServerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.0-next.0", ngImport: i0, type: ServerModule, imports: [HttpClientModule, NoopAnimationsModule], exports: [BrowserModule] });
859
+ ServerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.0-next.0", ngImport: i0, type: ServerModule, providers: [
860
+ TRANSFER_STATE_SERIALIZATION_PROVIDERS,
812
861
  SERVER_RENDER_PROVIDERS,
813
862
  SERVER_HTTP_PROVIDERS,
814
863
  { provide: Testability, useValue: null },
815
864
  { provide: ɵTESTABILITY, useValue: null },
816
865
  { provide: ViewportScroller, useClass: ɵNullViewportScroller },
817
866
  ], imports: [HttpClientModule, NoopAnimationsModule, BrowserModule] });
818
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: ServerModule, decorators: [{
867
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0-next.0", ngImport: i0, type: ServerModule, decorators: [{
819
868
  type: NgModule,
820
869
  args: [{
821
870
  exports: [BrowserModule],
822
871
  imports: [HttpClientModule, NoopAnimationsModule],
823
872
  providers: [
873
+ TRANSFER_STATE_SERIALIZATION_PROVIDERS,
824
874
  SERVER_RENDER_PROVIDERS,
825
875
  SERVER_HTTP_PROVIDERS,
826
876
  { provide: Testability, useValue: null },
@@ -848,54 +898,6 @@ const platformServer = createPlatformFactory(platformCore, 'server', INTERNAL_SE
848
898
  */
849
899
  const platformDynamicServer = createPlatformFactory(ɵplatformCoreDynamic, 'serverDynamic', INTERNAL_SERVER_PLATFORM_PROVIDERS);
850
900
 
851
- /**
852
- * @license
853
- * Copyright Google LLC All Rights Reserved.
854
- *
855
- * Use of this source code is governed by an MIT-style license that can be
856
- * found in the LICENSE file at https://angular.io/license
857
- */
858
- function serializeTransferStateFactory(doc, appId, transferStore) {
859
- return () => {
860
- const script = doc.createElement('script');
861
- script.id = appId + '-state';
862
- script.setAttribute('type', 'application/json');
863
- script.textContent = ɵescapeHtml(transferStore.toJson());
864
- doc.body.appendChild(script);
865
- };
866
- }
867
- /**
868
- * NgModule to install on the server side while using the `TransferState` to transfer state from
869
- * server to client.
870
- *
871
- * @publicApi
872
- */
873
- class ServerTransferStateModule {
874
- }
875
- ServerTransferStateModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: ServerTransferStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
876
- ServerTransferStateModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.0-rc.0", ngImport: i0, type: ServerTransferStateModule });
877
- ServerTransferStateModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: ServerTransferStateModule, providers: [
878
- TransferState, {
879
- provide: BEFORE_APP_SERIALIZED,
880
- useFactory: serializeTransferStateFactory,
881
- deps: [DOCUMENT, APP_ID, TransferState],
882
- multi: true,
883
- }
884
- ] });
885
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: ServerTransferStateModule, decorators: [{
886
- type: NgModule,
887
- args: [{
888
- providers: [
889
- TransferState, {
890
- provide: BEFORE_APP_SERIALIZED,
891
- useFactory: serializeTransferStateFactory,
892
- deps: [DOCUMENT, APP_ID, TransferState],
893
- multi: true,
894
- }
895
- ]
896
- }]
897
- }] });
898
-
899
901
  /**
900
902
  * @license
901
903
  * Copyright Google LLC All Rights Reserved.
@@ -1011,9 +1013,10 @@ function renderApplication(rootComponent, options) {
1011
1013
  const appProviders = [
1012
1014
  importProvidersFrom(BrowserModule.withServerTransition({ appId })),
1013
1015
  importProvidersFrom(ServerModule),
1016
+ ...TRANSFER_STATE_SERIALIZATION_PROVIDERS,
1014
1017
  ...(options.providers ?? []),
1015
1018
  ];
1016
- return _render(platform, ɵinternalBootstrapApplication({ rootComponent, appProviders }));
1019
+ return _render(platform, ɵinternalCreateApplication({ rootComponent, appProviders }));
1017
1020
  }
1018
1021
  /**
1019
1022
  * Renders a {@link NgModuleFactory} to string.
@@ -1052,7 +1055,7 @@ function renderModuleFactory(moduleFactory, options) {
1052
1055
  /**
1053
1056
  * @publicApi
1054
1057
  */
1055
- const VERSION = new Version('14.1.0-rc.0');
1058
+ const VERSION = new Version('14.2.0-next.0');
1056
1059
 
1057
1060
  /**
1058
1061
  * @license