Investigate replacing qs
#5783
Replies: 23 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. |
Beta Was this translation helpful? Give feedback.
-
Sounds good, do you want me to make a PR to use the built-in |
Beta Was this translation helpful? Give feedback.
-
@TheDevMinerTV if you want to make a PR targeting 5.x, that would be great |
Beta Was this translation helpful? Give feedback.
-
Will do ^^ |
Beta Was this translation helpful? Give feedback.
-
In #4990 it was suggested to replace
Does replacing both of them with |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
your point is valid, but note that URLSearchParams is part of the URL spec, not ECMAScript
|
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
sounds like we should continue to use |
Beta Was this translation helpful? Give feedback.
-
There seems to be |
Beta Was this translation helpful? Give feedback.
-
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 |
Beta Was this translation helpful? Give feedback.
-
There is a Completely removing |
Beta Was this translation helpful? Give feedback.
-
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 |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
Removing @ctcpip will |
Beta Was this translation helpful? Give feedback.
-
No, it will continue to be CJS-only |
Beta Was this translation helpful? Give feedback.
-
Alright, so it we'd have to use |
Beta Was this translation helpful? Give feedback.
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 |
Beta Was this translation helpful? Give feedback.
-
Faster-qs supports the requested feature https://github.com/hans00/faster-qs |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
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 😄 |
Beta Was this translation helpful? Give feedback.
-
I think the point I was trying to make above is that any movement on this at the moment is not something we are considering. Additional deps is not a concern we have (at least at the moment) and neither is performance (again, at least at this moment). Stability is the primary concern until we can get v5 shipped and v4 EOL'd. Once we have achieved those goals a lot more becomes viable for the project. If y'all are interested in helping us make those two goals happen first then please join the fun, we need all the help we can get. Until then though, I will be un-following this thread so I can stay focused on what is important for the ecosystem and Express community. |
Beta Was this translation helpful? Give feedback.
-
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 firstBeta Was this translation helpful? Give feedback.
All reactions