Skip to content

Commit

Permalink
refactor(platform-server): import xhr2 dynamically in the ServerXhr…
Browse files Browse the repository at this point in the history
… class (#50095)

This commit updates the `@angular/common/http` and `@angular/platform-server` packages to allow dynamic import of the `xhr2` dependency. The `xhr2` dependency has side-effects that rely on a global scope and as a result in some environments those side-effectful calls fail. With the changes from this PR, the import is delayed until it's actually needed, which gives a chance for the underlying platform to setup global scope (via shims) as needed.

Co-authored-by: alan-agius4 <17563226+alan-agius4@users.noreply.github.com>

PR Close #50095
  • Loading branch information
AndrewKushnir authored and alxhub committed May 8, 2023
1 parent a9c6015 commit d686d15
Show file tree
Hide file tree
Showing 4 changed files with 317 additions and 282 deletions.
2 changes: 2 additions & 0 deletions integration/platform-server/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
"outputHashing": "media"
},
"development": {
"buildOptimizer": false,
"optimization": false,
"sourceMap": true,
"extractLicenses": false,
Expand Down Expand Up @@ -239,6 +240,7 @@
"outputHashing": "media"
},
"development": {
"buildOptimizer": false,
"optimization": false,
"sourceMap": true,
"extractLicenses": false,
Expand Down
Loading

0 comments on commit d686d15

Please sign in to comment.