angular-cn/packages/platform-server
Alan Agius e0028e5741 fix(platform-browser): configure `XhrFactory` to use `BrowserXhr` (#41313)
With this change we move `XhrFactory` to the root entrypoint of `@angular/commmon`, this is needed so that we can configure `XhrFactory` DI token at a platform level, and not add a dependency  between `@angular/platform-browser` and `@angular/common/http`.

Currently, when using `HttpClientModule` in a child module on the server, `ReferenceError: XMLHttpRequest is not defined` is being thrown because the child module has its own Injector and causes `XhrFactory` provider to be configured to use `BrowserXhr`.
Therefore, we should configure the `XhrFactory` at a platform level similar to other Browser specific providers.

BREAKING CHANGE:

`XhrFactory` has been moved from `@angular/common/http` to `@angular/common`.

**Before**
```ts
import {XhrFactory} from '@angular/common/http';
```

**After**
```ts
import {XhrFactory} from '@angular/common';
```

Closes #41311

PR Close #41313
2021-03-29 15:14:16 -07:00
..
init feat(platform-server): allow shimming the global env sooner (#40559) 2021-02-12 08:55:25 -08:00
src fix(platform-browser): configure `XhrFactory` to use `BrowserXhr` (#41313) 2021-03-29 15:14:16 -07:00
test perf(common): remove unused methods from DomAdapter (#41102) 2021-03-10 11:48:24 -08:00
testing build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
BUILD.bazel feat(platform-server): allow shimming the global env sooner (#40559) 2021-02-12 08:55:25 -08:00
PACKAGE.md docs: add platform to glossary (#30731) 2019-06-12 11:46:25 -07:00
index.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
package.json feat(core): support TypeScript 4.2 (#41158) 2021-03-17 09:10:25 -07:00
public_api.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00