@angular/platform-server 15.2.0-rc.0 → 16.0.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,5 +1,5 @@
1
1
  /**
2
- * @license Angular v15.2.0-rc.0
2
+ * @license Angular v16.0.0-next.0
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: "15.2.0-rc.0", ngImport: i0, type: ServerTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
27
- ServerTestingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.0-rc.0", ngImport: i0, type: ServerTestingModule, imports: [NoopAnimationsModule], exports: [BrowserDynamicTestingModule] });
28
- ServerTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.0-rc.0", ngImport: i0, type: ServerTestingModule, providers: ɵSERVER_RENDER_PROVIDERS, imports: [NoopAnimationsModule, BrowserDynamicTestingModule] });
29
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.0-rc.0", ngImport: i0, type: ServerTestingModule, decorators: [{
26
+ ServerTestingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.0", ngImport: i0, type: ServerTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
27
+ ServerTestingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.0-next.0", ngImport: i0, type: ServerTestingModule, imports: [NoopAnimationsModule], exports: [BrowserDynamicTestingModule] });
28
+ ServerTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.0-next.0", ngImport: i0, type: ServerTestingModule, providers: ɵSERVER_RENDER_PROVIDERS, imports: [NoopAnimationsModule, BrowserDynamicTestingModule] });
29
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.0", 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 v15.2.0-rc.0
2
+ * @license Angular v16.0.0-next.0
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v15.2.0-rc.0
2
+ * @license Angular v16.0.0-next.0
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -8,7 +8,7 @@ import { ɵsetRootDomAdapter, DOCUMENT, XhrFactory, PlatformLocation, ɵgetDOM,
8
8
  import * as i0 from '@angular/core';
9
9
  import { Injectable, Inject, InjectionToken, inject, EnvironmentInjector, Optional, ViewEncapsulation, RendererStyleFlags2, APP_ID, 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';
10
10
  import * as i1 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';
11
+ import { ɵBrowserDomAdapter, ɵshimStyles, ɵNAMESPACE_URIS, ɵshimContentAttribute, ɵshimHostAttribute, ɵSharedStylesHost, ɵTRANSITION_ID, TransferState, ɵescapeHtml, EVENT_MANAGER_PLUGINS, BrowserModule } from '@angular/platform-browser';
12
12
  import domino from 'domino';
13
13
  import { ɵAnimationEngine } from '@angular/animations/browser';
14
14
  import { ɵHttpInterceptorHandler, HttpBackend, HttpHandler, HttpClientModule } from '@angular/common/http';
@@ -122,9 +122,9 @@ class PlatformState {
122
122
  return this._doc;
123
123
  }
124
124
  }
125
- PlatformState.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.0-rc.0", ngImport: i0, type: PlatformState, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
126
- PlatformState.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.0-rc.0", ngImport: i0, type: PlatformState });
127
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.0-rc.0", ngImport: i0, type: PlatformState, decorators: [{
125
+ PlatformState.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.0", ngImport: i0, type: PlatformState, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
126
+ PlatformState.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.0", ngImport: i0, type: PlatformState });
127
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.0", ngImport: i0, type: PlatformState, decorators: [{
128
128
  type: Injectable
129
129
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
130
130
  type: Inject,
@@ -152,9 +152,9 @@ class ServerXhr {
152
152
  return new xhr2.XMLHttpRequest();
153
153
  }
154
154
  }
155
- ServerXhr.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.0-rc.0", ngImport: i0, type: ServerXhr, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
156
- ServerXhr.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.0-rc.0", ngImport: i0, type: ServerXhr });
157
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.0-rc.0", ngImport: i0, type: ServerXhr, decorators: [{
155
+ ServerXhr.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.0", ngImport: i0, type: ServerXhr, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
156
+ ServerXhr.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.0", ngImport: i0, type: ServerXhr });
157
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.0", ngImport: i0, type: ServerXhr, decorators: [{
158
158
  type: Injectable
159
159
  }] });
160
160
  class ZoneMacroTaskWrapper {
@@ -350,9 +350,9 @@ class ServerPlatformLocation {
350
350
  return undefined;
351
351
  }
352
352
  }
353
- ServerPlatformLocation.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.0-rc.0", ngImport: i0, type: ServerPlatformLocation, deps: [{ token: DOCUMENT }, { token: INITIAL_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
354
- ServerPlatformLocation.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.0-rc.0", ngImport: i0, type: ServerPlatformLocation });
355
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.0-rc.0", ngImport: i0, type: ServerPlatformLocation, decorators: [{
353
+ ServerPlatformLocation.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.0", ngImport: i0, type: ServerPlatformLocation, deps: [{ token: DOCUMENT }, { token: INITIAL_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
354
+ ServerPlatformLocation.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.0", ngImport: i0, type: ServerPlatformLocation });
355
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.0", ngImport: i0, type: ServerPlatformLocation, decorators: [{
356
356
  type: Injectable
357
357
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
358
358
  type: Inject,
@@ -387,9 +387,9 @@ class ServerEventManagerPlugin /* extends EventManagerPlugin which is private */
387
387
  return this.addEventListener(target, eventName, handler);
388
388
  }
389
389
  }
390
- ServerEventManagerPlugin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.0-rc.0", ngImport: i0, type: ServerEventManagerPlugin /* extends EventManagerPlugin which is private */, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
391
- ServerEventManagerPlugin.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.0-rc.0", ngImport: i0, type: ServerEventManagerPlugin /* extends EventManagerPlugin which is private */ });
392
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.0-rc.0", ngImport: i0, type: ServerEventManagerPlugin /* extends EventManagerPlugin which is private */, decorators: [{
390
+ ServerEventManagerPlugin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.0", ngImport: i0, type: ServerEventManagerPlugin /* extends EventManagerPlugin which is private */, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
391
+ ServerEventManagerPlugin.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.0", ngImport: i0, type: ServerEventManagerPlugin /* extends EventManagerPlugin which is private */ });
392
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.0", ngImport: i0, type: ServerEventManagerPlugin /* extends EventManagerPlugin which is private */, decorators: [{
393
393
  type: Injectable
394
394
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
395
395
  type: Inject,
@@ -424,7 +424,7 @@ class ServerRendererFactory2 {
424
424
  }
425
425
  default: {
426
426
  if (!this.rendererByCompId.has(type.id)) {
427
- const styles = ɵflattenStyles(type.id, type.styles);
427
+ const styles = ɵshimStyles(type.id, type.styles);
428
428
  this.sharedStylesHost.addStyles(styles);
429
429
  this.rendererByCompId.set(type.id, this.defaultRenderer);
430
430
  }
@@ -435,9 +435,9 @@ class ServerRendererFactory2 {
435
435
  begin() { }
436
436
  end() { }
437
437
  }
438
- ServerRendererFactory2.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.0-rc.0", ngImport: i0, type: ServerRendererFactory2, deps: [{ token: i1.EventManager }, { token: i0.NgZone }, { token: DOCUMENT }, { token: i1.ɵSharedStylesHost }], target: i0.ɵɵFactoryTarget.Injectable });
439
- ServerRendererFactory2.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.0-rc.0", ngImport: i0, type: ServerRendererFactory2 });
440
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.0-rc.0", ngImport: i0, type: ServerRendererFactory2, decorators: [{
438
+ ServerRendererFactory2.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.0", ngImport: i0, type: ServerRendererFactory2, deps: [{ token: i1.EventManager }, { token: i0.NgZone }, { token: DOCUMENT }, { token: i1.ɵSharedStylesHost }], target: i0.ɵɵFactoryTarget.Injectable });
439
+ ServerRendererFactory2.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.0", ngImport: i0, type: ServerRendererFactory2 });
440
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.0", ngImport: i0, type: ServerRendererFactory2, decorators: [{
441
441
  type: Injectable
442
442
  }], ctorParameters: function () { return [{ type: i1.EventManager }, { type: i0.NgZone }, { type: undefined, decorators: [{
443
443
  type: Inject,
@@ -609,7 +609,7 @@ class EmulatedEncapsulationServerRenderer2 extends DefaultServerRenderer2 {
609
609
  this.component = component;
610
610
  // Add a 's' prefix to style attributes to indicate server.
611
611
  const componentId = 's' + component.id;
612
- const styles = ɵflattenStyles(componentId, component.styles);
612
+ const styles = ɵshimStyles(componentId, component.styles);
613
613
  sharedStylesHost.addStyles(styles);
614
614
  this.contentAttr = ɵshimContentAttribute(componentId);
615
615
  this.hostAttr = ɵshimHostAttribute(componentId);
@@ -670,8 +670,8 @@ class ServerStylesHost extends ɵSharedStylesHost {
670
670
  this._styleNodes = new Set();
671
671
  this.head = doc.getElementsByTagName('head')[0];
672
672
  }
673
- _addStyle(style) {
674
- let adapter = ɵgetDOM();
673
+ onStyleAdded(style) {
674
+ const adapter = ɵgetDOM();
675
675
  const el = adapter.createElement('style');
676
676
  el.textContent = style;
677
677
  if (!!this.transitionId) {
@@ -680,16 +680,15 @@ class ServerStylesHost extends ɵSharedStylesHost {
680
680
  this.head.appendChild(el);
681
681
  this._styleNodes.add(el);
682
682
  }
683
- onStylesAdded(additions) {
684
- additions.forEach(style => this._addStyle(style));
685
- }
686
683
  ngOnDestroy() {
687
684
  this._styleNodes.forEach(styleNode => styleNode.remove());
685
+ this._styleNodes.clear();
686
+ super.ngOnDestroy();
688
687
  }
689
688
  }
690
- ServerStylesHost.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.0-rc.0", ngImport: i0, type: ServerStylesHost, deps: [{ token: DOCUMENT }, { token: ɵTRANSITION_ID, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
691
- ServerStylesHost.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.0-rc.0", ngImport: i0, type: ServerStylesHost });
692
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.0-rc.0", ngImport: i0, type: ServerStylesHost, decorators: [{
689
+ ServerStylesHost.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.0", ngImport: i0, type: ServerStylesHost, deps: [{ token: DOCUMENT }, { token: ɵTRANSITION_ID, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
690
+ ServerStylesHost.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.0", ngImport: i0, type: ServerStylesHost });
691
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.0", ngImport: i0, type: ServerStylesHost, decorators: [{
693
692
  type: Injectable
694
693
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
695
694
  type: Inject,
@@ -721,15 +720,10 @@ function serializeTransferStateFactory(doc, appId, transferStore) {
721
720
  script.id = appId + '-state';
722
721
  script.setAttribute('type', 'application/json');
723
722
  script.textContent = ɵescapeHtml(content);
724
- const existingScript = doc.body.querySelector('script');
725
- if (existingScript) {
726
- // Insert the state script before any script so that the the script is available
727
- // before Angular is bootstrapped as otherwise this can causes the state not to be present.
728
- existingScript.before(script);
729
- }
730
- else {
731
- doc.body.appendChild(script);
732
- }
723
+ // It is intentional that we add the script at the very bottom. Angular CLI script tags for
724
+ // bundles are always `type="module"`. These are deferred by default and cause the transfer
725
+ // transfer data to be queried only after the browser has finished parsing the DOM.
726
+ doc.body.appendChild(script);
733
727
  };
734
728
  }
735
729
  /**
@@ -745,10 +739,10 @@ function serializeTransferStateFactory(doc, appId, transferStore) {
745
739
  */
746
740
  class ServerTransferStateModule {
747
741
  }
748
- ServerTransferStateModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.0-rc.0", ngImport: i0, type: ServerTransferStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
749
- ServerTransferStateModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.0-rc.0", ngImport: i0, type: ServerTransferStateModule });
750
- ServerTransferStateModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.0-rc.0", ngImport: i0, type: ServerTransferStateModule });
751
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.0-rc.0", ngImport: i0, type: ServerTransferStateModule, decorators: [{
742
+ ServerTransferStateModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.0", ngImport: i0, type: ServerTransferStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
743
+ ServerTransferStateModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.0-next.0", ngImport: i0, type: ServerTransferStateModule });
744
+ ServerTransferStateModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.0-next.0", ngImport: i0, type: ServerTransferStateModule });
745
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.0", ngImport: i0, type: ServerTransferStateModule, decorators: [{
752
746
  type: NgModule,
753
747
  args: [{}]
754
748
  }] });
@@ -791,9 +785,9 @@ const SERVER_RENDER_PROVIDERS = [
791
785
  */
792
786
  class ServerModule {
793
787
  }
794
- ServerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.0-rc.0", ngImport: i0, type: ServerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
795
- ServerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.0-rc.0", ngImport: i0, type: ServerModule, imports: [HttpClientModule, NoopAnimationsModule], exports: [BrowserModule] });
796
- ServerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.0-rc.0", ngImport: i0, type: ServerModule, providers: [
788
+ ServerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.0", ngImport: i0, type: ServerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
789
+ ServerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.0-next.0", ngImport: i0, type: ServerModule, imports: [HttpClientModule, NoopAnimationsModule], exports: [BrowserModule] });
790
+ ServerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.0-next.0", ngImport: i0, type: ServerModule, providers: [
797
791
  TRANSFER_STATE_SERIALIZATION_PROVIDERS,
798
792
  SERVER_RENDER_PROVIDERS,
799
793
  SERVER_HTTP_PROVIDERS,
@@ -801,7 +795,7 @@ ServerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
801
795
  { provide: ɵTESTABILITY, useValue: null },
802
796
  { provide: ViewportScroller, useClass: ɵNullViewportScroller },
803
797
  ], imports: [HttpClientModule, NoopAnimationsModule, BrowserModule] });
804
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.0-rc.0", ngImport: i0, type: ServerModule, decorators: [{
798
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.0", ngImport: i0, type: ServerModule, decorators: [{
805
799
  type: NgModule,
806
800
  args: [{
807
801
  exports: [BrowserModule],
@@ -988,7 +982,6 @@ function renderApplication(rootComponent, options) {
988
982
  const appProviders = [
989
983
  importProvidersFrom(BrowserModule.withServerTransition({ appId })),
990
984
  importProvidersFrom(ServerModule),
991
- ...TRANSFER_STATE_SERIALIZATION_PROVIDERS,
992
985
  ...(options.providers ?? []),
993
986
  ];
994
987
  return _render(platform, ɵinternalCreateApplication({ rootComponent, appProviders }));
@@ -1025,7 +1018,7 @@ function renderModuleFactory(moduleFactory, options) {
1025
1018
  /**
1026
1019
  * @publicApi
1027
1020
  */
1028
- const VERSION = new Version('15.2.0-rc.0');
1021
+ const VERSION = new Version('16.0.0-next.0');
1029
1022
 
1030
1023
  /// <reference types="node" />
1031
1024
  // This file only reexports content of the `src` folder. Keep it that way.