Skip to content
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

Replace qs in openapi-backend #69

Open
43081j opened this issue Jul 28, 2024 · 2 comments
Open

Replace qs in openapi-backend #69

43081j opened this issue Jul 28, 2024 · 2 comments
Labels
needs first contact It is unclear if the maintainer of the repo is open for e18e

Comments

@43081j
Copy link
Collaborator

43081j commented Jul 28, 2024

Usage here:
https://github.com/openapistack/openapi-backend/blob/43d4e0d80c8cd3358576c5e8576a1900ec238005/src/router.ts#L332

we can achieve the same via picoquery:

import {parse} from 'picoquery';

parse(str, {
  valueDeserializer: (val) => {
    if (val.includes(',')) {
      return val.split(',');
    }
    return val;
  }
});
@43081j 43081j added the help wanted Extra attention is needed label Jul 28, 2024
@Jayllyz
Copy link

Jayllyz commented Aug 5, 2024

It works with 0 code changes if you use neoqs

import { parse as parseQuery } from 'neoqs/legacy';

image

# neoqs added and qs removed
Estimated new statistics:
  Package size: 4.7 MB → 4.2 MB (88.30%)
  Subdependencies: 34 → 20 (-14)
  Traffic with last week's downloads:
    For current version: 78 GB → 69 GB (9.1 GB saved)
    For all versions: 203 GB → 180 GB (24 GB saved)

@types/qs is not in the estimated traffic change

I can send a PR unless we prefer picoquery (which is ok, no worries).

@43081j
Copy link
Collaborator Author

43081j commented Aug 5, 2024

we've generally been following this strategy (in order):

  • If possible use URLSearchParams rather than a dependency
  • Otherwise, presumably the repo needs nesting/arrays support, so use picoquery
  • If the repo is deeply tied into some qs-specific behaviours, use neoqs

So we should try move them to pq first, as it is much faster. Only if it sends us down a rabbithole (too many changes), we'd then drop in neoqs or similar

@Fuzzyma Fuzzyma added needs first contact It is unclear if the maintainer of the repo is open for e18e and removed help wanted Extra attention is needed labels Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs first contact It is unclear if the maintainer of the repo is open for e18e
Projects
None yet
Development

No branches or pull requests

3 participants