-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
console,util: revert #23162 #29592
console,util: revert #23162 #29592
Conversation
|
I will not approve this. To me, the old behaviour was broken and inconsistent. Thought should be given if the revert itself is a |
I think considering this revert a semver-major may be appropriate |
You seem rather ignorant here based on the fact that this was all done orderly in a |
Excuse me, but that's rather rude. Please see my corrected comment. |
@silverwind, please be more patient. This issue is confusing, and not helped by having a mixture of incomplete and incorrect comments in the related discussions. I did some digging, this is my understanding of what happened. If the first argument is a string, its is treated as a format string, and any specifiers in it may consume some number of values which are formatted as specified. This is obviously as-expected. The surprise is how string values that are not consumed by the format string are treated. They can be unconsumed for two reasons:
How unconsumed arg were formatted used to depend on whether the first parameter was a string:
#23162 removed this inconsistency in how unconsumed string arguments were treated in 12.x, making them be treated uniformly in the two cases, by not inspecting them. 12 is also more consistent wrt. how unconsumed non-string values are treated (I'm not sure if this was because of #23162). 12 seems to convert to a string (
I'm guessing that people using
Summary: I think there are only three options for the next major release line
|
89c7e8d
to
3f2b23f
Compare
Rebased due to conflicts. PTAL |
I interpret @silverwind's initial comment as blocking opposition to this, so I'm going to remove the @silverwind: If I'm wrong and you're OK with this (just perhaps not willing to approve it yourself) then please comment to that effect. Thanks! |
@refack PTAL since you also approved the original PR. |
@nodejs/tsc PTAL |
3f2b23f
to
9e53e02
Compare
Adding @nodejs/tsc In the hopes of getting a quick resolution (since the release will happen in less than 3 weeks), please leave a reaction here. I think the four options cover all the likely possibilities, but if not, leave a comment! 🎉 = revert (land this) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
FWIW Web browsers disagree on this behavior entirely.
I think the new behavior is more consistent. If it should be changed, I think the unconsumed case where a formatter is present should still inspect (like Safari). I suspect that would not be widely liked though, and so I think the present v12 behavior of non-quoting strings is better, if different. ALSO: This was intentionally changed in a major 5 months ago which will be LTS. Reverting this in the following major seems like a mistake to me. I would suggest reverting in 12 but I bet the ship's sailed on that. Edit, that being said, one might expect the following to work, although it does not:
|
Additionally, this issue is not particularly clear, so here is an explanation. The issue is what should happen to the second (string) argument in e.g. The old behavior ran it through
Note that when this happens with a formatter, it always directly prints the string (with or without the change):
|
Thanks for the explanation @Fishrock123. |
This reduces the information and sorts the entries.
This reverts nodejs#23162. The gained consistency did not outweight the benefit of inspecting the arguments. Therefore it is best to revert to the former behavior. Refs: nodejs#29539 Refs: nodejs#23162
(Rebased and force-pushed to resolve a pair of conflicts in the docs. Just formatting/lint stuff.) |
Reverting this makes sense to me. Reverting as a semver-major, given that 12 is an LTS line, doesn’t. I think more of this discussion needs to cover that point. |
I'm really torn on this. Going to remove my approval on the change
After discussion, I'm at:
So, I'm arriving at do not land for this -- lets keep 12.x's behaviour now and forever. |
Consensus at the TSC meeting is to not revert. This can remain open if @BridgeAR or anyone else wants to continue to make the case, but this won't land in 13.0.0. It will likely have to land in 14.0.0 if at all. |
8ae28ff
to
2935f72
Compare
Ping @BridgeAR ... what do you want to do with this one? |
Closing due to lack of continued activity on this one. Can reopen if it needs to be revisited |
Edit by @Fishrock123: issue description at #29592 (comment)
This reverts #23162 so that
util.format()
works as before.Both TSC members (@addaleax and @jasnell) who gave their LG to the original PR seem to be in favor of reverting to the old behavior. I therefore went ahead and opened this PR.
I requested the review of all people being involved in #29539 to take a look at this.
Refs: #29539
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes