Skip to content

module: move cjs type check behind experimental-modules flag - #29732

Closed
guybedford wants to merge 2 commits into
nodejs:masterfrom
guybedford:cjs-type-check-flagged
Closed

module: move cjs type check behind experimental-modules flag#29732
guybedford wants to merge 2 commits into
nodejs:masterfrom
guybedford:cjs-type-check-flagged

Conversation

@guybedford

@guybedfordguybedford commented Sep 27, 2019

Copy link
Copy Markdown
Contributor

This puts the check added in #29492 behind the --experimental-modules flag instead of being on by default.

We added this error for require(.js) inside of "type": "module" packages to reduce an edge case hazard but it has caused more compatibility issues itself, for which we need to discuss a way forward.

While we do that, at least restricting the error to --experimental-modules usage will avoid unintentional compatibility issues unflagged.

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

@guybedford

Copy link
Copy Markdown
ContributorAuthor

//cc @nodejs/modules-active-members

Comment threadlib/internal/modules/cjs/loader.js Outdated
@guybedfordguybedford added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. esm Issues and PRs related to the ECMAScript Modules implementation. labels Sep 27, 2019
@guybedford

Copy link
Copy Markdown
ContributorAuthor

I'd like to suggest we fast-track this change as much as possible too.

@guybedfordguybedford added the fast-track PRs that do not need to wait for 48 hours to land. label Sep 27, 2019
@devsnek

Copy link
Copy Markdown
Member

one more checkmark from a core collab from after the fast track label and this can be fast tracked

@hybrist

Copy link
Copy Markdown
Contributor

I treated the comment as the fast-tracking request but I also added the checkmark. So I think this can land now!

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@Trott

Copy link
Copy Markdown
Member

CI is failing because of an unrelated issue. To unblock this, go over to #29741 (comment) and approve the PR and fast-tracking.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@Trott

Copy link
Copy Markdown
Member

Landed in 2825e11

Trott pushed a commit that referenced this pull request Sep 28, 2019
PR-URL: #29732
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
@TrottTrott closed this Sep 28, 2019
targos pushed a commit that referenced this pull request Oct 1, 2019
PR-URL: #29732
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.esmIssues and PRs related to the ECMAScript Modules implementation.fast-trackPRs that do not need to wait for 48 hours to land.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

11 participants

@guybedford@devsnek@hybrist@nodejs-github-bot@Trott@jasnell@antsmartian@targos@cjihrig@gengjiawen@devnexen