Switch to fetch
away from axios
#592
Labels
💻 aspect: code
Concerns the software code in the repository
✨ goal: improvement
Improvement to an existing user-facing feature
🟩 priority: low
Low priority and doesn't need to be rushed
🧱 stack: frontend
Related to the Nuxt frontend
💬 talk: discussion
Open for discussions and feedback
🟨 tech: javascript
Involves JavaScript
Problem
Currently we use
axios
to manage making HTTP requests on the client. Bytes over the network aren't free and now that browsers and Node have the samefetch
api, we could switch to using fully native APIs for network requests that won't add bytes to the bundle.Description
Explore switching from
axios
tofetch
. Axios has some nice features like middleware and easy-to-use request making. It also has different symantics around what constitutes an "error" (fetch
only throws on status codes > 499 whereas axios throws > 399).Alternatives
Stick with axios. It's not that heavy of a dependency and there are probably less critical paths we can do dependency optimization for (I'm assuming, I'm not sure).
Implementation
The text was updated successfully, but these errors were encountered: