-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
doc: clarify the meaning of legacy status #42269
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
Changes from 5 commits
3323b8a
128c438
75c4766
d437706
471d162
e3d9b27
4273271
0334b1c
85ace39
71fa00c
cc7d2dd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -42,7 +42,7 @@ The stability indices are as follows: | |||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| > Stability: 3 - Legacy. The feature is no longer recommended for use. While it | ||||||||||||||||||||||||||||||||||||
| > likely will not be removed, and is still covered by semantic-versioning | ||||||||||||||||||||||||||||||||||||
| > guarantees, use of the feature should be avoided. | ||||||||||||||||||||||||||||||||||||
| > guarantees, use of the feature should be avoided if possible. | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
| > Stability: 3 - Legacy. The feature is no longer recommended for use. While it | |
| > likely will not be removed, and is still covered by semantic-versioning | |
| > guarantees, use of the feature should be avoided. | |
| > guarantees, use of the feature should be avoided if possible. | |
| > Stability: 3 - Legacy. Avoid using the feature. Although it is unlikely | |
| > to be removed and is still covered by semantic-versioning guarantees, | |
| > there are more robust and secure alternatives. |
I'm also fine with the if possible being left in place or removed. These are all wordsmithing things that can be iterated on later. Any of them will work for now as far as I'm concerned.
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.
It might be helpful to add something to the effect of "it is not necessary to track down all instances of this feature in every module in your dep tree and spam the maintainers with PRs" but maybe with like 80% less snark than that 😅
> Stability 3 - Legacy. Avoid using the feature in new code. Although it is
> unlikely to be removed and is still covered by semantic-versioning
> guarantees, it is no longer actively maintained, and better options are
> available. Features are marked as Legacy rather than being Deprecated if
> their use does no harm, and they are widely relied upon within the npm
> ecosystem. Bugs found in Legacy features are unlikely to be fixed.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.
Maybe that can go directly below rather than inside the banner?
| > Stability: 3 - Legacy. The feature is no longer recommended for use. While it | |
| > likely will not be removed, and is still covered by semantic-versioning | |
| > guarantees, use of the feature should be avoided. | |
| > guarantees, use of the feature should be avoided if possible. | |
| > Stability: 3 - Legacy. Avoid using the feature. Although it is unlikely | |
| > to be removed and is still covered by semantic-versioning guarantees, | |
| > there are more robust and secure alternatives. | |
| Features are marked as Legacy rather than Deprecated if they are too | |
| widely relied upon within the npm ecosystem to be removed. |
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.
The "if their use does no harm" part is pretty useful; it tells everyone that there is nothing wrong with using Legacy things, and thus no reason to pester maintainers to migrate away from them.
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.
The "if their use does no harm" part is pretty useful;
I'm not sure everyone would agree with the characterization that Legacy APIs do no harm and that there's nothing wrong with using them. Regarding url.parse(), our docs currently say this:
Because the url.parse() method uses a lenient, non-standard algorithm for parsing URL strings, security issues can be introduced. Specifically, issues with host name spoofing and incorrect handling of usernames and passwords have been identified.
I would consider that at odds with "there is nothing wrong with using" it, although I'm sure there are semantic arguments to be had here.
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.
I'm not sure everyone would agree with the characterization that Legacy APIs do no harm and that there's nothing wrong with using them.
If the API is actually harmful and there is no way to fix such issues, I think we should help our users migrate to the recommended API by emitting a runtime warning and deprecate it because we don't want our users to get harmed.
I think https://stackoverflow.com/a/2873695 sums up what deprecated and legacy means really well:
Deprecation means that it's bad and shouldn't be used.
Legacy just means that it's old and there are ways of doing something which are generally, but not necessarily, better.
Given that url.parse() has a performance benefit and also makes it easier to handle relative URLs, I don't see why people should not use it even in newer code.
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.
Updated accordingly, PTAL.
Uh oh!
There was an error while loading. Please reload this page.