Skip to content
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

require.moduleId #126

Merged
merged 2 commits into from
Jun 15, 2017
Merged

require.moduleId #126

merged 2 commits into from
Jun 15, 2017

Conversation

stefanpenner
Copy link
Contributor

@stefanpenner stefanpenner commented Jun 15, 2017

// app/foo
import require from 'require';
require.moduleId // => app/foo

@stefanpenner stefanpenner merged commit db2f6a6 into master Jun 15, 2017
@stefanpenner
Copy link
Contributor Author

released as v4.5.0 🎉

@stefanpenner stefanpenner deleted the moduleId branch June 15, 2017 21:39
@Turbo87
Copy link
Member

Turbo87 commented Jul 5, 2017

@stefanpenner ember-cli/ember-cli-shims#129 (review) just triggered me to look into this some more, but I don't see how this PR changes the situation to implement what @rwjblue was talking about.

also require.moduleId now seems identical to evaluating this.id, which seems to result in the same thing!?

what would seem useful on first glance is if the _reify() method would somehow pass this.id on to the mod.module.exports() call, so that exports() knows where it was imported from and that in turn would need to provide it to the callback function in some way.

@rwjblue
Copy link
Member

rwjblue commented Jul 5, 2017

Ya, I was looking at this also. We should (in debug builds) be able to build up an array of "requirers" that we can then expose (similar to how this PR exposes require.moduleId).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants