doc,url: clarify domainTo* when built without ICU#38789
Conversation
|
Could you add a test for non-ICU builds that make sure the warning works please? (I think you can do that if you add |
addaleax
left a comment
There was a problem hiding this comment.
As in the original PR, I’m not convinced that this is actually useful – the vast majority of Node.js developers will never know that this is something that can happen – and that documentation changes should be the priority here (the URL docs don’t seem to mention this at all).
src/node_url.h
Outdated
| URL() : URL("") {} | ||
|
|
||
| private: | ||
| Environment* env_ = nullptr; |
There was a problem hiding this comment.
This doesn’t seem quite right – why isn’t this passed along like other arguments? It doesn’t conceptually make a lot of sense to say that a URL is bound to a specific Environment instance, when it doesn’t associate with JS objects.
src/node_url.cc
Outdated
| const std::string& input, | ||
| std::string* output) { | ||
| ProcessEmitWarning(env, | ||
| "Cannot convert to ASCII when intl is disabled"); |
There was a problem hiding this comment.
If we do this, let’s be more specific about what actually happens here – “ToUnicode” and “ToASCII” are very generic names, and mirroring them 1:1 isn’t really useful to end users (it doesn’t even tell them that this is an operation on domain names that’s failing).
@addaleax If we mention it in the docs that these functions return the same domain string unchanged if Node.js hasn't been compiled with ICU support, will it be enough or is the warning still necessary? |
|
@RaisinTen That is what I would do, yes – I can’t speak for you, of course, and you’re the one who is suggesting the warning here. |
|
Since the Lines 174 to 175 in ab71af3 I too think it would be okay to make this just a doc change. Updated, PTAL. |
e31fd7a to
17b38d7
Compare
Continuation of: nodejs#35099 Signed-off-by: Darshan Sen <raisinten@gmail.com> PR-URL: nodejs#38789 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
17b38d7 to
bbab59d
Compare
|
Landed in bbab59d |
|
#35099 is semver-major so marking this one dont-land-on-v14.x. |
|
@richardlau This change actually solves the problem #35099 was trying to solve by just clarifying the docs by stating what has already been happening, so I think it is okay to land this on v14.x. |
Continuation of: nodejs#35099 Signed-off-by: Darshan Sen <raisinten@gmail.com> PR-URL: nodejs#38789 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Continuation of: #35099
Signed-off-by: Darshan Sen raisinten@gmail.com