Skip to content

Conversation

juj
Copy link
Collaborator

@juj juj commented Sep 28, 2025

Abort build if attempting to target -sEXPORT_ES6 and multithreading with too old target browser versions.

Add ES6 Module Workers as feature in the feature matrix.

@juj
Copy link
Collaborator Author

juj commented Sep 29, 2025

Naively adding #error messages resulted in all of our test suites failing, since we do currently have too low default MIN_*_VERSION requirements to enable EXPORT_ES6.

So changed this PR to establish ES6 Module Workers as a feature instead.

@juj juj requested a review from sbc100 September 29, 2025 14:06
#endif
#if MIN_SAFARI_VERSION < 150000
#error new Worker() supports ECMAScript module only starting from Safari 15. Pass -sMIN_SAFARI_VERSION=150000 to target -sEXPORT_ES6 with -pthread. See https://caniuse.com/mdn-api_worker_worker_ecmascript_modules
#endif
Copy link
Collaborator

Choose a reason for hiding this comment

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

It is even possible to hit these error now that the feature is added? i.e. -sEXPORT_ES6 + -pthreads will now force the correct versions or fail, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I was pondering the same, so wanted to add these in to verify that won't be the case. Doesn't hurt to have them?

Or I could remove them - but seems like they're safe to have, they could trigger on possible refactors down the road.

@juj juj merged commit 9565865 into emscripten-core:main Sep 29, 2025
33 checks passed
sbc100 added a commit to sbc100/emscripten that referenced this pull request Sep 29, 2025
Without this change it might appear that this is where the
check/enforcement is happening, but its actually done by the
feature_matrix.
sbc100 added a commit that referenced this pull request Sep 29, 2025
Without this change it might appear that this is where the
check/enforcement is happening, but its actually done by the
feature_matrix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants