-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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: enable subpath imports in REPL #43450
Conversation
Review requested:
|
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 think this is a good feature to have, but we shouldn't be duplicating the code.
Could the parent
for the REPL context not just have a filename
set to the CWD directory? I think something like that would be best for this code not to need to know about repl at all and instead for it to be a REPL feature entirely. Alternatively, if something like that on the REPL side isn't at all possible, at least use a temporary variable parentPath
to not duplicate the code.
Thank you @guybedford I'm not quite clear about your |
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.
Could you add a test that; s failing on main
and passing with this PR please?
Sure. Done. |
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 take it import()
works correctly on the REPL for this same case?
Yes, it works for |
Landed in c15a605 |
PR-URL: #43450 Fixes: #43410 Reviewed-By: Guy Bedford <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: #43450 Fixes: #43410 Reviewed-By: Guy Bedford <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: nodejs/node#43450 Fixes: nodejs/node#43410 Reviewed-By: Guy Bedford <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: James M Snell <[email protected]>
Also enable subpath imports in REPL.
fix: #43410