FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

module: enable subpath imports in REPL by rayw000 · Pull Request #43450 · nodejs/node · GitHub

/ node Public

module: enable subpath imports in REPL - #43450

Merged
nodejs-github-bot merged 2 commits into
nodejs:mainfrom
rayw000:fix-43410
Jun 30, 2022
Merged

module: enable subpath imports in REPL#43450
nodejs-github-bot merged 2 commits into
nodejs:mainfrom
rayw000:fix-43410

Conversation

rayw000 commented Jun 16, 2022

Copy link
Copy Markdown
Contributor

Also enable subpath imports in REPL.

fix: #43410

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/modules

nodejs-github-bot added the needs-ci PRs that need a full CI run. label Jun 16, 2022
rayw000 changed the title modules: enable subpath imports in REPL module: enable subpath imports in REPL Jun 16, 2022

guybedford left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

rayw000 commented Jun 17, 2022

Copy link
Copy Markdown
Contributor Author

Thank you @guybedford

I'm not quite clear about your parentPath. Could you explain it a little bit more?

Comment thread lib/internal/modules/cjs/loader.js Outdated

aduh95 left a comment
edited
Loading

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Could you add a test that; s failing on main and passing with this PR please?

rayw000 commented Jun 17, 2022

Copy link
Copy Markdown
Contributor Author

Could you add a test that; s failing on main and passing with this PR please?

Sure. Done.

Comment thread test/es-module/test-esm-repl-imports.js Outdated
Comment thread test/es-module/test-esm-repl-imports.js Outdated
Comment thread test/es-module/test-esm-repl-imports.js Outdated

guybedford left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I take it import() works correctly on the REPL for this same case?

rayw000 commented Jun 18, 2022
edited
Loading

Copy link
Copy Markdown
Contributor Author

I take it import() works correctly on the REPL for this same case?

Yes, it works for import() too. I've added necessary test case to ensure this.

aduh95 added author ready PRs that have at least one approval, no outstanding review comments, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Jun 18, 2022
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jun 18, 2022

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

aduh95 added commit-queue Add this label to land a pull request using GitHub Actions. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. labels Jun 30, 2022
nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jun 30, 2022
nodejs-github-bot merged commit c15a605 into nodejs:main Jun 30, 2022

Copy link
Copy Markdown
Collaborator

Landed in c15a605

rayw000 deleted the fix-43410 branch July 1, 2022 03:15
targos pushed a commit that referenced this pull request Jul 12, 2022
PR-URL: #43450
Fixes: #43410
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos pushed a commit that referenced this pull request Jul 31, 2022
PR-URL: #43450
Fixes: #43410
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
guangwong pushed a commit to noslate-project/node that referenced this pull request Oct 10, 2022
PR-URL: nodejs/node#43450
Fixes: nodejs/node#43410
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no outstanding review comments, and a CI started. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Subpath imports (require "#foo") do not work in REPL

6 participants


Back | FazBrowse Home | New Git URL