fix(common): temporarily re-export and deprecate XhrFactory (#41393)

The moved `XhrFactory` still needs to be available from `@angular/common/http`
for some libraries that were built prior to 12.0.0, otherwise they cannot be
used in applications built post-12.0.0.

This commit adds back the re-export of `XhrFactory` and deprecates it.

PR Close #41393
This commit is contained in:
Pete Bacon Darwin
2021-03-31 11:09:35 +01:00
committed by Alex Rickabaugh
parent 6391a4a49d
commit 7dfa446c4a
3 changed files with 34 additions and 1 deletions
+21
View File
@@ -6,6 +6,27 @@
* found in the LICENSE file at https://angular.io/license
*/
import {XhrFactory as XhrFactory_fromAngularCommon} from '@angular/common';
/**
* A wrapper around the `XMLHttpRequest` constructor.
*
* @publicApi
* @see `XhrFactory`
* @deprecated
* `XhrFactory` has moved, please import `XhrFactory` from `@angular/common` instead.
*/
export type XhrFactory = XhrFactory_fromAngularCommon;
/**
* A wrapper around the `XMLHttpRequest` constructor.
*
* @publicApi
* @see `XhrFactory`
* @deprecated
* `XhrFactory` has moved, please import `XhrFactory` from `@angular/common` instead.
*/
export const XhrFactory = XhrFactory_fromAngularCommon;
export {HttpBackend, HttpHandler} from './src/backend';
export {HttpClient} from './src/client';
export {HttpContext, HttpContextToken} from './src/context';