diff --git a/.pullapprove.yml b/.pullapprove.yml index 53b8aab37e..aa985a550b 100644 --- a/.pullapprove.yml +++ b/.pullapprove.yml @@ -366,7 +366,6 @@ groups: - > contains_any_globs(files, [ 'packages/common/http/**', - 'packages/http/**', 'packages/examples/http/**', 'aio/content/guide/http.md', 'aio/content/examples/http/**', diff --git a/docs/PUBLIC_API.md b/docs/PUBLIC_API.md index 399dd24676..be65edd1df 100644 --- a/docs/PUBLIC_API.md +++ b/docs/PUBLIC_API.md @@ -7,7 +7,6 @@ Our semver, timed-release cycle and deprecation policy currently applies to thes - `@angular/common` - `@angular/elements` - `@angular/forms` -- `@angular/http` - `@angular/platform-browser` - `@angular/platform-browser-dynamic` - `@angular/platform-server` diff --git a/goldens/public-api/http/http.d.ts b/goldens/public-api/http/http.d.ts deleted file mode 100644 index 432022b995..0000000000 --- a/goldens/public-api/http/http.d.ts +++ /dev/null @@ -1,259 +0,0 @@ -/** @deprecated */ -export declare class BaseRequestOptions extends RequestOptions { - constructor(); -} - -/** @deprecated */ -export declare class BaseResponseOptions extends ResponseOptions { - constructor(); -} - -/** @deprecated */ -export declare class BrowserXhr { - constructor(); - build(): any; -} - -/** @deprecated */ -export declare abstract class Connection { - readyState: ReadyState; - request: Request; - response: any; -} - -/** @deprecated */ -export declare abstract class ConnectionBackend { - abstract createConnection(request: any): Connection; -} - -/** @deprecated */ -export declare class CookieXSRFStrategy implements XSRFStrategy { - constructor(_cookieName?: string, _headerName?: string); - configureRequest(req: Request): void; -} - -/** @deprecated */ -export declare class Headers { - constructor(headers?: Headers | { - [name: string]: any; - } | null); - append(name: string, value: string): void; - delete(name: string): void; - entries(): void; - forEach(fn: (values: string[], name: string | undefined, headers: Map) => void): void; - get(name: string): string | null; - getAll(name: string): string[] | null; - has(name: string): boolean; - keys(): string[]; - set(name: string, value: string | string[]): void; - toJSON(): { - [name: string]: any; - }; - values(): string[][]; - static fromResponseHeaderString(headersString: string): Headers; -} - -/** @deprecated */ -export declare class Http { - protected _backend: ConnectionBackend; - protected _defaultOptions: RequestOptions; - constructor(_backend: ConnectionBackend, _defaultOptions: RequestOptions); - delete(url: string, options?: RequestOptionsArgs): Observable; - get(url: string, options?: RequestOptionsArgs): Observable; - head(url: string, options?: RequestOptionsArgs): Observable; - options(url: string, options?: RequestOptionsArgs): Observable; - patch(url: string, body: any, options?: RequestOptionsArgs): Observable; - post(url: string, body: any, options?: RequestOptionsArgs): Observable; - put(url: string, body: any, options?: RequestOptionsArgs): Observable; - request(url: string | Request, options?: RequestOptionsArgs): Observable; -} - -/** @deprecated */ -export declare class HttpModule { -} - -/** @deprecated */ -export declare class Jsonp extends Http { - constructor(backend: ConnectionBackend, defaultOptions: RequestOptions); - request(url: string | Request, options?: RequestOptionsArgs): Observable; -} - -/** @deprecated */ -export declare class JSONPBackend extends ConnectionBackend { - createConnection(request: Request): JSONPConnection; -} - -/** @deprecated */ -export declare class JSONPConnection implements Connection { - readyState: ReadyState; - request: Request; - response: Observable; - finished(data?: any): void; -} - -/** @deprecated */ -export declare class JsonpModule { -} - -/** @deprecated */ -export declare class QueryEncoder { - encodeKey(key: string): string; - encodeValue(value: string): string; -} - -/** @deprecated */ -export declare enum ReadyState { - Unsent = 0, - Open = 1, - HeadersReceived = 2, - Loading = 3, - Done = 4, - Cancelled = 5 -} - -/** @deprecated */ -export declare class Request extends ɵangular_packages_http_http_f { - headers: Headers; - method: RequestMethod; - responseType: ResponseContentType; - url: string; - withCredentials: boolean; - constructor(requestOptions: ɵangular_packages_http_http_d); - detectContentType(): ContentType; - detectContentTypeFromBody(): ContentType; - getBody(): any; -} - -/** @deprecated */ -export declare enum RequestMethod { - Get = 0, - Post = 1, - Put = 2, - Delete = 3, - Options = 4, - Head = 5, - Patch = 6 -} - -/** @deprecated */ -export declare class RequestOptions { - body: any; - headers: Headers | null; - method: RequestMethod | string | null; - params: URLSearchParams; - responseType: ResponseContentType | null; - /** @deprecated */ get search(): URLSearchParams; - /** @deprecated */ set search(params: URLSearchParams); - url: string | null; - withCredentials: boolean | null; - constructor(opts?: RequestOptionsArgs); - merge(options?: RequestOptionsArgs): RequestOptions; -} - -/** @deprecated */ -export declare interface RequestOptionsArgs { - body?: any; - headers?: Headers | null; - method?: string | RequestMethod | null; - params?: string | URLSearchParams | { - [key: string]: any | any[]; - } | null; - responseType?: ResponseContentType | null; - /** @deprecated */ search?: string | URLSearchParams | { - [key: string]: any | any[]; - } | null; - url?: string | null; - withCredentials?: boolean | null; -} - -/** @deprecated */ -export declare class Response extends ɵangular_packages_http_http_f { - bytesLoaded: number; - headers: Headers | null; - ok: boolean; - status: number; - statusText: string | null; - totalBytes: number; - type: ResponseType; - url: string; - constructor(responseOptions: ResponseOptions); - toString(): string; -} - -/** @deprecated */ -export declare enum ResponseContentType { - Text = 0, - Json = 1, - ArrayBuffer = 2, - Blob = 3 -} - -/** @deprecated */ -export declare class ResponseOptions { - body: string | Object | ArrayBuffer | Blob | null; - headers: Headers | null; - status: number | null; - url: string | null; - constructor(opts?: ResponseOptionsArgs); - merge(options?: ResponseOptionsArgs): ResponseOptions; -} - -/** @deprecated */ -export declare interface ResponseOptionsArgs { - body?: string | Object | FormData | ArrayBuffer | Blob | null; - headers?: Headers | null; - status?: number | null; - statusText?: string | null; - type?: ResponseType | null; - url?: string | null; -} - -/** @deprecated */ -export declare enum ResponseType { - Basic = 0, - Cors = 1, - Default = 2, - Error = 3, - Opaque = 4 -} - -/** @deprecated */ -export declare class URLSearchParams { - paramsMap: Map; - rawParams: string; - constructor(rawParams?: string, queryEncoder?: QueryEncoder); - append(param: string, val: string): void; - appendAll(searchParams: URLSearchParams): void; - clone(): URLSearchParams; - delete(param: string): void; - get(param: string): string | null; - getAll(param: string): string[]; - has(param: string): boolean; - replaceAll(searchParams: URLSearchParams): void; - set(param: string, val: string): void; - setAll(searchParams: URLSearchParams): void; - toString(): string; -} - -/** @deprecated */ -export declare const VERSION: Version; - -/** @deprecated */ -export declare class XHRBackend implements ConnectionBackend { - constructor(_browserXHR: BrowserXhr, _baseResponseOptions: ResponseOptions, _xsrfStrategy: XSRFStrategy); - createConnection(request: Request): XHRConnection; -} - -/** @deprecated */ -export declare class XHRConnection implements Connection { - readyState: ReadyState; - request: Request; - response: Observable; - constructor(req: Request, browserXHR: BrowserXhr, baseResponseOptions?: ResponseOptions); - setDetectedContentType(req: any /** TODO Request */, _xhr: any /** XMLHttpRequest */): void; -} - -/** @deprecated */ -export declare abstract class XSRFStrategy { - abstract configureRequest(req: Request): void; -} diff --git a/goldens/public-api/http/testing/testing.d.ts b/goldens/public-api/http/testing/testing.d.ts deleted file mode 100644 index 5b49506c1d..0000000000 --- a/goldens/public-api/http/testing/testing.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** @deprecated */ -export declare class MockBackend implements ConnectionBackend { - connections: any; - connectionsArray: MockConnection[]; - pendingConnections: any; - constructor(); - createConnection(req: Request): MockConnection; - resolveAllConnections(): void; - verifyNoPendingRequests(): void; -} - -/** @deprecated */ -export declare class MockConnection implements Connection { - readyState: ReadyState; - request: Request; - response: ReplaySubject; - constructor(req: Request); - mockDownload(res: Response): void; - mockError(err?: Error): void; - mockRespond(res: Response): void; -} diff --git a/integration/angular_integration_test.bzl b/integration/angular_integration_test.bzl index 8800251e80..646f18ccdd 100644 --- a/integration/angular_integration_test.bzl +++ b/integration/angular_integration_test.bzl @@ -44,7 +44,6 @@ GENERATED_NPM_PACKAGES = [ "@angular/core", "@angular/elements", "@angular/forms", - "@angular/http", "@angular/language-service", "@angular/localize", "@angular/platform-browser", diff --git a/modules/benchmarks/src/bootstrap_ng2.ts b/modules/benchmarks/src/bootstrap_ng2.ts index 5bd0a5c803..d0ae4cc50e 100644 --- a/modules/benchmarks/src/bootstrap_ng2.ts +++ b/modules/benchmarks/src/bootstrap_ng2.ts @@ -34,7 +34,6 @@ function benchmarksBootstrap() { '/packages-dist/platform-browser/bundles/platform-browser.umd.js', '@angular/platform-browser-dynamic': '/packages-dist/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js', - '@angular/http': '/packages-dist/http/bundles/http.umd.js', '@angular/upgrade': '/packages-dist/upgrade/bundles/upgrade.umd.js', '@angular/router': '/packages-dist/router/bundles/router.umd.js', 'rxjs': '/all/benchmarks/vendor/rxjs', diff --git a/modules/playground/src/jsonp/app/jsonp_comp.ts b/modules/playground/src/jsonp/app/jsonp_comp.ts index 6559378fd7..564e1c83b9 100644 --- a/modules/playground/src/jsonp/app/jsonp_comp.ts +++ b/modules/playground/src/jsonp/app/jsonp_comp.ts @@ -15,7 +15,7 @@ import {Component} from '@angular/core';

people

  • - hello, {{person['name']}} + hello, {{person.name}}
` diff --git a/packages/bazel/src/ng_package/ng_package.bzl b/packages/bazel/src/ng_package/ng_package.bzl index a692934e34..1aaa7b362b 100644 --- a/packages/bazel/src/ng_package/ng_package.bzl +++ b/packages/bazel/src/ng_package/ng_package.bzl @@ -110,8 +110,6 @@ WELL_KNOWN_GLOBALS = {p: _global_name(p) for p in [ "@angular/common/http/testing", "@angular/common/http", "@angular/elements", - "@angular/http/testing", - "@angular/http", "@angular/platform-browser-dynamic/testing", "@angular/platform-browser-dynamic", "@angular/compiler/testing", diff --git a/packages/compiler-cli/integrationtest/BUILD.bazel b/packages/compiler-cli/integrationtest/BUILD.bazel index 5774b13445..187cc2958b 100644 --- a/packages/compiler-cli/integrationtest/BUILD.bazel +++ b/packages/compiler-cli/integrationtest/BUILD.bazel @@ -56,7 +56,6 @@ nodejs_test( "//packages/compiler-cli:npm_package", "//packages/core:npm_package", "//packages/forms:npm_package", - "//packages/http:npm_package", "//packages/platform-browser:npm_package", "//packages/platform-browser-dynamic:npm_package", "//packages/platform-server:npm_package", diff --git a/packages/compiler-cli/integrationtest/test_helpers.js b/packages/compiler-cli/integrationtest/test_helpers.js index 2ab74b070a..c14f8c7e5e 100644 --- a/packages/compiler-cli/integrationtest/test_helpers.js +++ b/packages/compiler-cli/integrationtest/test_helpers.js @@ -28,7 +28,6 @@ const requiredNodeModules = { '@angular/compiler-cli': resolveNpmTreeArtifact('angular/packages/compiler-cli/npm_package'), '@angular/core': resolveNpmTreeArtifact('angular/packages/core/npm_package'), '@angular/forms': resolveNpmTreeArtifact('angular/packages/forms/npm_package'), - '@angular/http': resolveNpmTreeArtifact('angular/packages/http/npm_package'), '@angular/platform-browser': resolveNpmTreeArtifact('angular/packages/platform-browser/npm_package'), '@angular/platform-browser-dynamic': diff --git a/packages/http/BUILD.bazel b/packages/http/BUILD.bazel deleted file mode 100644 index cfec8fa5bf..0000000000 --- a/packages/http/BUILD.bazel +++ /dev/null @@ -1,54 +0,0 @@ -load("//tools:defaults.bzl", "ng_module", "ng_package", "ts_api_guardian_test_npm_package") - -package(default_visibility = ["//visibility:public"]) - -ng_module( - name = "http", - srcs = glob( - [ - "*.ts", - "src/**/*.ts", - ], - ), - # Disable building with strict compatibility as the http package is no longer - # maintained and therefore not needed to be made compatible with --strict. - tsconfig = "//packages:tsconfig-build-no-strict", - deps = [ - "//packages/core", - "//packages/platform-browser", - "@npm//rxjs", - ], -) - -ng_package( - name = "npm_package", - srcs = [ - "package.json", - "//packages/http/testing:package.json", - ], - entry_point = ":index.ts", - tags = [ - # Currently the plan for Angular v8 is to exclude @angular/http package from publishing - # "release-with-framework", - ], - # Do not add more to this list. - # Dependencies on the full npm_package cause long re-builds. - visibility = [ - "//integration:__pkg__", - "//packages/compiler-cli/integrationtest:__pkg__", - ], - deps = [ - ":http", - "//packages/http/testing", - ], -) - -ts_api_guardian_test_npm_package( - name = "http_api", - actualDir = "angular/packages/http/npm_package", - data = [ - ":npm_package", - "//goldens:public-api", - ], - goldenDir = "angular/goldens/public-api/http", -) diff --git a/packages/http/PACKAGE.md b/packages/http/PACKAGE.md deleted file mode 100644 index 4263f44ade..0000000000 --- a/packages/http/PACKAGE.md +++ /dev/null @@ -1 +0,0 @@ -Deprecated in favor of `@angular/common/http`. \ No newline at end of file diff --git a/packages/http/index.ts b/packages/http/index.ts deleted file mode 100644 index e727e2e8a7..0000000000 --- a/packages/http/index.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * @license - * Copyright Google Inc. All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - -// This file is not used to build this module. It is only used during editing -// by the TypeScript language service and during build for verification. `ngc` -// replaces this file with production index.ts when it rewrites private symbol -// names. - -export * from './public_api'; diff --git a/packages/http/package.json b/packages/http/package.json deleted file mode 100644 index 669c9a47f2..0000000000 --- a/packages/http/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "@angular/http", - "version": "0.0.0-PLACEHOLDER", - "description": "Angular - the http service", - "main": "./bundles/http.umd.js", - "module": "./fesm5/http.js", - "es2015": "./fesm2015/http.js", - "esm5": "./esm5/http.js", - "esm2015": "./esm2015/http.js", - "fesm5": "./fesm5/http.js", - "fesm2015": "./fesm2015/http.js", - "typings": "./http.d.ts", - "author": "angular", - "license": "MIT", - "peerDependencies": { - "@angular/core": "0.0.0-PLACEHOLDER", - "@angular/platform-browser": "0.0.0-PLACEHOLDER", - "rxjs": "^6.5.3", - "tslib": "^1.10.0" - }, - "repository": { - "type": "git", - "url": "https://github.com/angular/angular.git", - "repository": "packages/http" - }, - "ng-update": { - "packageGroup": "NG_UPDATE_PACKAGE_GROUP" - }, - "sideEffects": false, - "publishConfig":{ - "registry":"https://wombat-dressing-room.appspot.com" - } -} diff --git a/packages/http/public_api.ts b/packages/http/public_api.ts deleted file mode 100644 index 778427176d..0000000000 --- a/packages/http/public_api.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * @license - * Copyright Google Inc. All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - -/** - * @module - * @description - * Entry point for all public APIs of this package. - */ -export * from './src/index'; - -// This file only reexports content of the `src` folder. Keep it that way. diff --git a/packages/http/src/backends/browser_jsonp.ts b/packages/http/src/backends/browser_jsonp.ts deleted file mode 100644 index ab7f208239..0000000000 --- a/packages/http/src/backends/browser_jsonp.ts +++ /dev/null @@ -1,62 +0,0 @@ -/** - * @license - * Copyright Google Inc. All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - -import {Injectable} from '@angular/core'; - -let _nextRequestId = 0; -export const JSONP_HOME = '__ng_jsonp__'; -let _jsonpConnections: {[key: string]: any}|null = null; - -function _getJsonpConnections(): {[key: string]: any} { - const w: {[key: string]: any} = typeof window == 'object' ? window : {}; - if (_jsonpConnections === null) { - _jsonpConnections = w[JSONP_HOME] = {}; - } - return _jsonpConnections; -} - -// Make sure not to evaluate this in a non-browser environment! -@Injectable() -export class BrowserJsonp { - // Construct a