Skip to content

docs: Adds HTTP communication guidance to Angular Skills#69645

Open
SkyZeroZx wants to merge 1 commit into
angular:mainfrom
SkyZeroZx:skills/http-skill
Open

docs: Adds HTTP communication guidance to Angular Skills#69645
SkyZeroZx wants to merge 1 commit into
angular:mainfrom
SkyZeroZx:skills/http-skill

Conversation

@SkyZeroZx

Copy link
Copy Markdown
Contributor

Closes #68022

@pullapprove pullapprove Bot requested a review from kirjs July 4, 2026 17:38
@angular-robot angular-robot Bot added the area: docs Related to the documentation label Jul 4, 2026
@ngbot ngbot Bot added this to the Backlog milestone Jul 4, 2026
- Calling `provideHttpClient()` with no features is not required for basic HTTP requests, but it configures the default HTTP feature set for that injector, including Angular's XSRF interceptor.
- Prefer `provideHttpClient(...)` over `HttpClientModule` for feature configuration, especially with multiple injectors.
- Use `withRequestsMadeViaParent()` when a child injector should add interceptors while still delegating to the parent HTTP chain.
- Prefer CORS over JSONP. Use `withJsonpSupport()` only for legacy APIs that require JSONP.

@SkyZeroZx SkyZeroZx Jul 4, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In fact, I think we should avoid mentioning or directly say never to use JsonP because of the risk of XSS. Or should we still leave it as legacy support?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yeah, let's just remove any mention of JSONP. It belongs in the past.

@SkyZeroZx SkyZeroZx Jul 5, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Wouldn't it be better to emphasize not using it (I say this to avoid confusion or to provide better guidance for the agents)?

Since, for example, if I start a new project (even with Angular skills) it adds withFetch for some reason when there's an unrelated problem, I would assume this might happen unexpectedly with JsonP

EDIT: According to GTP 5.5 using skill-creator, it indicates that it would be better to omit it, so let's go with that option.

```

- `HttpClient` uses the fetch backend by default.
- Use `withXhr()` only when upload progress events are required. Do not use `withXhr()` for server-side rendering.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This will be deprecated I think.

@SkyZeroZx SkyZeroZx Jul 4, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

As far as I know, XHR is not going to be deprecated; from my POV, it is still useful and valuable on the client side for upload reporting support.

It is supposedly being deprecated because the xhr2 library is vulnerable, according to

Because it can filter Authorization headers without any way to prevent it in SSR, which is why SSR itself is being deprecated. For more context, this is similar to GHSA-qxh6-94w6-9r5p

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It is unlikely to be deprecated in a near future. Fetch still doesn't support upload progress report.

@dominicbachmann dominicbachmann left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What do you think about also adding examples of how to test this, as described in https://angular.dev/guide/http/testing?

import {input} from '@angular/core';

export class UserProfile {
userId = input.required<string>();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The HttpClient example above uses modifiers like private and readonly. Is there a particular reason they're not used here? Otherwise I'd keep the examples consistent

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The HttpClient example above uses modifiers like private and readonly. Is there a particular reason they're not used here? Otherwise I'd keep the examples consistent

I agree, it should be consistent.

What do you think about also adding examples of how to test this, as described in angular.dev/guide/http/testing?

I'm not sure if we should add testing to this guide because we might have context that would consume more tokens for our agent. I believe everything related to testing should be a separate skill, and it would also be called as required by the user prompt.

- **Component Harnesses**: Standard patterns for robust component interaction. Read [component-harnesses.md](references/component-harnesses.md)
- **Router Testing**: Using `RouterTestingHarness` for reliable navigation tests. Read [router-testing.md](references/router-testing.md)
- **End-to-End (E2E) Testing**: Best practices for E2E tests with Cypress. Read [e2e-testing.md](references/e2e-testing.md)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@SkyZeroZx What do you think about adding a http testing reference here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, that makes sense, but I think it would be better to address it in a follow-up PR to avoid adding extra overhead to this one.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Personally I would add to this PR. Let's see what the others think.

@SkyZeroZx SkyZeroZx force-pushed the skills/http-skill branch from a5372ee to 8ed3d3d Compare July 7, 2026 05:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: docs Related to the documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a file.md for http communication in the angular-developer Agent Skill

4 participants