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

Deprecate the old querystring in favor of URLSearchParams? #38231

Closed
jimmywarting opened this issue Apr 13, 2021 · 3 comments
Closed

Deprecate the old querystring in favor of URLSearchParams? #38231

jimmywarting opened this issue Apr 13, 2021 · 3 comments
Labels
deprecations Issues and PRs related to deprecations. querystring Issues and PRs related to the built-in querystring module.

Comments

@jimmywarting
Copy link

What do you think? should a warning be shown if someone is requiring the querystring?

  • URLSearchParams uses a more selective and fine grained approach to selecting encoded characters than that used by the Legacy API.
  • URLSearchParams is a spec standard, more ppl should know how it works
  • querystring is inconsistent when it comes to adding same keys more then once (by switching between string and arrays)
    • if your server depends on some key being used once ?key=val the you would expect that it would be a string
      But if someone where to add it twice ?key=val&key=val2 then it becomes an array and your application would do unexpected things.
  • works in more environments -> means fewer dependencies
@cjihrig
Copy link
Contributor

cjihrig commented Apr 13, 2021

should a warning be shown if someone is requiring the querystring?

No

@jimmywarting jimmywarting reopened this Apr 14, 2021
@Ayase-252 Ayase-252 added deprecations Issues and PRs related to deprecations. querystring Issues and PRs related to the built-in querystring module. labels Apr 14, 2021
@Trott
Copy link
Member

Trott commented Apr 14, 2021

I'm OK with encouraging folks to use the newer and better stuff. Do that in the docs by all means. But adding a warning to querystring has very little upside (to the maintainers, at least--whether a warning is a service or disservice to users is an open question) and a massive downside:

  • Not much upside: There is no benefit to the project maintainers. It's not like we're ever going to be able to get rid of querystring, at least not in the next five years or any timeline like that. (Look how long domains has been deprecated!)

  • Big downside: There will be a massive annoyance to package maintainers. People will see the warning, then open issues in repositories, telling the maintainers to fix their code that is in fact working perfectly well. Not a problem if you maintain one or two packages, but those who maintain tens or hundreds will be very unhappy, understandably. This is what happened when we tried to have a warning appear for all instances of new Buffer(). (We changed it so that it only appears outside of node_modules.)

Yes, people should know about the newer and better stuff. But that's going to have to be the job of documentation and tutorials. As I said before, whether a warning is a service or disservice to users is an open question. But I don't think it would be anywhere near enough to balance the downside.

@jasnell
Copy link
Member

jasnell commented Apr 14, 2021

I'd be fine with marking it as Legacy status in the docs but deprecating wouldn't be good right now.

jasnell added a commit to jasnell/node that referenced this issue Apr 27, 2021
Signed-off-by: James M Snell <jasnell@gmail.com>
Fixes: nodejs#38231
@panva panva closed this as completed in 32ade69 Apr 29, 2021
targos pushed a commit that referenced this issue Apr 29, 2021
Signed-off-by: James M Snell <jasnell@gmail.com>
Fixes: #38231

PR-URL: #38436
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
targos pushed a commit that referenced this issue May 30, 2021
Signed-off-by: James M Snell <jasnell@gmail.com>
Fixes: #38231

PR-URL: #38436
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
targos pushed a commit that referenced this issue Jun 5, 2021
Signed-off-by: James M Snell <jasnell@gmail.com>
Fixes: #38231

PR-URL: #38436
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
targos pushed a commit that referenced this issue Jun 5, 2021
Signed-off-by: James M Snell <jasnell@gmail.com>
Fixes: #38231

PR-URL: #38436
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
targos pushed a commit that referenced this issue Jun 11, 2021
Signed-off-by: James M Snell <jasnell@gmail.com>
Fixes: #38231

PR-URL: #38436
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deprecations Issues and PRs related to deprecations. querystring Issues and PRs related to the built-in querystring module.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants