@angular/platform-server 14.1.0-next.4 → 14.1.1

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-next.4
2
+ * @license Angular v14.1.1
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';
@@ -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.1.0-next.4", ngImport: i0, type: PlatformState, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
141
- PlatformState.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-next.4", ngImport: i0, type: PlatformState });
142
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.4", ngImport: i0, type: PlatformState, decorators: [{
140
+ PlatformState.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: PlatformState, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
141
+ PlatformState.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: PlatformState });
142
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: PlatformState, decorators: [{
143
143
  type: Injectable
144
144
  }], ctorParameters: function () {
145
145
  return [{ type: undefined, decorators: [{
@@ -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.1.0-next.4", ngImport: i0, type: ServerXhr, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
187
- ServerXhr.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-next.4", ngImport: i0, type: ServerXhr });
188
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.4", ngImport: i0, type: ServerXhr, decorators: [{
186
+ ServerXhr.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: ServerXhr, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
187
+ ServerXhr.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: ServerXhr });
188
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.1", 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.1.0-next.4", 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.1.0-next.4", ngImport: i0, type: ServerPlatformLocation });
394
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.4", ngImport: i0, type: ServerPlatformLocation, decorators: [{
392
+ ServerPlatformLocation.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.1", 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.1.1", ngImport: i0, type: ServerPlatformLocation });
394
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.1", 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.1.0-next.4", 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.1.0-next.4", ngImport: i0, type: ServerEventManagerPlugin /* extends EventManagerPlugin which is private */ });
440
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.4", ngImport: i0, type: ServerEventManagerPlugin /* extends EventManagerPlugin which is private */, decorators: [{
438
+ ServerEventManagerPlugin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.1", 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.1.1", ngImport: i0, type: ServerEventManagerPlugin /* extends EventManagerPlugin which is private */ });
440
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.1", 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.1.0-next.4", 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.1.0-next.4", ngImport: i0, type: ServerRendererFactory2 });
497
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.4", ngImport: i0, type: ServerRendererFactory2, decorators: [{
495
+ ServerRendererFactory2.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.1", 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.1.1", ngImport: i0, type: ServerRendererFactory2 });
497
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.1", 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: [{
@@ -756,9 +756,9 @@ class ServerStylesHost extends ɵSharedStylesHost {
756
756
  this._styleNodes.forEach(styleNode => styleNode.remove());
757
757
  }
758
758
  }
759
- ServerStylesHost.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-next.4", ngImport: i0, type: ServerStylesHost, deps: [{ token: DOCUMENT }, { token: ɵTRANSITION_ID, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
760
- ServerStylesHost.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-next.4", ngImport: i0, type: ServerStylesHost });
761
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.4", ngImport: i0, type: ServerStylesHost, decorators: [{
759
+ ServerStylesHost.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: ServerStylesHost, deps: [{ token: DOCUMENT }, { token: ɵTRANSITION_ID, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
760
+ ServerStylesHost.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: ServerStylesHost });
761
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: ServerStylesHost, decorators: [{
762
762
  type: Injectable
763
763
  }], ctorParameters: function () {
764
764
  return [{ type: undefined, decorators: [{
@@ -772,6 +772,56 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.4",
772
772
  }] }];
773
773
  } });
774
774
 
775
+ /**
776
+ * @license
777
+ * Copyright Google LLC All Rights Reserved.
778
+ *
779
+ * Use of this source code is governed by an MIT-style license that can be
780
+ * found in the LICENSE file at https://angular.io/license
781
+ */
782
+ const TRANSFER_STATE_SERIALIZATION_PROVIDERS = [{
783
+ provide: BEFORE_APP_SERIALIZED,
784
+ useFactory: serializeTransferStateFactory,
785
+ deps: [DOCUMENT, APP_ID, TransferState],
786
+ multi: true,
787
+ }];
788
+ function serializeTransferStateFactory(doc, appId, transferStore) {
789
+ return () => {
790
+ const store = transferStore.store;
791
+ const isStateEmpty = Object.keys(store).length === 0;
792
+ if (isStateEmpty) {
793
+ // The state is empty, nothing to transfer,
794
+ // avoid creating an extra `<script>` tag in this case.
795
+ return;
796
+ }
797
+ const script = doc.createElement('script');
798
+ script.id = appId + '-state';
799
+ script.setAttribute('type', 'application/json');
800
+ script.textContent = ɵescapeHtml(transferStore.toJson());
801
+ doc.body.appendChild(script);
802
+ };
803
+ }
804
+ /**
805
+ * NgModule to install on the server side while using the `TransferState` to transfer state from
806
+ * server to client.
807
+ *
808
+ * Note: this module is not needed if the `renderApplication` function is used.
809
+ * The `renderApplication` makes all providers from this module available in the application.
810
+ *
811
+ * @publicApi
812
+ * @deprecated no longer needed, you can inject the `TransferState` in an app without providing
813
+ * this module.
814
+ */
815
+ class ServerTransferStateModule {
816
+ }
817
+ ServerTransferStateModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: ServerTransferStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
818
+ ServerTransferStateModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.1", ngImport: i0, type: ServerTransferStateModule });
819
+ ServerTransferStateModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: ServerTransferStateModule });
820
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: ServerTransferStateModule, decorators: [{
821
+ type: NgModule,
822
+ args: [{}]
823
+ }] });
824
+
775
825
  /**
776
826
  * @license
777
827
  * Copyright Google LLC All Rights Reserved.
@@ -817,21 +867,23 @@ const SERVER_RENDER_PROVIDERS = [
817
867
  */
