-
-
Notifications
You must be signed in to change notification settings - Fork 16.2k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
Investigate replacing qs
#5723
Comments
It can't be done in Express 4; as you correctly noted, it would require a higher minimum version of Node. Express 5 will require a minimum of Node 18, and if a dependency is no longer required, I would rather just drop it. However, a significant perf difference could be a compelling enough reason to use it over built-ins. |
Sounds good, do you want me to make a PR to use the built-in |
@TheDevMinerTV if you want to make a PR targeting 5.x, that would be great |
Will do ^^ |
In #4990 it was suggested to replace
Does replacing both of them with |
|
your point is valid, but note that URLSearchParams is part of the URL spec, not ECMAScript
|
Edit: Edit: This is very likely because the spec never mentions arrays. I'm not sure how to proceed here. Should we implement (or pull in a package for) the array parsing algorithm, if so, do we use the comma or the index syntax. Or should we drop the feature? IMO we should implement this ourselves with the index syntax. |
sounds like we should continue to use |
There seems to be |
In the spirit of the very first line of your readme
I believe it would be great to provide a URLSearchParams based interface by default and offer pluggable support for qs or other parsers to allow users to decide for themselves without forcing qs on them. qs is quire large https://pkg-size.dev/qs and most applications today are just fine with using URLSearchParams on the server and client. It even has basic array support built in |
There is a Completely removing |
it probably does make sense that the query parser setting can be since then you can use whatever query parser you like by passing it in, without having to bloat express itself with such a library |
Another option for 5.0 could be to make qs an optional peerDependency and users opting for the "extended" setting would have to install it manually. |
qs
with fast-querystring
qs
Removing @ctcpip will |
No, it will continue to be CJS-only |
Alright, so it we'd have to use |
This comment was marked as spam.
This comment was marked as spam.
It was an active choice to keep them separate (1.x cjs, 2.x esm - at the next breaking change, esm only) We will be backporting non breaking features and fixes to 1.x meanwhile |
Faster-qs supports the requested feature https://github.com/hans00/faster-qs |
I dont think we will be replacing this module, at least not any time soon. We are pushing to get v5 our the door and this is not on the list for that. Just want to temper folks expectations since the new group of maintainers, while no longer just one person, is still small and we have a lot of catch up we are doing. Additionally, with #5731 and v5 landing the default swap I would not be surprised if we went the path of removing all these as direct deps and go to them as 3rd party configuration additions instead for v6. Not promising anything, but also I don't want folks to waste a lot of time bikeshedding this issue for no reason. |
I just made neoqs, fully backward compatible and forever going to follow I'd suggest URLSearchParams as the endgame, but in the meanwhile, neoqs could fill in the gap without being disruptive 😄 |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Pros
qs
) vs. ~30 kB (fast-querystring
)qs
's subdeps have a lot of recursion in require cycles as wellexpress
(if there's platform that allowsexpress
to be used, at least)Cons
fast-querystring
requires at least Node 8:fast-querystring
doesn't support setting prototypesNotes
benchmark
folder in this repo and just replacing therequire
call tofast-querystring
on a idling 7950X running Node v8.17.0URLSearchParams
which has been supported since Node 10URLSearchParams
to be pretty slow, though, this needs to be benchmarked firstThe text was updated successfully, but these errors were encountered: