55 * Use of this source code is governed by an MIT-style license that can be
66 * found in the LICENSE file at https://angular.io/license
77 */
8+ import '@angular/compiler' ;
89
910import { animate , AnimationBuilder , state , style , transition , trigger } from '@angular/animations' ;
1011import { DOCUMENT , isPlatformServer , PlatformLocation , ɵgetDOM as getDOM } from '@angular/common' ;
@@ -14,7 +15,7 @@ import {ApplicationConfig, ApplicationRef, Component, destroyPlatform, Environme
1415import { InitialRenderPendingTasks } from '@angular/core/src/initial_render_pending_tasks' ;
1516import { TestBed } from '@angular/core/testing' ;
1617import { bootstrapApplication , BrowserModule , provideClientHydration , Title , withNoDomReuse , withNoHttpTransferCache } from '@angular/platform-browser' ;
17- import { BEFORE_APP_SERIALIZED , INITIAL_CONFIG , platformDynamicServer , PlatformState , provideServerRendering , renderModule , ServerModule } from '@angular/platform-server' ;
18+ import { BEFORE_APP_SERIALIZED , INITIAL_CONFIG , platformServer , PlatformState , provideServerRendering , renderModule , ServerModule } from '@angular/platform-server' ;
1819import { provideRouter , RouterOutlet , Routes } from '@angular/router' ;
1920import { Observable } from 'rxjs' ;
2021import { first } from 'rxjs/operators' ;
@@ -536,7 +537,7 @@ describe('platform-server integration', () => {
536537
537538 it ( 'should bootstrap' , async ( ) => {
538539 const platform =
539- platformDynamicServer ( [ { provide : INITIAL_CONFIG , useValue : { document : '<app></app>' } } ] ) ;
540+ platformServer ( [ { provide : INITIAL_CONFIG , useValue : { document : '<app></app>' } } ] ) ;
540541
541542 const moduleRef = await platform . bootstrapModule ( ExampleModule ) ;
542543 expect ( isPlatformServer ( moduleRef . injector . get ( PLATFORM_ID ) ) ) . toBe ( true ) ;
@@ -552,10 +553,10 @@ describe('platform-server integration', () => {
552553
553554 it ( 'should allow multiple platform instances' , async ( ) => {
554555 const platform =
555- platformDynamicServer ( [ { provide : INITIAL_CONFIG , useValue : { document : '<app></app>' } } ] ) ;
556+ platformServer ( [ { provide : INITIAL_CONFIG , useValue : { document : '<app></app>' } } ] ) ;
556557
557558 const platform2 =
558- platformDynamicServer ( [ { provide : INITIAL_CONFIG , useValue : { document : '<app></app>' } } ] ) ;
559+ platformServer ( [ { provide : INITIAL_CONFIG , useValue : { document : '<app></app>' } } ] ) ;
559560
560561
561562 await platform . bootstrapModule ( ExampleModule ) . then ( ( moduleRef ) => {
@@ -572,7 +573,7 @@ describe('platform-server integration', () => {
572573 } ) ;
573574
574575 it ( 'adds title to the document using Title service' , async ( ) => {
575- const platform = platformDynamicServer ( [ {
576+ const platform = platformServer ( [ {
576577 provide : INITIAL_CONFIG ,
577578 useValue : { document : '<html><head><title></title></head><body><app></app></body></html>' }
578579 } ] ) ;
@@ -586,7 +587,7 @@ describe('platform-server integration', () => {
586587 } ) ;
587588
588589 it ( 'should get base href from document' , async ( ) => {
589- const platform = platformDynamicServer ( [ {
590+ const platform = platformServer ( [ {
590591 provide : INITIAL_CONFIG ,
591592 useValue : { document : '<html><head><base href="/"></head><body><app></app></body></html>' }
592593 } ] ) ;
@@ -597,7 +598,7 @@ describe('platform-server integration', () => {
597598 } ) ;
598599
599600 it ( 'adds styles with ng-app-id attribute' , async ( ) => {
600- const platform = platformDynamicServer ( [ {
601+ const platform = platformServer ( [ {
601602 provide : INITIAL_CONFIG ,
602603 useValue : { document : '<html><head></head><body><app></app></body></html>' }
603604 } ] ) ;
@@ -612,7 +613,7 @@ describe('platform-server integration', () => {
612613
613614 it ( 'copies known properties to attributes' , async ( ) => {
614615 const platform =
615- platformDynamicServer ( [ { provide : INITIAL_CONFIG , useValue : { document : '<app></app>' } } ] ) ;
616+ platformServer ( [ { provide : INITIAL_CONFIG , useValue : { document : '<app></app>' } } ] ) ;
616617 const ref = await platform . bootstrapModule ( ImageExampleModule ) ;
617618 const appRef : ApplicationRef = ref . injector . get ( ApplicationRef ) ;
618619 const app = appRef . components [ 0 ] . location . nativeElement ;
@@ -623,14 +624,14 @@ describe('platform-server integration', () => {
623624 describe ( 'PlatformLocation' , ( ) => {
624625 it ( 'is injectable' , async ( ) => {
625626 const platform =
626- platformDynamicServer ( [ { provide : INITIAL_CONFIG , useValue : { document : '<app></app>' } } ] ) ;
627+ platformServer ( [ { provide : INITIAL_CONFIG , useValue : { document : '<app></app>' } } ] ) ;
627628 const appRef = await platform . bootstrapModule ( ExampleModule ) ;
628629 const location = appRef . injector . get ( PlatformLocation ) ;
629630 expect ( location . pathname ) . toBe ( '/' ) ;
630631 platform . destroy ( ) ;
631632 } ) ;
632633 it ( 'is configurable via INITIAL_CONFIG' , async ( ) => {
633- const platform = platformDynamicServer ( [ {
634+ const platform = platformServer ( [ {
634635 provide : INITIAL_CONFIG ,
635636 useValue : { document : '<app></app>' , url : 'http://test.com/deep/path?query#hash' }
636637 } ] ) ;
@@ -644,7 +645,7 @@ describe('platform-server integration', () => {
644645 } ) ;
645646
646647 it ( 'parses component pieces of a URL' , async ( ) => {
647- const platform = platformDynamicServer ( [ {
648+ const platform = platformServer ( [ {
648649 provide : INITIAL_CONFIG ,
649650 useValue : { document : '<app></app>' , url : 'http://test.com:80/deep/path?query#hash' }
650651 } ] ) ;
@@ -661,7 +662,7 @@ describe('platform-server integration', () => {
661662 } ) ;
662663
663664 it ( 'handles empty search and hash portions of the url' , async ( ) => {
664- const platform = platformDynamicServer ( [ {
665+ const platform = platformServer ( [ {
665666 provide : INITIAL_CONFIG ,
666667 useValue : { document : '<app></app>' , url : 'http://test.com/deep/path' }
667668 } ] ) ;
@@ -676,7 +677,7 @@ describe('platform-server integration', () => {
676677
677678 it ( 'pushState causes the URL to update' , async ( ) => {
678679 const platform =
679- platformDynamicServer ( [ { provide : INITIAL_CONFIG , useValue : { document : '<app></app>' } } ] ) ;
680+ platformServer ( [ { provide : INITIAL_CONFIG , useValue : { document : '<app></app>' } } ] ) ;
680681
681682 const appRef = await platform . bootstrapModule ( ExampleModule ) ;
682683 const location = appRef . injector . get ( PlatformLocation ) ;
@@ -688,7 +689,7 @@ describe('platform-server integration', () => {
688689
689690 it ( 'allows subscription to the hash state' , done => {
690691 const platform =
691- platformDynamicServer ( [ { provide : INITIAL_CONFIG , useValue : { document : '<app></app>' } } ] ) ;
692+ platformServer ( [ { provide : INITIAL_CONFIG , useValue : { document : '<app></app>' } } ] ) ;
692693 platform . bootstrapModule ( ExampleModule ) . then ( appRef => {
693694 const location : PlatformLocation = appRef . injector . get ( PlatformLocation ) ;
694695 expect ( location . pathname ) . toBe ( '/' ) ;
@@ -715,8 +716,7 @@ describe('platform-server integration', () => {
715716 } ) ;
716717
717718 it ( 'using long form should work' , async ( ) => {
718- const platform =
719- platformDynamicServer ( [ { provide : INITIAL_CONFIG , useValue : { document : doc } } ] ) ;
719+ const platform = platformServer ( [ { provide : INITIAL_CONFIG , useValue : { document : doc } } ] ) ;
720720
721721 const moduleRef = await platform . bootstrapModule ( AsyncServerModule ) ;
722722 const applicationRef = moduleRef . injector . get ( ApplicationRef ) ;
@@ -1118,14 +1118,14 @@ describe('platform-server integration', () => {
11181118 describe ( 'HttpClient' , ( ) => {
11191119 it ( 'can inject HttpClient' , async ( ) => {
11201120 const platform =
1121- platformDynamicServer ( [ { provide : INITIAL_CONFIG , useValue : { document : '<app></app>' } } ] ) ;
1121+ platformServer ( [ { provide : INITIAL_CONFIG , useValue : { document : '<app></app>' } } ] ) ;
11221122 const ref = await platform . bootstrapModule ( HttpClientExampleModule ) ;
11231123 expect ( ref . injector . get ( HttpClient ) instanceof HttpClient ) . toBeTruthy ( ) ;
11241124 } ) ;
11251125
11261126 it ( 'can make HttpClient requests' , async ( ) => {
11271127 const platform =
1128- platformDynamicServer ( [ { provide : INITIAL_CONFIG , useValue : { document : '<app></app>' } } ] ) ;
1128+ platformServer ( [ { provide : INITIAL_CONFIG , useValue : { document : '<app></app>' } } ] ) ;
11291129 await platform . bootstrapModule ( HttpClientExampleModule ) . then ( ref => {
11301130 const mock = ref . injector . get ( HttpTestingController ) as HttpTestingController ;
11311131 const http = ref . injector . get ( HttpClient ) ;
@@ -1141,7 +1141,7 @@ describe('platform-server integration', () => {
11411141
11421142 it ( 'can use HttpInterceptor that injects HttpClient' , async ( ) => {
11431143 const platform =
1144- platformDynamicServer ( [ { provide : INITIAL_CONFIG , useValue : { document : '<app></app>' } } ] ) ;
1144+ platformServer ( [ { provide : INITIAL_CONFIG , useValue : { document : '<app></app>' } } ] ) ;
11451145 await platform . bootstrapModule ( HttpInterceptorExampleModule ) . then ( ref => {
11461146 const mock = ref . injector . get ( HttpTestingController ) as HttpTestingController ;
11471147 const http = ref . injector . get ( HttpClient ) ;
0 commit comments