Skip to content

esm: make dynamic import work in the REPL - #29437

Closed
bmeck wants to merge 1 commit into
nodejs:masterfrom
bmeck:repl-dynamic-import
Closed

esm: make dynamic import work in the REPL#29437
bmeck wants to merge 1 commit into
nodejs:masterfrom
bmeck:repl-dynamic-import

Conversation

@bmeck

@bmeckbmeck commented Sep 4, 2019

Copy link
Copy Markdown
Member

This ensures that import("fs") will work in the REPL with --experimental-modules

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

@nodejs-github-botnodejs-github-bot added the repl Issues and PRs related to the REPL subsystem. label Sep 4, 2019

@BridgeARBridgeAR left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM % nits

Comment threadlib/repl.js Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should that not be loaded at the top level?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

could be, but i don't think we eagerly load esm_loader at top in most places since it is experimental/flagged, we do so as late as possible like in

constesm=require('internal/process/esm_loader');
. we could probably make this even lazier though now that i think about it.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

moved up but remaining in defaultEval; made it lazier.

Comment threadlib/repl.js Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: please move it out of the loop, since it won't change inside of the loop.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

fixed

@bmeck
bmeckforce-pushed the repl-dynamic-import branch from b8c663d to b798182CompareSeptember 6, 2019 15:50
@bmeck

bmeck commented Sep 6, 2019

Copy link
Copy Markdown
MemberAuthor

rebased, running CI then will merge if no objections

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@bmeck

bmeck commented Sep 6, 2019

Copy link
Copy Markdown
MemberAuthor

Landed in cdebd32

bmeck pushed a commit that referenced this pull request Sep 6, 2019
PR-URL: #29437
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: David Carlier <devnexen@gmail.com>
@TrottTrott closed this Sep 7, 2019
targos pushed a commit that referenced this pull request Sep 20, 2019
PR-URL: #29437
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: David Carlier <devnexen@gmail.com>
@BridgeARBridgeAR mentioned this pull request Sep 24, 2019
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

replIssues and PRs related to the REPL subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants

@bmeck@nodejs-github-bot@lpinca@devnexen@devsnek@BridgeAR@Trott@bfarias-godaddy