Skip to content

Commit

Permalink
feat(@schematics/angular): remove @angular/http as it's deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
lacolaco authored and alexeagle committed Oct 15, 2018
1 parent 3ae3fa3 commit 1a6b471
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 3 deletions.
1 change: 0 additions & 1 deletion packages/schematics/angular/workspace/files/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"@angular/compiler": "<%= experimentalAngularNext ? 'next' : latestVersions.Angular %>",
"@angular/core": "<%= experimentalAngularNext ? 'next' : latestVersions.Angular %>",
"@angular/forms": "<%= experimentalAngularNext ? 'next' : latestVersions.Angular %>",
"@angular/http": "<%= experimentalAngularNext ? 'next' : latestVersions.Angular %>",
"@angular/platform-browser": "<%= experimentalAngularNext ? 'next' : latestVersions.Angular %>",
"@angular/platform-browser-dynamic": "<%= experimentalAngularNext ? 'next' : latestVersions.Angular %>",
"@angular/router": "<%= experimentalAngularNext ? 'next' : latestVersions.Angular %>",
Expand Down
4 changes: 2 additions & 2 deletions tests/legacy-cli/e2e/tests/basic/rebuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default function() {
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { HttpClientModule } from '@angular/common/http';
import { AppComponent } from './app.component';
import { RouterModule } from '@angular/router';
Expand All @@ -46,7 +46,7 @@ export default function() {
imports: [
BrowserModule,
FormsModule,
HttpModule,
HttpClientModule,
RouterModule.forRoot([
{ path: 'lazy', loadChildren: './lazy/lazy.module#LazyModule' }
])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ export default function () {
}

let platformServerVersion = readNgVersion();
let httpVersion = readNgVersion();

if (getGlobalVariable('argv')['ng-snapshots']) {
platformServerVersion = 'github:angular/platform-server-builds';
httpVersion = 'github:angular/http-builds';
}


Expand All @@ -33,6 +35,8 @@ export default function () {
.then(() => updateJsonFile('package.json', packageJson => {
const dependencies = packageJson['dependencies'];
dependencies['@angular/platform-server'] = platformServerVersion;
// ServerModule depends on @angular/http regardless the app's dependency.
dependencies['@angular/http'] = httpVersion;
})
.then(() => npm('install'))
.then(() => ng('build', '--optimization'))
Expand Down
4 changes: 4 additions & 0 deletions tests/legacy-cli/e2e/tests/build/build-app-shell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ export default function () {
}

let platformServerVersion = readNgVersion();
let httpVersion = readNgVersion();

if (getGlobalVariable('argv')['ng-snapshots']) {
platformServerVersion = 'github:angular/platform-server-builds';
httpVersion = 'github:angular/http-builds';
}

return Promise.resolve()
Expand Down Expand Up @@ -134,6 +136,8 @@ export default function () {
.then(() => updateJsonFile('package.json', packageJson => {
const dependencies = packageJson['dependencies'];
dependencies['@angular/platform-server'] = platformServerVersion;
// ServerModule depends on @angular/http regardless the app's dependency.
dependencies['@angular/http'] = httpVersion;
})
.then(() => npm('install')))
.then(() => ng('run', 'test-project:app-shell'))
Expand Down
4 changes: 4 additions & 0 deletions tests/legacy-cli/e2e/tests/build/platform-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ export default function () {
}

let platformServerVersion = readNgVersion();
let httpVersion = readNgVersion();

if (getGlobalVariable('argv')['ng-snapshots']) {
platformServerVersion = 'github:angular/platform-server-builds';
httpVersion = 'github:angular/http-builds';
}

// Skip this test in Angular 2/4.
Expand All @@ -34,6 +36,8 @@ export default function () {
.then(() => updateJsonFile('package.json', packageJson => {
const dependencies = packageJson['dependencies'];
dependencies['@angular/platform-server'] = platformServerVersion;
// ServerModule depends on @angular/http regardless the app's dependency.
dependencies['@angular/http'] = httpVersion;
}))
.then(() => updateJsonFile('angular.json', workspaceJson => {
const appArchitect = workspaceJson.projects['test-project'].architect;
Expand Down

0 comments on commit 1a6b471

Please sign in to comment.