Skip to content

Commit e42d841

Browse files
committed
refactor(@angular/ssr): remove custom Platform Server creation Logic
Replaced the custom logic for creating the platform server with the standard `platformServer` method. (cherry picked from commit 1fc8fde)
1 parent b31787a commit e42d841

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

packages/angular/ssr/src/routes/ng-routes.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,11 @@ import {
1111
ApplicationRef,
1212
Compiler,
1313
Injector,
14-
createPlatformFactory,
15-
platformCore,
1614
runInInjectionContext,
1715
ɵwhenStable as whenStable,
1816
ɵConsole,
1917
} from '@angular/core';
20-
import {
21-
INITIAL_CONFIG,
22-
ɵINTERNAL_SERVER_PLATFORM_PROVIDERS as INTERNAL_SERVER_PLATFORM_PROVIDERS,
23-
} from '@angular/platform-server';
18+
import { INITIAL_CONFIG, platformServer } from '@angular/platform-server';
2419
import { Route, Router, ɵloadChildren as loadChildrenHelper } from '@angular/router';
2520
import { ServerAssets } from '../assets';
2621
import { Console } from '../console';
@@ -377,7 +372,7 @@ export async function getRoutesFromAngularRouterConfig(
377372
const { protocol, host } = url;
378373

379374
// Create and initialize the Angular platform for server-side rendering.
380-
const platformRef = createPlatformFactory(platformCore, 'server', [
375+
const platformRef = platformServer([
381376
{
382377
provide: INITIAL_CONFIG,
383378
useValue: { document, url: `${protocol}//${host}/` },
@@ -386,8 +381,7 @@ export async function getRoutesFromAngularRouterConfig(
386381
provide: ɵConsole,
387382
useFactory: () => new Console(),
388383
},
389-
...INTERNAL_SERVER_PLATFORM_PROVIDERS,
390-
])();
384+
]);
391385

392386
try {
393387
let applicationRef: ApplicationRef;

0 commit comments

Comments
 (0)