@angular/platform-server 14.1.0-rc.0 → 14.1.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,14 +1,14 @@
1
1
  /**
2
- * @license Angular v14.1.0-rc.0
2
+ * @license Angular v14.1.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, ɵ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, ɵinternalBootstrapApplication, 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.1.2", ngImport: i0, type: PlatformState, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
140
+ PlatformState.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: PlatformState });
141
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", 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.1.2", ngImport: i0, type: ServerXhr, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
184
+ ServerXhr.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: ServerXhr });
185
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", 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.1.2", 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.2", ngImport: i0, type: ServerPlatformLocation });
391
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", 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.1.2", 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.2", ngImport: i0, type: ServerEventManagerPlugin /* extends EventManagerPlugin which is private */ });
435
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", 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.1.2", 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.2", ngImport: i0, type: ServerRendererFactory2 });
490
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", 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.1.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.1.2", ngImport: i0, type: ServerStylesHost });
752
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: ServerStylesHost, decorators: [{
753
753
  type: Injectable
754
754
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
755
755
  type: Inject,
@@ -761,6 +761,56 @@ 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
+ const store = transferStore.store;
780
+ const isStateEmpty = Object.keys(store).length === 0;
781
+ if (isStateEmpty) {
782
+ // The state is empty, nothing to transfer,
783
+ // avoid creating an extra `<script>` tag in this case.
784
+ return;
785
+ }
786
+ const script = doc.createElement('script');
787
+ script.id = appId + '-state';
788
+ script.setAttribute('type', 'application/json');
789
+ script.textContent = ɵescapeHtml(transferStore.toJson());
790
+ doc.body.appendChild(script);
791
+ };
792
+ }
793
+ /**
794
+ * NgModule to install on the server side while using the `TransferState` to transfer state from
795
+ * server to client.
796
+ *
797
+ * Note: this module is not needed if the `renderApplication` function is used.
798
+ * The `renderApplication` makes all providers from this module available in the application.
799
+ *
800
+ * @publicApi
801
+ * @deprecated no longer needed, you can inject the `TransferState` in an app without providing
802
+ * this module.
803
+ */
804
+ class ServerTransferStateModule {
805
+ }
806
+ ServerTransferStateModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: ServerTransferStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
807
+ ServerTransferStateModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.2", ngImport: i0, type: ServerTransferStateModule });
808
+ ServerTransferStateModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: ServerTransferStateModule });
809
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: ServerTransferStateModule, decorators: [{
810
+ type: NgModule,
811
+ args: [{}]
812
+ }] });
813
+
764
814
  /**
765
815
  * @license
766
816
  * Copyright Google LLC All Rights Reserved.
@@ -806,21 +856,23 @@ const SERVER_RENDER_PROVIDERS = [
806
856
  */
807
857
  class ServerModule {
808
858
  }
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: [
859
+ ServerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: ServerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
860
+ ServerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.2", ngImport: i0, type: ServerModule, imports: [HttpClientModule, NoopAnimationsModule], exports: [BrowserModule] });
861
+ ServerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: ServerModule, providers: [
862
+ TRANSFER_STATE_SERIALIZATION_PROVIDERS,
812
863
  SERVER_RENDER_PROVIDERS,
813
864
  SERVER_HTTP_PROVIDERS,
814
865
  { provide: Testability, useValue: null },
815
866
  { provide: ɵTESTABILITY, useValue: null },
816
867
  { provide: ViewportScroller, useClass: ɵNullViewportScroller },
817
868
  ], imports: [HttpClientModule, NoopAnimationsModule, BrowserModule] });
818
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: ServerModule, decorators: [{
869
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: ServerModule, decorators: [{
819
870
  type: NgModule,
820
871
  args: [{
821
872
  exports: [BrowserModule],
822
873
  imports: [HttpClientModule, NoopAnimationsModule],
823
874
  providers: [
875
+ TRANSFER_STATE_SERIALIZATION_PROVIDERS,
824
876
  SERVER_RENDER_PROVIDERS,
825
877
  SERVER_HTTP_PROVIDERS,
826
878
  { provide: Testability, useValue: null },
@@ -848,54 +900,6 @@ const platformServer = createPlatformFactory(platformCore, 'server', INTERNAL_SE
848
900
  */
849
901
  const platformDynamicServer = createPlatformFactory(ɵplatformCoreDynamic, 'serverDynamic', INTERNAL_SERVER_PLATFORM_PROVIDERS);
850
902
 
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
903
  /**
900
904
  * @license
901
905
  * Copyright Google LLC All Rights Reserved.
@@ -1011,6 +1015,7 @@ function renderApplication(rootComponent, options) {
1011
1015
  const appProviders = [
1012
1016
  importProvidersFrom(BrowserModule.withServerTransition({ appId })),
1013
1017
  importProvidersFrom(ServerModule),
1018
+ ...TRANSFER_STATE_SERIALIZATION_PROVIDERS,
1014
1019
  ...(options.providers ?? []),
1015
1020
  ];
1016
1021
  return _render(platform, ɵinternalBootstrapApplication({ rootComponent, appProviders }));
@@ -1052,7 +1057,7 @@ function renderModuleFactory(moduleFactory, options) {
1052
1057
  /**
1053
1058
  * @publicApi
1054
1059
  */
1055
- const VERSION = new Version('14.1.0-rc.0');
1060
+ const VERSION = new Version('14.1.2');
1056
1061
 
1057
1062
  /**
1058
1063
  * @license