Skip to content

fix(types): Change ffi native type from Uint8Array -> Uint8Array<ArrayBuffer> #29127

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

Merged
merged 4 commits into from
May 7, 2025

Conversation

lino-levan
Copy link
Contributor

@lino-levan lino-levan commented May 1, 2025

I believe this was missed in the typescript 5.7 migration PR. Very painful to work around in my userland FFI libraries. Lots of hard casting. I'm pretty sure that the FFI interface can never return a SharedArrayBuffer-backed Uint8Array so this is not a breaking change.

Happy to discuss if wrong.

Copy link
Contributor

@aapoalas aapoalas left a comment

Choose a reason for hiding this comment

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

LGTM! Indeed, Deno FFI never creates SAB's for structs.

@lino-levan
Copy link
Contributor Author

@bartlomieju Could I get a review on this?

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

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

Thanks!

@bartlomieju bartlomieju merged commit 49d19d7 into denoland:main May 7, 2025
18 checks passed
@lino-levan lino-levan deleted the lino/fix-ffi-struct-return branch May 7, 2025 18:43
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.

3 participants