Skip to content
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

esm: Unflag --experimental-modules #29866

Closed
wants to merge 6 commits into from
Closed

Conversation

guybedford
Copy link
Contributor

@guybedford guybedford commented Oct 7, 2019

This PR unflags the --experimental-modules support making modules on-by-default, while remaining backwards-compatible with the current runMain.

This PR should only land after the remaining PRs have been fully considered:

  • Fix 3 remaining task_queue timing issues in this PR (discussed in #29866 (comment))
  • Re-flagging --experimental-json-modules (#29754)
  • Package-relative loading (#29327)
  • Unflagging --experimental-exports (#29867)
  • Bootstrap refactoring (#29937)
  • Resolution on exports fallback to main (#29932)
  • Conditional exports considerations (#29978)
  • Matching ESM extensions order (#29974)

In addition to:

  • Ensuring documentation has been fully reviewed for an unflagged modules release
  • Sign off from the modules group.
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-bot nodejs-github-bot added the lib / src label Oct 7, 2019
@guybedford guybedford added the esm label Oct 7, 2019
@guybedford
Copy link
Contributor Author

@guybedford guybedford commented Oct 7, 2019

//cc @nodejs/modules-active-members

@guybedford
Copy link
Contributor Author

@guybedford guybedford commented Oct 7, 2019

The three failing tests in this PR are:

  • ./node ./test/addons/async-hooks-promise/test.js the async hook promise injection is not being removed despite being disabled in https://github.com/nodejs/node/pull/29848/files#diff-e6db408e12db906ead6ddfac3de15a6fR314. @jasnell would value your input on this one if you have any suggestions here.
  • ./node ./test/addons/make-callback-recurse/test.js, ./node ./test/node-api/test_make_callback_recurse/test.js both seem due to subtle timing changes with the switch to a promise-based bootstrap.

test/message/stack_overflow.out Outdated Show resolved Hide resolved
@Trott Trott added the wip label Oct 9, 2019
@Trott
Copy link
Member

@Trott Trott commented Oct 9, 2019

Adding WIP label based on PR description. Feel free to remove when appropriate, swap out with blocked label, or whatever. No strong opinions here. Just seems like the right thing to me. (The WIP label helps me in my workflow with the repository, so it's not just cosmetic for me, if that matters. But again, no strong opinions on this particular PR in that regard.)

@guybedford guybedford force-pushed the unflag-pr branch 2 times, most recently from f391964 to fe3c3d1 Compare Oct 10, 2019
@guybedford
Copy link
Contributor Author

@guybedford guybedford commented Oct 10, 2019

On @joyeecheung's advice I've gone ahead and changed the way the async bootstrap works. Instead of always applying an async bootstrap, the async bootstrap and all promises associated will only apply lazily when the ESM loader is actually in use. This way loading CommonJS retains a fully sync bootstrap that is completely backwards compatible with no timings changes or task queue differences.

This also removes the dependence of this work on #29848.

All tests are now passing! Further review welcome.

@guybedford
Copy link
Contributor Author

@guybedford guybedford commented Oct 11, 2019

I've split out the bootstrap changes into a separate PR at #29937, and based this unflagging to that PR for a simpler diff.

@MylesBorins
Copy link
Member

@MylesBorins MylesBorins commented Oct 14, 2019

We likely want #29974 to land as well

@MylesBorins
Copy link
Member

@MylesBorins MylesBorins commented Oct 30, 2019

@nodejs/modules anyone have an issue with renaming --loader to --experimental-loader before we land this? I can open a PR (and 12.x backport), but I'd be concerned with unflagging and not being explicit about this

targos pushed a commit to targos/node that referenced this issue Apr 25, 2020
PR-URL: nodejs#29866
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
targos pushed a commit to targos/node that referenced this issue May 7, 2020
PR-URL: nodejs#29866
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
targos pushed a commit that referenced this issue May 7, 2020
PR-URL: #29866
Backport-PR-URL: #33055
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
targos pushed a commit that referenced this issue May 13, 2020
PR-URL: #29866
Backport-PR-URL: #33055
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
esm lib / src semver-minor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet