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

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:

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 Issues and PRs related to general changes in the lib or src directory. label Oct 7, 2019
@guybedford guybedford added the esm Issues and PRs related to the ECMAScript Modules implementation. label Oct 7, 2019
@guybedford
Copy link
Contributor Author

//cc @nodejs/modules-active-members

@guybedford
Copy link
Contributor Author

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.

@Trott Trott added the wip Issues and PRs that are still a work in progress. label Oct 9, 2019
@Trott
Copy link
Member

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 October 10, 2019 20:54
@guybedford
Copy link
Contributor Author

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

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
Contributor

We likely want #29974 to land as well

@MylesBorins
Copy link
Contributor

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
esm Issues and PRs related to the ECMAScript Modules implementation. lib / src Issues and PRs related to general changes in the lib or src directory. semver-minor PRs that contain new features and should be released in the next minor version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.