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

[tsgen] Support JSPI when emitting TypeScript definitions. #23320

Merged
merged 2 commits into from
Jan 8, 2025

Conversation

brendandahl
Copy link
Collaborator

  • Adds a Promise wrapper around the return type for async embind functions.
  • Disables JSPI while generating the definitions, since it's not needed.

Fixes #23272

- Adds a Promise<T> wrapper around the return type for async embind functions.
- Disables JSPI while generating the definitions, since it's not needed.

Fixes emscripten-core#23272
# JSPI is not needed to generate the definitions.
# TODO: when the emsdk node version supports JSPI, it probably makes more sense
# to enable it in node than disabling the setting here.
settings.ASYNCIFY = 0
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why not settings.JSPI = 0 here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

JSPI really is just ASYNCIFY = 2. I guess it's probably more clear if only use the asyncify setting, e.g. if settings.ASYNCIFY == 2:.

Copy link
Collaborator

Choose a reason for hiding this comment

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

sgtm

@brendandahl brendandahl merged commit 6b81620 into emscripten-core:main Jan 8, 2025
29 checks passed
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.

Build fails when both -sJSPI and --emit-tsd are active
2 participants