Run Babel asynchronously in fixtures#14659
Conversation
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/52239/ |
|
The failure is related, it looks like our logic to detect if dynamic import is supported was broken 😬 |
|
I remember having a similar problem when I was investigating jest-runner, you can try |
|
Yes, but import is in a different file that we require in a try/catch block, so if it was a parsing error would be suppressed and correctly handled 🤔 |
|
This is related to Oh no, node crashes when we actually call it. |
343cabf to
22bcbfa
Compare
22bcbfa to
ef7d200
Compare
|
I'm so annoyed that we have to hard-code the Node.js version, but there is no other synchronous way to know if dynamic import is supported in the current Node.js version. I used this code to test: // demo.js
console.log("syntax is ok");
import("./.eslintrc.cjs").then(console.log, console.error); |
|
Maybe we can use child processes! |
2e3ad47 to
4409364
Compare
|
Probably it's not worth it for this simple check 😬 |
* Run Babel asynchronously in fixtures * Move `checkScopeInfo` to test folder, convert to ESM * Fix Node.js 8 * Avoid dynamic import feature detection
Fixes #1, Fixes #2This was extracted from #13414: by running our tests asynchronously, they can also run ESM plugins. The second commit verifies that it works by converting an existing test-only plugin from CJS to ESM.