Add withXhr() to provideHttpClient()
Recipe ID
org.openrewrite.angular.migration.add-with-xhrArtifact@openrewrite/recipes-angularAdds withXhr() to provideHttpClient() calls that select neither a withFetch() nor a withXhr() backend. Angular 22 made FetchBackend the default HttpBackend; withXhr() keeps the previous XMLHttpRequest based backend, which is also the only one that reports upload progress.
Single recipeProprietary
Usage
This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.
mod run . --recipe org.openrewrite.angular.migration.add-with-xhrIf the recipe isn’t available locally, install it with:
mod config recipes npm install @openrewrite/recipes-angular