feat: replace qs with qs-esm (#6966)
qs-esm is a qs fork I created and doesn't add bloated polyfills, is ESM-only, has a smaller bundle size and comes with types included. qs: https://bundlephobia.com/package/qs@6.12.1 (11kb) https://npm.anvaka.com/#/view/2d/qs (15 dependencies) qs-esm: https://bundlephobia.com/package/qs-esm@7.0.0 (4.2kb) https://npm.anvaka.com/#/view/2d/qs-esm (1 dependency) I don't agree with the backwards philosophy of qs: https://github.com/ljharb/qs/issues/404#issuecomment-806392831 ("more deps is better", lower bundle size as opt-in, maximum environment compatibility as opt-out) qs imports waaay too many useless dependencies
This commit is contained in:
@@ -154,7 +154,7 @@ This one isn't too bad, but more complex queries get unavoidably more difficult
|
||||
**For example, using fetch:**
|
||||
|
||||
```js
|
||||
import qs from 'qs'
|
||||
import { stringify } from 'qs-esm'
|
||||
|
||||
const query = {
|
||||
color: {
|
||||
@@ -165,7 +165,7 @@ const query = {
|
||||
}
|
||||
|
||||
const getPosts = async () => {
|
||||
const stringifiedQuery = qs.stringify(
|
||||
const stringifiedQuery = stringify(
|
||||
{
|
||||
where: query, // ensure that `qs` adds the `where` property, too!
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user