Skip to content

module: expose exports conditions to loaders - #31303

Closed
hybrist wants to merge 1 commit into
nodejs:masterfrom
hybrist:loader-conditions
Closed

module: expose exports conditions to loaders#31303
hybrist wants to merge 1 commit into
nodejs:masterfrom
hybrist:loader-conditions

Conversation

@hybrist

@hybristhybrist commented Jan 10, 2020

Copy link
Copy Markdown
Contributor
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@nodejs-github-botnodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. esm Issues and PRs related to the ECMAScript Modules implementation. labels Jan 10, 2020
@hybrist

Copy link
Copy Markdown
ContributorAuthor

/cc @nodejs/modules-active-members

Comment threadlib/internal/modules/esm/resolve.js Outdated
Comment threadsrc/module_wrap.cc Outdated
Comment threadsrc/module_wrap.cc Outdated
Comment threadsrc/module_wrap.cc Outdated
Comment threadsrc/module_wrap.cc Outdated
Comment threadsrc/module_wrap.cc Outdated
Comment threadsrc/module_wrap.cc Outdated
Comment threadsrc/module_wrap.cc Outdated
Comment threadsrc/module_wrap.cc Outdated
Comment threadsrc/module_wrap.cc Outdated
@guybedford

Copy link
Copy Markdown
Contributor

Nice work, this approach seems great!

Comment threadtest/fixtures/es-module-loaders/loader-with-custom-condition.mjs Outdated
@hybrist
hybristforce-pushed the loader-conditions branch 9 times, most recently from d05c96e to 66ebe58CompareFebruary 10, 2020 18:13
@hybrist
hybrist marked this pull request as ready for review February 10, 2020 18:18
@hybrist

Copy link
Copy Markdown
ContributorAuthor

Cleaned up and marking as ready for review. I updated the implementation to use a std::set instead of V8::Set. In the process the conditions cache got moved into C++, JS only creates the key (\0-separated condition names).

@guybedfordguybedford 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.

Seems like a nice approach.

Comment threadsrc/module_wrap.cc Outdated
Comment threadtest/fixtures/es-module-loaders/loader-with-custom-condition.mjs Outdated
@hybristhybrist added the modules-agenda Issues and PRs to discuss during the meetings of the Modules team. label Mar 2, 2020
@hybrist

Copy link
Copy Markdown
ContributorAuthor

Ping @nodejs/modules-active-members, this is still lacking some reviews/approvals before we can land it. Adding it to the agenda in case it's still open by our next meeting. :)

@bmeckbmeck 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.

I really like this PR! This falls into some things we are starting to see from the community about custom conditions like https://twitter.com/sebmarkbage/status/1234223477424447488 .

@nodejs-github-bot

This comment has been minimized.

@hybristhybrist added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Mar 2, 2020
Comment threadtest/fixtures/es-module-loaders/loader-with-custom-condition.mjs Outdated
@nodejs-github-bot

This comment has been minimized.

@guybedfordguybedford 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.

Would be great to see this moving forward :)

Comment threadsrc/module_wrap.cc Outdated
Comment threadtest/fixtures/es-module-loaders/loader-with-custom-condition.mjs Outdated
Comment threaddoc/api/esm.md Outdated

@guybedfordguybedford 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.

Looks good, thanks.

Comment threaddoc/api/esm.md Outdated
Comment threadlib/internal/modules/esm/resolve.js Outdated
Comment threadlib/internal/modules/esm/resolve.js Outdated
@nodejs-github-bot

nodejs-github-bot commented Mar 29, 2020

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/30219/ (:heavy_check_mark:)

@nodejs-github-bot

This comment has been minimized.

Comment threadlib/internal/modules/esm/loader.js Outdated
@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@hybrist

Copy link
Copy Markdown
ContributorAuthor

There's one C++ test that seems to fail on linuxone. I look into it briefly but I don't see a clear reason why it would fail (or what the failure really means). I'm surprised that this PR would affect low-level worker interactions but can't rule it out.

@addaleax

Copy link
Copy Markdown
Member

@jkrems See #32563 – I just landed a fix for that. :) Is this still ready to land, apart from waiting for a green CI?

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@hybrist

hybrist commented Apr 2, 2020

Copy link
Copy Markdown
ContributorAuthor

Is this still ready to land, apart from waiting for a green CI?

Yes! This should be good to go, assuming CI comes back green.

(And thanks for being on top of these build failures, much appreciated. :))

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

addaleax pushed a commit that referenced this pull request Apr 2, 2020
PR-URL: #31303
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>
@addaleax

Copy link
Copy Markdown
Member

Landed in 9129ab1

@addaleaxaddaleax closed this Apr 2, 2020
BethGriggs pushed a commit that referenced this pull request Apr 7, 2020
PR-URL: #31303
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>
targos pushed a commit that referenced this pull request Apr 12, 2020
PR-URL: #31303
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>
@targostargos mentioned this pull request Apr 13, 2020
@targostargos removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Apr 25, 2020
targos pushed a commit to targos/node that referenced this pull request Apr 25, 2020
PR-URL: nodejs#31303
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>
targos pushed a commit that referenced this pull request Apr 28, 2020
PR-URL: #31303
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>
@targostargos mentioned this pull request May 2, 2020
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

esmIssues and PRs related to the ECMAScript Modules implementation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants

@hybrist@guybedford@nodejs-github-bot@GeoffreyBooth@bmeck@addaleax@ljharb@himself65@MylesBorins@targos