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

Marking http client APIs as Legacy #57277

Open
jasnell opened this issue Mar 2, 2025 · 11 comments
Open

Marking http client APIs as Legacy #57277

jasnell opened this issue Mar 2, 2025 · 11 comments

Comments

@jasnell
Copy link
Member

jasnell commented Mar 2, 2025

Now that fetch(...) has had a while to mature in the runtime and now that most development effort for client-side http is happening in undici, I'd like to propose that we mark all of the http and https module client-side operations as Legacy.

As a reminder what Legacy means... it is NOT the same as deprecating. It means that we have no intention of removing the APIs but that a better option is available and we prefer developers to use that better option. It means that the APIs likely will not receive new features but they are still maintained for the purposes of bug and security fixes.

  • http.get(...)
  • http.request(...)
  • http.globalAgent
  • https.get(...)
  • https.request(...)
  • https.globalAgent

@nodejs/http @nodejs/undici

@mcollina
Copy link
Member

mcollina commented Mar 2, 2025

I'm ok with it. I don't see how can we reasonably fix some of the problems there are there without massive ecosystem breakage, at least we can start closing some issues/feature requests.

@panva
Copy link
Member

panva commented Mar 2, 2025

Wouldn't having a maintained, performant, and built-in http client be a prerequisite? i.e. exposing some of undici directly in core for developers to use?

It gets repeated over and over that fetch() performance is not even on par with these legacy APIs which is why I'm wondering if we can point developers to it with clean conscience.

@KhafraDev
Copy link
Member

exposing some of undici directly in core for developers to use?

undici as a whole could replace those http/s apis but not fetch. Fetch is too opinionated and the spec is maintained and controlled by browsers. For example, we doc-deprecated .formData() in undici due to the poor design choices in the spec that could lead to DOSing on the server (see this PR by a Deno member that has been in limbo for over 2 years now).

@marco-ippolito
Copy link
Member

+1 but I think we should expose undici request as modern alternative

@metcoder95
Copy link
Member

+1

Tho, exposing at least undici's Agent, request or the equivalents of node:http and node:https from undici should be a must to provide a good alternative.

@Delapouite
Copy link
Contributor

Previous issue about exposing more of undici #43187

@pimterry
Copy link
Member

pimterry commented Mar 3, 2025

+1 to the general conclusion above: I agree with this general direction of travel, fetch is absolutely not a full substitute for http, but undici could be if it were fully exposed as an official Node API.

Working out the next steps required to start exposing undici and what http features are missing (if any) for it to become the official http replacement would be a great topic for the Paris summit next month.

Do some of the Undici team want to facilitate a summit session to get together and start planning this out? I've worked more on http than undici till now but I'll be there and I'd definitely be interested to get more involved on the undici side and help make this happen.

@mcollina
Copy link
Member

mcollina commented Mar 3, 2025

@nodejs/undici who will be there in Paris?

@ronag
Copy link
Member

ronag commented Mar 3, 2025

Sorry. I'm super busy with my normal work until end of summer.

@metcoder95
Copy link
Member

I'll be there 👍

@jasnell
Copy link
Member Author

jasnell commented Mar 3, 2025

I don't think it is necessarily required that we have a full replacement for the legacy apis before we mark them as Legacy as long as we're clear that is the direction we are moving.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants