mistval added a commit to mistval/kotoba that referenced this issue Jul 29, 2019
rocka referenced this issue in SB-IM/wxservice Sep 14, 2019
@dooglio

This comment has been minimized.

Copy link

dooglio commented Sep 20, 2019

no promises though.

Pun intended? 🤣

@millette millette mentioned this issue Nov 17, 2019
@MingweiSamuel MingweiSamuel mentioned this issue Dec 5, 2019
11 of 12 tasks complete
@laoshaw

This comment has been minimized.

Copy link

laoshaw commented Dec 5, 2019

maybe the same logical reasoning should be applied to expressjs? for request we now have the new shiny got module, there is no re-write or true alternative to expressjs on the horizon.

express is great, but it is not really actively updated with new features these years

@mikeal

This comment has been minimized.

Copy link
Member Author

mikeal commented Dec 5, 2019

express may not be updated with new features but it is actively maintained and, last time i checked, has a few people still quite interested in doing that work. i don’t know that they need to take the steps we’ve taken towards deprecation.

@aalimovs

This comment has been minimized.

Copy link

aalimovs commented Dec 5, 2019

@laoshaw what has express anything to do with request?

@mikeal

This comment has been minimized.

Copy link
Member Author

mikeal commented Feb 11, 2020

Preparing full deprecation. #3267

@mikeal

This comment has been minimized.

Copy link
Member Author

mikeal commented Feb 11, 2020

We are fully deprecated!

All versions on npm note the deprecation and the README notes clearly that request has been deprecated.

It’s been a great 10+ years, thanks to everyone who contributed over the last decade. Let’s all look forward to new libraries that are better suited for the changes that are occurring in the JS language and ecosystem.

@riclf

This comment has been minimized.

Copy link

riclf commented Feb 11, 2020

So lets get SPECIFIC.
What is the lean code replacement for the request module?

Not to be left hanging on dead crust.... so many better options... like WHICH ones?
Not GRAND do everything under the sun libraries/modules, please.

@JustinBeckwith

This comment has been minimized.

Copy link

JustinBeckwith commented Feb 11, 2020

@riclf we've been using https://github.com/googleapis/teeny-request/ to help ween us off of request for a few years. It does not do everything you are going to want it to do :) It uses node-fetch under the hood. There are other great options out there too!

@jkrems

This comment has been minimized.

Copy link

jkrems commented Feb 11, 2020

For a promise-first solution there's also gofer which is heavily focussed on API communication. Support for TCP connect timeouts built-in, easy configuration (and rich errors) for talking to multiple APIs, etc..

@jeremy-j-ackso

This comment has been minimized.

Copy link

jeremy-j-ackso commented Feb 11, 2020

Does anyone have any recommendations for alternative clients that have good support for HTTP Long Polling and presents as either a Stream or Event Emitter?

@bajtos

This comment has been minimized.

Copy link

bajtos commented Feb 11, 2020

The last time I checked in April 2019, alternatives like got, node-fetch and axios had a major problem: when a (low-level networking) error happened, they discarded the helpful stack trace reported by Node.js core and threw a new high-level error with a stack trace pointing to the http client library only. This made debugging transport-level issues pretty much impossible, for example when proxies are involved.

Is there any good request alternative that preserves error details provided by Node.js core?

@jkrems

This comment has been minimized.

Copy link

jkrems commented Feb 11, 2020

@bajtos I'm pretty sure gofer only decorates the original errors but should preserve the stack traces and messages.

@mikeal

This comment has been minimized.

Copy link
Member Author

mikeal commented Feb 11, 2020

bent has nice errors and is designed for async/await. It’s also incredibly small and the bundle size is teeny tiny ;)

The API is nothing like request though, so I wouldn’t call it a “replacement.”

@intelliot

This comment has been minimized.

Copy link

intelliot commented Feb 11, 2020

@mikeal Why is it called bent? (request was an easier name to remember.)

@Charuru

This comment has been minimized.

Copy link

Charuru commented Feb 11, 2020

bent has nice errors and is designed for async/await. It’s also incredibly small and the bundle size is teeny tiny ;)

The API is nothing like request though, so I wouldn’t call it a “replacement.”

This feels very much like technically correct rather than user-friendly logic. From the user perspective bent solves the same problem as request but better. Now it's stuck with a worse name for no reason. You can call it request 3 without much issue imo. Yes the API is breaking but what's what we have semver for.

@mikeal

This comment has been minimized.

Copy link
Member Author

mikeal commented Feb 11, 2020

You can call it request 3 without much issue imo. Yes the API is breaking but what's what we have semver for.

Spend some time with bent and you may feel differently.

It’s not a small difference in naming or promises vs callbacks. The ergonomics are very different, the states it surfaces are very different, the way it thinks about error conditions is a radically different approach.

request is a more procedural API, you tell it to do something and it tells you what happened, it only gives an error if something irrecoverably failed. bent takes the success criteria for the entire lifecycle and returns you an API that will fail if anything but the success criteria is met.

You use these libraries very differently. There are other libraries that are closer to request’s API if that is what you want, but after almost 20 years of working on HTTP clients I’ve found a different and ultimately better approach that I’d encourage people to consider, but I’m not going to ram it down everyone’s throats by making it request 3.0.

Why is it called bent? (request was an easier name to remember.)

Because you “bend” it into a specific shape (very particular success criteria) and it provides an ideal API for the success of that shape and fails on anything but it.

The name is a bit abstract, but request is the kind of name you could never get today. I barely got request in the npm registry and I wrote the original npm registry 😜

@laoshaw

This comment has been minimized.

Copy link

laoshaw commented Feb 11, 2020

what about "got" as a replacement, it's sad we don't have a clear replacement while request is officially deprecated.

@mikeal

This comment has been minimized.

Copy link
Member Author

mikeal commented Feb 11, 2020

what about "got" as a replacement, it's sad we don't have a clear replacement while request is officially deprecated.

Maybe we should take the fact that nobody has written an API compatible replacement as an indication that adopting an API compatible replacement is undesirable once you sit down and work on it 🧐

That was certainly my experience.

@psequeirag

This comment has been minimized.

Copy link

psequeirag commented Feb 12, 2020

Perhaps what people really want when they ask for a "replacement", is not so much an API compatible alternative, but the maintainer perspective on what other packages are already out there to solve roughly the same problem and that are making this package irrelevant so that you can confidently call it "deprecated".

@psequeirag

This comment has been minimized.

Copy link

psequeirag commented Feb 12, 2020

And I'd say advertising bent in the deprecation notice (possibly along with some others, if that makes you feel more comfortable) is a great way to start getting it known despite the obscure naming.

bors bot added a commit to jser/jser.github.io that referenced this issue Feb 12, 2020
Merge #710
710: 2020-02-12のJS: Electron 8.0.0、Angular 9、`request` module is deprecated r=azu a=azu

* [Electron 8.0.0 | Electron Blog](https://www.electronjs.org/blog/electron-8-0)
* [Version 9 of Angular Now Available — Project Ivy has arrived!](https://blog.angular.io/version-9-of-angular-now-available-project-ivy-has-arrived-23c97b63cfa3)
* [Angular - Angular Ivy](https://angular.io/guide/ivy)
* [request - npm](https://www.npmjs.com/package/request)
* [Request’s Past, Present and Future · Issue #3142 · request/request](request/request#3142 (comment))
* [Alternative libraries to request · Issue #3143 · request/request](request/request#3143)


Co-authored-by: azu <azuciao@gmail.com>
Co-authored-by: azu <azu@users.noreply.github.com>
@rinsad

This comment has been minimized.

Copy link

rinsad commented Feb 12, 2020

Angluar 8 request module deprecated
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm ERR! code E404
npm ERR! 404 Not Found: error-ex@^1.3.1

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Ammar\AppData\Roaming\npm-cache\_logs\2020-02-12T04_18_22_538Z-debug.log