-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
v7.x undocumented backward incompatibility of url.format() #11103
Comments
Well, it was a semver-major change, so it was released in v7.0.0 and not v6.x (the current major version at the time the commit was landed). /cc @Trott for more info about the change itself |
Thanks for reporting this, @mrtbld! I'm open to counter-arguments here, but this seems like a bugfix, albeit one perhaps caused by an unintentional side effect (and thus no mention in the changelog). In v6.x, if you specified Now, if I agree that protocol-relative URLs are an important use case and we don't want break the world over a change in Like I said, I'm open to counter-arguments here. For one thing, if there's reason to believe that this is causing significant ecosystem breakage and headaches, that certainly overrides my general "I feel like this is a bugfix" sentiment. My impression, though, is that it hasn't caused much trouble during the 3 months that it's been in a supported release. Contrary data (like a pile of issues filed against Express or whatever) totally welcome. |
This use case is interesting when looked at in context with our plans to eventually deprecate /cc @jasnell |
Has a CITGM run complained about this breaking change? (I believe CITGM CI doesn't really work at the moment...?) Also if this behavior is a wonfix, then we should probably mention this in the next change log and the change log of v8.x (don't know who to cc) |
Any updates on this? |
/cc @nodejs/lts for opinions on bugfix vs regression and also whether/how to document in changelogs |
This could go into a yaml changelog for <!-- YAML
changes:
- version: v7.0.0
pr-url: https://github.com/nodejs/node/pull/7234
description: URLs with a `file:` scheme will now always use the corrent number of slashes. Also, the `slashes` option is supported properly now.
--> (There’s probably a better text for that, this is just what the issue sounds like to me.) |
OK, so: This probably should have been documented in the change log but it also didn't cause widespread heartache. My apologies to those for whom it caused difficulties. I'll try to be more mindful of marking things as notable changes in the future. Not sure there's any action to be taken on this at this point, so I'm going to close. By all means, comment (or re-open if GitHub allows) if you think there's something to be done at this point. |
IMO there should be a note (in the form of YAML changelog as suggested by @addaleax) next to url.parse() documenting this change of behavior, so reopening. |
PR-URL: #14543 Fixes: #11103 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
Latest major release v7.x changes the default value for
slashes
in url.format() when given objet has a hostname but no protocol. Previouslyslashes: true
wasn't needed in that case, but now it is.Example:
Generating scheme-relative URLs is useful for a website that support both
http
andhttps
; this is a common use case IMHO.I found no mentions of this in the changelog. I believe it's a side effect of commit 336b027 regarding
file:
URLs (removal of!protocol
condition).Is this a bug or just a changelog oversight? API documentation seems to be in line with this new behavior (since v6.x), is this an undocumented bugfix then?
The text was updated successfully, but these errors were encountered: