-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
module: deprecate require('module').Module #4550
Conversation
That's not true, |
+1 to @mscdex's comments. We cannot simply remove it like this. There is a required deprecated cycle we'd need to go through and even then, once marked deprecated it could end up sticking around for quite a while (even if it's a bit silly having it there) |
Thanks, I will update it. |
442aa63
to
4e4e874
Compare
LGTM |
After this week's CTC meeting discussion about the meaning of "deprecation", should this PR be changed to more accurately reflect the status/intention? Or are we going to commit it now and change the messaging later? Or something else? /cc @nodejs/ctc |
get: internalUtil.deprecate(function() { | ||
return Module; | ||
}, | ||
'require(\'module\').Module is deprecated. Use require(\'module\') instead.') |
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.
You could use a template string to avoid escaping the quotes.
@mscdex did you have something specific in mind? |
Given that the deprecation message doesn't say anything about it being removed and is consistent with the other deprecation messages we have, I'd say it's likely safe to land as is now and work out the revised messaging around deprecation later |
@cjihrig I mean if our intention is to remove it, we should be using "stronger" wording? |
I think this is fine for now. We could do one sweeping PR later to update all the deprecation messages once we know what we want to say (maybe add "and will be removed" to the message). |
Just curious, why this and not include others like |
@trevnorris If this patch can be accepted, I will do that. |
LGTM for v6. |
looks like There are more than just that, waiting on grep to finish... EDIT: Here is the first batch https://gist.github.com/evanlucas/07e4771bbf7a83ca3b16 These are a little bit old, btw |
Quick and dirty grep results: https://gist.github.com/ChALkeR/b13b22e813157b4b49d6 |
@evanlucas You can use my dataset for finding those, it's uploaded long ago to http://oserv.org/npm/Gzemnid/, takes up less than 3 GiB, and an average grep time is about 60-70 seconds. It ignores dependencies though, and searches for the match only in the topmost module sources ( |
Modules API has If Modules API was not Locked, I would vote +1 for this PR. |
Along with the module system being locked, this affects the package manager that is bundled with node. -1 from me as it doesn't really gain us anything... |
recommend developers to use `require('module')`.
recommend developers to use `require('events')`.
Any updates on this one? |
@nodejs/ctc |
recommend developers to use
require('module')
.