-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Fully deprecate require('constants') #26012
Comments
I don't think that freeing up a package name for future (not existing) public use is a good reason for a complete removal of a built-in module. |
Using a monorepo tool such as lerna, each monorepo could declare a |
I know it's not the solution that you're looking for, but you could use a relative file ( Even if we moved forward with the deprecation, I'm not sure that Node would release the name |
See the recent discussion in #26292 regarding the |
That's not an option for me since I'm using Lerna. My require looks like
That's in the direction of helpful, but without the backing security discussion it's sort of just hand waving and saying "because of security". Where can I find the original discussion and decision? I see PR #2405 but it doesn't seem to include the discuss you referenced; that PR mentions a TC meeting from Dec. 30, 2014, but the notes don't discuss a security concern -- just adding a deprecation message. |
Also, as someone writing application code that runs in the node runtime, where should I expect to see a deprecation message about constants? I don't recall seeing one, but it's entirely possible that node informed me I was doing something un-cool and I missed it. edit:
So I'm thinking this means there is no deprecation message for constants in 10.15.1. |
The reason For example, let's say we did drop |
@ZebraFlesh As documentation states, it's currently a documentation-only deprecation. Runtime deprecations are delayed when possible to ease the migration and not pollute user logs with the warnings that are meant for developers. Btw, I think that that needs to be fixed by v12 (i.e. |
Upgrading to |
The original original discussion was from before io.js, let alone the current Node.js project. I don't remember exactly when but that was at least five years ago. The argument is simple: releasing a package name has only minor upsides but potentially serious downsides (think malicious npm modules.) It's easier to err on the side of caution. |
|
There's been no further activity on this. Next step would be to open a PR adding the |
Using lerna, I defined a local package named
constants
. I then tried to consume it in another lerna package via the statementconst constants = require('constants');
Unfortunately, this pulls in the node.js internal constants module instead of my own package. This API is marked as a documentation-only deprecation, DEP0008. However, since it's a documentation-only deprecation, the node.js runtime is still reserving this module name for its own use. It would be great if this package were fully deprecated and the module name became available for consumers.The text was updated successfully, but these errors were encountered: