Skip to content

Conversation

@JacksonTian
Copy link
Contributor

recommend developers to use require('module').

@mscdex
Copy link
Contributor

That's not true, require('module').Module definitely is accessible outside of core. However, we would need to run some checks against npm modules to see if they use that or not before removing it. At the very least we'd need to add a deprecation warning. Keeping it around doesn't add any burden though.

@mscdexmscdex added the module Issues and PRs related to the module subsystem. label Jan 6, 2016
@jasnell
Copy link
Member

+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)

@JacksonTian
Copy link
ContributorAuthor

Thanks, I will update it.

@JacksonTianJacksonTianforce-pushed the module branch 2 times, most recently from 442aa63 to 4e4e874CompareJanuary 7, 2016 04:01
@JacksonTianJacksonTian changed the title module: remove unnecessary backwards compatibilitymodule: deprecte require('module').ModuleJan 7, 2016
@jasnelljasnell added the semver-major PRs that contain breaking changes and should be released in the next major version. label Jan 7, 2016
@jasnell
Copy link
Member

LGTM

@mscdex
Copy link
Contributor

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

lib/module.js Outdated
Copy link
Contributor

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.

@cjihrig
Copy link
Contributor

@mscdex did you have something specific in mind?

@jasnell
Copy link
Member

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

@mscdex
Copy link
Contributor

@cjihrig I mean if our intention is to remove it, we should be using "stronger" wording?

@cjihrig
Copy link
Contributor

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).

@silverwindsilverwind changed the title module: deprecte require('module').Modulemodule: deprecate require('module').ModuleJan 9, 2016
@trevnorris
Copy link
Contributor

Just curious, why this and not include others like require('events').EventEmitter?

@JacksonTian
Copy link
ContributorAuthor

@trevnorris If this patch can be accepted, I will do that.

@cjihrig
Copy link
Contributor

LGTM for v6.

@evanlucas
Copy link
Contributor

looks like npm init will be affected by this (https://github.com/npm/promzard/blob/master/promzard.js#L12).

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

@ChALkeR
Copy link
Member

Quick and dirty grep results: https://gist.github.com/ChALkeR/b13b22e813157b4b49d6

@ChALkeR
Copy link
Member

@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 (node_modules is excluded).

@ChALkeR
Copy link
Member

Modules API has Stability: 3 - Locked per doc.
While this PR is unlikely to break anything or affect many modules (the usage seems low), the documentation states that this PR should be rejected.

If Modules API was not Locked, I would vote +1 for this PR.

@evanlucas
Copy link
Contributor

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')`.
@jasnell
Copy link
Member

Any updates on this one?

@jasnell
Copy link
Member

@nodejs/ctc

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

moduleIssues and PRs related to the module subsystem.semver-majorPRs that contain breaking changes and should be released in the next major version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants

@JacksonTian@mscdex@jasnell@cjihrig@trevnorris@evanlucas@ChALkeR@vkurchatkin