Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@JeanMeche
Copy link
Member

@JeanMeche JeanMeche commented Jun 1, 2024

The changes introduced in this commit allows to use the HttpClient without the provider function.

Bundle size impact <1kB, mostly due to creating the providers and factories for the services providedin root.

@angular-robot angular-robot bot added the detected: feature PR contains a feature commit label Jun 1, 2024
@JeanMeche JeanMeche force-pushed the http-in-root branch 6 times, most recently from 97725c3 to cf03dae Compare June 1, 2024 10:14
packages/common/http/src/backend.ts Outdated Show resolved Hide resolved
@ilirbeqirii
Copy link
Contributor

does this means, we have httpclient included by default, even if we dont add provideHttpClient()?

if yes, should we guard against adding provider function ?

@ahardin1
Copy link

ahardin1 commented Jun 1, 2024

does this means, we have httpclient included by default, even if we dont add provideHttpClient()?

if yes, should we guard against adding provider function ?

I may be missing something obvious here but if we do guard and I think we should one way or another then we'd need another way of configuring certain HttpClient features like interceptor functions. We could expose their tokens as public API (HTTP_INTERCEPTOR_FNS) or define their own dedicated provider functions. I prefer interfacing with the token directly because it gives us the ability to use different types of providers depending on our need. For example: if for whatever reason a service is supplying the interceptors I could just do;

// No need for `multi: true` in this example since all interceptor functions are supplied as an array
{ provide: HTTP_INTERCEPTOR_FNS, useFactory: () => inject(InterceptorService).interceptors }

This may be a contrived example but providers are made to be flexible and I strongly believe they should remain that way.

@JeanMeche
Copy link
Member Author

This a technical demo, of what 0-config setup for the Http stack. The subject hasn't been accepted nor discussed with the team yet. The idea here to is say, hey we could have use the default setting without any providers but if you need some customization, you can still use provideHttpClient() as before.

Also, the topic of exposing the interceptors token, has already been discussed in #51303. The token being is by design, as interceptors should be set in a single place so the executed in a predictable order.

@JeanMeche JeanMeche force-pushed the http-in-root branch 3 times, most recently from fd8ba24 to 0be918c Compare June 1, 2024 20:17
@JeanMeche JeanMeche changed the title feat(http): POC: Provide http services in root feat(http): Provide http services in root Jun 10, 2024
@JeanMeche JeanMeche marked this pull request as ready for review June 10, 2024 00:52
@pullapprove pullapprove bot requested a review from atscott June 10, 2024 00:52
@JeanMeche JeanMeche added the area: common/http Issues related to HTTP and HTTP Client label Jun 10, 2024
@ngbot ngbot bot added this to the Backlog milestone Jun 10, 2024
@JeanMeche JeanMeche added the action: review The PR is still awaiting reviews from at least one requested reviewer label Jun 10, 2024
@JeanMeche JeanMeche added the target: minor This PR is targeted for the next minor release label Jun 12, 2024
@AndrewKushnir
Copy link
Contributor

Presubmit (TGP).

@AndrewKushnir AndrewKushnir added the action: global presubmit The PR is in need of a google3 global presubmit label Jun 19, 2024
Copy link
Contributor

@thePunderWoman thePunderWoman 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 alxhub June 28, 2024 19:02
@JeanMeche JeanMeche force-pushed the http-in-root branch 2 times, most recently from 43819bb to 99f99a0 Compare March 24, 2025 19:55
@JeanMeche JeanMeche force-pushed the http-in-root branch 2 times, most recently from 2afec95 to b8ceb35 Compare April 22, 2025 18:41
@JeanMeche JeanMeche force-pushed the http-in-root branch 2 times, most recently from 92e8e5a to 8497301 Compare May 3, 2025 19:04
@JeanMeche JeanMeche force-pushed the http-in-root branch 2 times, most recently from c754b81 to 6f11f20 Compare June 2, 2025 20:01
@thePunderWoman thePunderWoman removed the request for review from dylhunn June 3, 2025 11:31
@JeanMeche JeanMeche marked this pull request as draft June 4, 2025 14:54
@JeanMeche JeanMeche force-pushed the http-in-root branch 2 times, most recently from 9300a76 to a9158e1 Compare August 11, 2025 22:20
The changes introduced in this commit allows to use the HttpClient without the provider function.
@JeanMeche JeanMeche marked this pull request as ready for review August 13, 2025 21:56
@JeanMeche
Copy link
Member Author

JeanMeche commented Aug 13, 2025

G3 has been cleaned up & Passing TGP

@JeanMeche JeanMeche removed action: review The PR is still awaiting reviews from at least one requested reviewer action: global presubmit The PR is in need of a google3 global presubmit labels Aug 13, 2025
Copy link
Contributor

@atscott atscott 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

@JeanMeche JeanMeche added the action: merge The PR is ready for merge by the caretaker label Aug 13, 2025
@crisbeto
Copy link
Member

This PR was merged into the repository by commit 4bed062.

The changes were merged into the following branches: main

@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 Sep 14, 2025
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 Issues related to HTTP and HTTP Client breaking changes detected: feature PR contains a feature commit target: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.