Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Load async Wasm and JSON imports in parallel#17818

Merged
nicolo-ribaudo merged 1 commit intobabel:mainfrom
nicolo-ribaudo:parallel-wasm-json-imports
Mar 2, 2026
Merged

Load async Wasm and JSON imports in parallel#17818
nicolo-ribaudo merged 1 commit intobabel:mainfrom
nicolo-ribaudo:parallel-wasm-json-imports

Conversation

@nicolo-ribaudo
Copy link
Member

Q                       A
Fixed Issues? Fixes #1, Fixes #2
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

First commit is from #17816

@nicolo-ribaudo nicolo-ribaudo added the PR: Performance (next major) 🏃‍♀️ A type of pull request used for our changelog categories for next major release label Feb 20, 2026
}

export function buildParallelStaticImports(
function buildParallelStaticImports(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this PR lands after 8.0.0 I'll need to add the export back here.

@nicolo-ribaudo nicolo-ribaudo force-pushed the parallel-wasm-json-imports branch from 40050e1 to 3419729 Compare February 20, 2026 12:31
@babel-bot
Copy link
Collaborator

babel-bot commented Feb 20, 2026

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/61068

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 20, 2026

Open in StackBlitz

commit: fb2a9ec

Copy link
Contributor

@JLHwung JLHwung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a new exec test with multiple failing modules? Previously the behaviour of the transpiled output is to throw from the first failing module, after this PR the behaviour is to throw from one of the failing modules.

@nicolo-ribaudo
Copy link
Member Author

The spec actually does not define which failure to report, because on the web things indeed do happen in parallel.

What do you suggest testing for? Encoding the current behavior, even if it might change?

@JLHwung
Copy link
Contributor

JLHwung commented Feb 20, 2026

The spec actually does not define which failure to report, because on the web things indeed do happen in parallel.

What do you suggest testing for? Encoding the current behavior, even if it might change?

True, I think the current behaviour in this PR is okay. But a covering test will ensure any behaviour change in the future will be informed. We can still add a test for the Node.js behaviour, since previously it was transformed to a waterfall of awaited Promise, now it is a concurrent one.

@nicolo-ribaudo
Copy link
Member Author

@JLHwung I'm struggling with writing a test here, since there isn't really a point at which we can observe "on, reading this file finished before that reading the other file started".

@nicolo-ribaudo nicolo-ribaudo force-pushed the parallel-wasm-json-imports branch from 3419729 to b29d0e5 Compare February 27, 2026 17:19
@liuxingbaoyu
Copy link
Member

@JLHwung I'm struggling with writing a test here, since there isn't really a point at which we can observe "on, reading this file finished before that reading the other file started".

Would it work if we declared a local variable named fetch and added a delay to the first request?

@JLHwung
Copy link
Contributor

JLHwung commented Feb 27, 2026

@JLHwung I'm struggling with writing a test here, since there isn't really a point at which we can observe "on, reading this file finished before that reading the other file started".

OK, if that's the case we don't have to block this PR, we can investigate how to properly test it later.

@JLHwung JLHwung force-pushed the parallel-wasm-json-imports branch from b29d0e5 to fb2a9ec Compare February 27, 2026 21:07
@nicolo-ribaudo nicolo-ribaudo merged commit de54b9b into babel:main Mar 2, 2026
55 checks passed
@nicolo-ribaudo nicolo-ribaudo deleted the parallel-wasm-json-imports branch March 2, 2026 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: Performance (next major) 🏃‍♀️ A type of pull request used for our changelog categories for next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants