@angular/platform-server 16.1.0-next.2 → 16.1.0-rc.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,15 +1,15 @@
1
1
  /**
2
- * @license Angular v16.1.0-next.2
2
+ * @license Angular v16.1.0-rc.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, ɵgetDOM, ɵPLATFORM_SERVER_ID, PlatformLocation, ViewportScroller, ɵNullViewportScroller } from '@angular/common';
8
8
  import * as i0 from '@angular/core';
9
- import { Injectable, Inject, InjectionToken, Optional, APP_ID, TransferState, NgModule, Injector, PLATFORM_ID, PLATFORM_INITIALIZER, ɵALLOW_MULTIPLE_PLATFORMS, Testability, ɵTESTABILITY, ɵsetDocument, createPlatformFactory, platformCore, makeEnvironmentProviders, ɵENABLED_SSR_FEATURES, Renderer2, ɵInitialRenderPendingTasks, ɵIS_HYDRATION_DOM_REUSE_ENABLED, ɵannotateForHydration, ApplicationRef, Version } from '@angular/core';
9
+ import { Injectable, Inject, InjectionToken, Optional, APP_ID, TransferState, NgModule, Injector, PLATFORM_ID, PLATFORM_INITIALIZER, ɵALLOW_MULTIPLE_PLATFORMS, Testability, ɵTESTABILITY, ɵsetDocument, createPlatformFactory, platformCore, makeEnvironmentProviders, ɵENABLED_SSR_FEATURES, Renderer2, ɵIS_HYDRATION_DOM_REUSE_ENABLED, ɵannotateForHydration, ApplicationRef, Version } from '@angular/core';
10
10
  import { ɵBrowserDomAdapter, EVENT_MANAGER_PLUGINS, BrowserModule } from '@angular/platform-browser';
11
- import { HttpClientModule, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
12
11
  import { NoopAnimationsModule, provideNoopAnimations } from '@angular/platform-browser/animations';
12
+ import { HttpClientModule } from '@angular/common/http';
13
13
  import { Subject } from 'rxjs';
14
14
  import * as url from 'url';
15
15
  import { first } from 'rxjs/operators';
@@ -16189,10 +16189,10 @@ class PlatformState {
16189
16189
  getDocument() {
16190
16190
  return this._doc;
16191
16191
  }
16192
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.0-next.2", ngImport: i0, type: PlatformState, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
16193
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.0-next.2", ngImport: i0, type: PlatformState }); }
16192
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.0-rc.0", ngImport: i0, type: PlatformState, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
16193
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.0-rc.0", ngImport: i0, type: PlatformState }); }
16194
16194
  }
16195
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.0-next.2", ngImport: i0, type: PlatformState, decorators: [{
16195
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.0-rc.0", ngImport: i0, type: PlatformState, decorators: [{
16196
16196
  type: Injectable
16197
16197
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
16198
16198
  type: Inject,
@@ -16217,10 +16217,10 @@ class ServerXhr {
16217
16217
  }
16218
16218
  return new impl.XMLHttpRequest();
16219
16219
  }
16220
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.0-next.2", ngImport: i0, type: ServerXhr, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
16221
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.0-next.2", ngImport: i0, type: ServerXhr }); }
16220
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.0-rc.0", ngImport: i0, type: ServerXhr, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
16221
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.0-rc.0", ngImport: i0, type: ServerXhr }); }
16222
16222
  }
16223
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.0-next.2", ngImport: i0, type: ServerXhr, decorators: [{
16223
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.0-rc.0", ngImport: i0, type: ServerXhr, decorators: [{
16224
16224
  type: Injectable
16225
16225
  }] });
16226
16226
  const SERVER_HTTP_PROVIDERS = [
@@ -16335,10 +16335,10 @@ class ServerPlatformLocation {
16335
16335
  getState() {
16336
16336
  return undefined;
16337
16337
  }
16338
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.0-next.2", ngImport: i0, type: ServerPlatformLocation, deps: [{ token: DOCUMENT }, { token: INITIAL_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
16339
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.0-next.2", ngImport: i0, type: ServerPlatformLocation }); }
16338
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.0-rc.0", ngImport: i0, type: ServerPlatformLocation, deps: [{ token: DOCUMENT }, { token: INITIAL_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
16339
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.0-rc.0", ngImport: i0, type: ServerPlatformLocation }); }
16340
16340
  }
16341
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.0-next.2", ngImport: i0, type: ServerPlatformLocation, decorators: [{
16341
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.0-rc.0", ngImport: i0, type: ServerPlatformLocation, decorators: [{
16342
16342
  type: Injectable
16343
16343
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
16344
16344
  type: Inject,
@@ -16364,10 +16364,10 @@ class ServerEventManagerPlugin /* extends EventManagerPlugin which is private */
16364
16364
  addEventListener(element, eventName, handler) {
16365
16365
  return ɵgetDOM().onAndCancel(element, eventName, handler);
16366
16366
  }
16367
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.0-next.2", ngImport: i0, type: ServerEventManagerPlugin /* extends EventManagerPlugin which is private */, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
16368
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.0-next.2", ngImport: i0, type: ServerEventManagerPlugin /* extends EventManagerPlugin which is private */ }); }
16367
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.0-rc.0", ngImport: i0, type: ServerEventManagerPlugin /* extends EventManagerPlugin which is private */, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
16368
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.0-rc.0", ngImport: i0, type: ServerEventManagerPlugin /* extends EventManagerPlugin which is private */ }); }
16369
16369
  }
16370
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.0-next.2", ngImport: i0, type: ServerEventManagerPlugin /* extends EventManagerPlugin which is private */, decorators: [{
16370
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.0-rc.0", ngImport: i0, type: ServerEventManagerPlugin /* extends EventManagerPlugin which is private */, decorators: [{
16371
16371
  type: Injectable
16372
16372
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
16373
16373
  type: Inject,
@@ -16412,11 +16412,11 @@ function serializeTransferStateFactory(doc, appId, transferStore) {
16412
16412
  * this module.
16413
16413
  */
16414
16414
  class ServerTransferStateModule {
16415
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.0-next.2", ngImport: i0, type: ServerTransferStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
16416
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.0-next.2", ngImport: i0, type: ServerTransferStateModule }); }
16417
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.0-next.2", ngImport: i0, type: ServerTransferStateModule }); }
16415
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.0-rc.0", ngImport: i0, type: ServerTransferStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
16416
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.0-rc.0", ngImport: i0, type: ServerTransferStateModule }); }
16417
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.0-rc.0", ngImport: i0, type: ServerTransferStateModule }); }
16418
16418
  }
16419
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.0-next.2", ngImport: i0, type: ServerTransferStateModule, decorators: [{
16419
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.0-rc.0", ngImport: i0, type: ServerTransferStateModule, decorators: [{
16420
16420
  type: NgModule,
16421
16421
  args: [{}]
16422
16422
  }] });
@@ -16455,11 +16455,11 @@ const PLATFORM_SERVER_PROVIDERS = [
16455
16455
  * @publicApi
16456
16456
  */
16457
16457
  class ServerModule {
16458
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.0-next.2", ngImport: i0, type: ServerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
16459
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.0-next.2", ngImport: i0, type: ServerModule, imports: [HttpClientModule, NoopAnimationsModule], exports: [BrowserModule] }); }
16460
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.0-next.2", ngImport: i0, type: ServerModule, providers: PLATFORM_SERVER_PROVIDERS, imports: [HttpClientModule, NoopAnimationsModule, BrowserModule] }); }
16458
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.0-rc.0", ngImport: i0, type: ServerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
16459
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.0-rc.0", ngImport: i0, type: ServerModule, imports: [HttpClientModule, NoopAnimationsModule], exports: [BrowserModule] }); }
16460
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.0-rc.0", ngImport: i0, type: ServerModule, providers: PLATFORM_SERVER_PROVIDERS, imports: [HttpClientModule, NoopAnimationsModule, BrowserModule] }); }
16461
16461
  }
16462
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.0-next.2", ngImport: i0, type: ServerModule, decorators: [{
16462
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.0-rc.0", ngImport: i0, type: ServerModule, decorators: [{
16463
16463
  type: NgModule,
16464
16464
  args: [{
16465
16465
  exports: [BrowserModule],
@@ -16512,7 +16512,6 @@ const platformDynamicServer = platformServer;
16512
16512
  */
16513
16513
  function provideServerRendering() {
16514
16514
  return makeEnvironmentProviders([
16515
- provideHttpClient(withInterceptorsFromDi()),
16516
16515
  provideNoopAnimations(),
16517
16516
  ...PLATFORM_SERVER_PROVIDERS,
16518
16517
  ]);
@@ -16551,11 +16550,8 @@ function appendServerContextInfo(applicationRef) {
16551
16550
  }
16552
16551
  async function _render(platformRef, applicationRef) {
16553
16552
  const environmentInjector = applicationRef.injector;
16554
- const isStablePromise = applicationRef.isStable.pipe((first((isStable) => isStable))).toPromise();
16555
- const pendingTasks = environmentInjector.get(ɵInitialRenderPendingTasks);
16556
- const pendingTasksPromise = pendingTasks.whenAllTasksComplete;
16557
16553
  // Block until application is stable.
16558
- await Promise.allSettled([isStablePromise, pendingTasksPromise]);
16554
+ await applicationRef.isStable.pipe((first((isStable) => isStable))).toPromise();
16559
16555
  const platformState = platformRef.injector.get(PlatformState);
16560
16556
  if (applicationRef.injector.get(ɵIS_HYDRATION_DOM_REUSE_ENABLED, false)) {
16561
16557
  ɵannotateForHydration(applicationRef, platformState.getDocument());
@@ -16586,7 +16582,14 @@ async function _render(platformRef, applicationRef) {
16586
16582
  }
16587
16583
  appendServerContextInfo(applicationRef);
16588
16584
  const output = platformState.renderToString();
16589
- platformRef.destroy();
16585
+ // Destroy the application in a macrotask, this allows pending promises to be settled and errors
16586
+ // to be surfaced to the users.
16587
+ await new Promise((resolve) => {
16588
+ setTimeout(() => {
16589
+ platformRef.destroy();
16590
+ resolve();
16591
+ }, 0);
16592
+ });
16590
16593
  return output;
16591
16594
  }
16592
16595
  /**
@@ -16662,7 +16665,7 @@ async function renderApplication(bootstrap, options) {
16662
16665
  /**
16663
16666
  * @publicApi
16664
16667
  */
16665
- const VERSION = new Version('16.1.0-next.2');
16668
+ const VERSION = new Version('16.1.0-rc.0');
16666
16669
 
16667
16670
  /// <reference types="node" />
16668
16671
  // This file only reexports content of the `src` folder. Keep it that way.