Skip to content

Commit

Permalink
fix(@schematics/angular): don't export renderModuleFactory from ser…
Browse files Browse the repository at this point in the history
…ver file

Using `renderModuleFactory` is no longer needed since this was used for ViewEngine.

(cherry picked from commit 94c00af)
  • Loading branch information
alan-agius4 committed Oct 7, 2021
1 parent 98a6493 commit e58226e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
Expand Up @@ -16,4 +16,4 @@ if (environment.production) {
}

export { AppServerModule } from './app/app.server.module';
export { renderModule, renderModuleFactory } from '@angular/platform-server';
export { renderModule } from '@angular/platform-server';
Expand Up @@ -21,4 +21,4 @@ if (environment.production) {
}

export { <%= rootModuleClassName %> } from './app/<%= stripTsExtension(rootModuleFileName) %>';
export { renderModule, renderModuleFactory } from '@angular/platform-server';
export { renderModule } from '@angular/platform-server';
13 changes: 7 additions & 6 deletions tests/legacy-cli/e2e/tests/build/build-app-shell.ts
Expand Up @@ -6,17 +6,18 @@ import { ng } from '../../utils/process';
import { updateJsonFile } from '../../utils/project';
import { readNgVersion } from '../../utils/version';

export default function() {
export default function () {
let platformServerVersion = readNgVersion();

if (getGlobalVariable('argv')['ng-snapshots']) {
platformServerVersion = require('../../ng-snapshot/package.json')
.dependencies['@angular/platform-server'];
platformServerVersion = require('../../ng-snapshot/package.json').dependencies[
'@angular/platform-server'
];
}

return Promise.resolve()
.then(() =>
updateJsonFile('angular.json', workspaceJson => {
updateJsonFile('angular.json', (workspaceJson) => {
const appArchitect = workspaceJson.projects['test-project'].architect;
appArchitect['server'] = {
builder: '@angular-devkit/build-angular:server',
Expand Down Expand Up @@ -74,7 +75,7 @@ export default function() {
}
export { AppServerModule } from './app/app.server.module';
export { renderModule, renderModuleFactory } from '@angular/platform-server';
export { renderModule } from '@angular/platform-server';
`,
),
)
Expand Down Expand Up @@ -157,7 +158,7 @@ export default function() {
),
)
.then(() =>
updateJsonFile('package.json', packageJson => {
updateJsonFile('package.json', (packageJson) => {
const dependencies = packageJson['dependencies'];
dependencies['@angular/platform-server'] = platformServerVersion;
}).then(() => installWorkspacePackages()),
Expand Down

0 comments on commit e58226e

Please sign in to comment.