jaredpalmer / awesome-react-render-props

Awesome list of React components with render props
1.37k stars 111 forks source link

Add React Request #29

Closed jamesplease closed 6 years ago

jamesplease commented 6 years ago

Hi there! I recently released a separate lib for HTTP requests that adds some additional functionality on top of Holen, React Request. I thought I'd open a PR here to add it to the list.

Thanks for considering this addition! :v:

kentcdodds commented 6 years ago

Any chance we could just merge the two libraries or choose a winner? cc @tkh44

jamesplease commented 6 years ago

@kentcdodds, I thought about there just being one declarative request component for React, but I'm not sure if the community would ever let that be the case for long. @tkh44 suggested he could deprecate Holen when I first showed him React Request, but I advised against it at the time due to this uncertainty I have.

Right now, React Request adds caching and deduping, but it isn't granular enough for some APIs (such as GraphQL or any other API that can embed multiple operations into a single HTTP request). I can make these features more granular, but that will make the code larger. It also only supports text request bodies; adding support for the other types will add even more bloat.

Eventually, it could support every use case, but then some developer will ask themselves, "why is this thing so big? I just want to make an HTTP request with a React component," and they might go and make Holen again.

This happened in the Node world with request and simpler alternatives like got.

Or maybe I'm just overthinking things, and nobody will care and will just use the most powerful one despite the slightly larger size 🤷‍♂️

kentcdodds commented 6 years ago

I can appreciate keeping things as small and simple as possible. I'll let you all decide how you want to do that. I'm fine adding this.