-
Notifications
You must be signed in to change notification settings - Fork 126
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
fetch: rewrite with composability in mind #131
Conversation
Re: Axios I have a lot of feelings about supporting it. This 3 year old post comes to mind: https://www.reddit.com/r/reactjs/comments/dcte0e/psa_axios_is_mostly_dead/. If you are going to support it perhaps consider using redaxios instead? It's an 800 byte alternative written by Jason Miller: https://github.com/developit/redaxios |
I'll support anything with the same API. |
Also, I plan on supporting TRPC in the near future. |
I'm wondering if using Redaxios out of the box as a dependency is better than Axios. The user may not care which is used so opting for the smaller is an advantage (6.7kb vs 1kb). The user can install Axios proper if they need to override it for whatever reason. Just a thought/suggestion :-) |
@davedbase Wouldn't all of them be optional dependencies that user has to explicitly install if he want to use it? |
Yah you're right, sorry I thought axios was marked as a dependency in the package.json but I read it wrong. Maybe some instructions/suggestions in the readme for the axios modifier would be best? |
We should definitely document this thoroughly. |
I've added the first stub for caching. The reload mechanism is still missing. I've put cache into its own file so modifiers is not blown up out of proportion. |
refetch mechanism is also added now. I'm closer to finishing the main functionality and can then turn to types and tests. |
f740b7c
to
6ce1549
Compare
3fbb1c7
to
4cb9caf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here are a couple of things I've caught. Generally, the amount of work put into this package is insane. Really good stuff.
fetch: improve request API
🦋 Changeset detectedLatest commit: 372f964 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, let's ship it :)
Fresh from the discussion here #129, this is the first draft of a simplified, more composable fetch primitive.
This is still WIP; the retry and cache modifier are not yet done, the internal documentation and the README are not yet finished.