818
868
  class ServerModule {
819
869
  }
820
- ServerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-next.4", ngImport: i0, type: ServerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
821
- ServerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.0-next.4", ngImport: i0, type: ServerModule, imports: [HttpClientModule, NoopAnimationsModule], exports: [BrowserModule] });
822
- ServerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.0-next.4", ngImport: i0, type: ServerModule, providers: [
870
+ ServerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: ServerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
871
+ ServerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.1", ngImport: i0, type: ServerModule, imports: [HttpClientModule, NoopAnimationsModule], exports: [BrowserModule] });
872
+ ServerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: ServerModule, providers: [
873
+ TRANSFER_STATE_SERIALIZATION_PROVIDERS,
823
874
  SERVER_RENDER_PROVIDERS,
824
875
  SERVER_HTTP_PROVIDERS,
825
876
  { provide: Testability, useValue: null },
826
877
  { provide: ɵTESTABILITY, useValue: null },
827
878
  { provide: ViewportScroller, useClass: ɵNullViewportScroller },
828
879
  ], imports: [HttpClientModule, NoopAnimationsModule, BrowserModule] });
829
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.4", ngImport: i0, type: ServerModule, decorators: [{
880
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: ServerModule, decorators: [{
830
881
  type: NgModule,
831
882
  args: [{
832
883
  exports: [BrowserModule],
833
884
  imports: [HttpClientModule, NoopAnimationsModule],
834
885
  providers: [
886
+ TRANSFER_STATE_SERIALIZATION_PROVIDERS,
835
887
  SERVER_RENDER_PROVIDERS,
836
888
  SERVER_HTTP_PROVIDERS,
837
889
  { provide: Testability, useValue: null },
@@ -859,54 +911,6 @@ const platformServer = createPlatformFactory(platformCore, 'server', INTERNAL_SE
859
911
  */
860
912
  const platformDynamicServer = createPlatformFactory(ɵplatformCoreDynamic, 'serverDynamic', INTERNAL_SERVER_PLATFORM_PROVIDERS);
861
913
 
862
- /**
863
- * @license
864
- * Copyright Google LLC All Rights Reserved.
865
- *
866
- * Use of this source code is governed by an MIT-style license that can be
867
- * found in the LICENSE file at https://angular.io/license
868
- */
869
- function serializeTransferStateFactory(doc, appId, transferStore) {
870
- return () => {
871
- const script = doc.createElement('script');
872
- script.id = appId + '-state';
873
- script.setAttribute('type', 'application/json');
874
- script.textContent = ɵescapeHtml(transferStore.toJson());
875
- doc.body.appendChild(script);
876
- };
877
- }
878
- /**
879
- * NgModule to install on the server side while using the `TransferState` to transfer state from
880
- * server to client.
881
- *
882
- * @publicApi
883
- */
884
- class ServerTransferStateModule {
885
- }
886
- ServerTransferStateModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-next.4", ngImport: i0, type: ServerTransferStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
887
- ServerTransferStateModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.0-next.4", ngImport: i0, type: ServerTransferStateModule });
888
- ServerTransferStateModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.0-next.4", ngImport: i0, type: ServerTransferStateModule, providers: [
889
- TransferState, {
890
- provide: BEFORE_APP_SERIALIZED,
891
- useFactory: serializeTransferStateFactory,
892
- deps: [DOCUMENT, APP_ID, TransferState],
893
- multi: true,
894
- }
895
- ] });
896
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.4", ngImport: i0, type: ServerTransferStateModule, decorators: [{
897
- type: NgModule,
898
- args: [{
899
- providers: [
900
- TransferState, {
901
- provide: BEFORE_APP_SERIALIZED,
902
- useFactory: serializeTransferStateFactory,
903
- deps: [DOCUMENT, APP_ID, TransferState],
904
- multi: true,
905
- }
906
- ]
907
- }]
908
- }] });
909
-
910
914
  /**
911
915
  * @license
912
916
  * Copyright Google LLC All Rights Reserved.
@@ -1024,6 +1028,7 @@ function renderApplication(rootComponent, options) {
1024
1028
  const appProviders = [
1025
1029
  importProvidersFrom(BrowserModule.withServerTransition({ appId })),
1026
1030
  importProvidersFrom(ServerModule),
1031
+ ...TRANSFER_STATE_SERIALIZATION_PROVIDERS,
1027
1032
  ...((_a = options.providers) !== null && _a !== void 0 ? _a : []),
1028
1033
  ];
1029
1034
  return _render(platform, ɵinternalBootstrapApplication({ rootComponent, appProviders }));
@@ -1065,7 +1070,7 @@ function renderModuleFactory(moduleFactory, options) {
1065
1070
  /**
1066
1071
  * @publicApi
1067
1072
  */
1068
- const VERSION = new Version('14.1.0-next.4');
1073
+ const VERSION = new Version('14.1.1');
1069
1074
 
1070
1075
  /**
1071
1076
  * @license