Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(http): Deprecate HttpClientModule & related modules #54020

Closed
wants to merge 2 commits into from

Conversation

JeanMeche
Copy link
Member

@JeanMeche JeanMeche commented Jan 22, 2024

This commit deprecates the HttpClientModule and other related http modules. Those can be replaced by provider function only.

Angular is an opinionated framework, feature guidance will help developer choose the recommended way to enable features (like Http requests here).

This PR provides a migration schematics to smooth out the transition.

Note: This is NOT an indication of deprecation for NgModules. The deprecated modules only purpose was to define providers. This can be done directly by the provide function pattern.

DEPRECATION: HttpClientModule, HttpClientXsrfModule and HttpClientJsonpModule

Previously at #53861

@JeanMeche JeanMeche changed the title Deprecate http efactor(http): Deprecate HttpClientModule & related modules Jan 22, 2024
@angular-robot angular-robot bot added detected: deprecation PR contains a commit with a deprecation detected: feature PR contains a feature commit labels Jan 22, 2024
@JeanMeche JeanMeche added area: common/http target: major This PR is targeted for the next major release labels Jan 22, 2024
@ngbot ngbot bot added this to the Backlog milestone Jan 22, 2024
@JeanMeche JeanMeche changed the title efactor(http): Deprecate HttpClientModule & related modules refactor(http): Deprecate HttpClientModule & related modules Jan 22, 2024
@alfaproject
Copy link
Contributor

Why not reopen the other PR? (Why was it even closed without feedback? o.o)

@JeanMeche
Copy link
Member Author

JeanMeche commented Jan 22, 2024

@alfaproject I pushed the branch on the repo itself, not my own fork !

@eneajaho
Copy link
Contributor

We need to deprecate https://angular.io/api/common/http/testing/HttpClientTestingModule too 😄

@JeanMeche
Copy link
Member Author

JeanMeche commented Jan 22, 2024

@eneajaho Let's do that too !

@JeanMeche JeanMeche force-pushed the deprecate-http branch 4 times, most recently from 3a1da25 to 91bb73b Compare January 24, 2024 22:27
@JeanMeche JeanMeche marked this pull request as ready for review January 24, 2024 22:28
@devversion
Copy link
Member

@JeanMeche is this change being discussed? I see Dylan wanted to talk to the team about this change.

(Just wondering if/when we should review)

Copy link
Contributor

@dylhunn dylhunn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewed-for: fw-http, fw-testing, fw-migrations

Note that migrations are a bit hard to review without actually testing them out. But the included tests look sufficiently comprehenaive.

@JeanMeche JeanMeche modified the milestones: Backlog, v18-candidates Apr 7, 2024
@alxhub alxhub self-assigned this Apr 11, 2024
@devversion devversion removed their request for review April 12, 2024 18:01
Copy link
Member

@alxhub alxhub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed-for: public-api

@pullapprove pullapprove bot requested a review from atscott April 22, 2024 19:07
@alxhub
Copy link
Member

alxhub commented Apr 22, 2024

@JeanMeche can you rebase? I'll find another public-api reviewer

Copy link
Contributor

@AndrewKushnir AndrewKushnir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed-for: public-api

This commit deprecates the `HttpClientModule` and other related http modules. Those can be replaced by provider function only.

Angular is an opinionated framework, feature guidance will help developer choose the recommended way to enable feature (like Http requests here).

Note: This is not an indication of deprecation for `NgModule`. The deprecated module's only purpose here was to define providers. This can be done directly by the provide function pattern.

DEPRECATED: `HttpClientModule`, `HttpClientXsrfModule` and `HttpClientJsonpModule`

As mentionned, those modules can be replaced by provider function only.
This migration will allow developers to migrate the deprecated `HttpClientModule`, `HttpClientJsonpModule` & `HttpClientXsrfModule` to their respective provider functions.
@JeanMeche JeanMeche added the action: merge The PR is ready for merge by the caretaker label Apr 23, 2024
@alxhub
Copy link
Member

alxhub commented Apr 23, 2024

This PR was merged into the repository by commit f914f6a.

@alxhub alxhub closed this in ef665a4 Apr 23, 2024
alxhub pushed a commit that referenced this pull request Apr 23, 2024
This migration will allow developers to migrate the deprecated `HttpClientModule`, `HttpClientJsonpModule` & `HttpClientXsrfModule` to their respective provider functions.

PR Close #54020
@JeanMeche JeanMeche deleted the deprecate-http branch April 23, 2024 19:13
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators May 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker area: common/http detected: deprecation PR contains a commit with a deprecation detected: feature PR contains a feature commit target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants