Conversation
hoodmane
commented
Nov 25, 2025
- Add a CHANGELOG entry
- Add / update tests
- Add new / update outdated documentation
37cadfa to
03c8785
Compare
| arrayType = BigUint64Array; | ||
| break; | ||
| case "e": | ||
| arrayType = Float16Array; |
There was a problem hiding this comment.
Float16Array is not be available in old browsers and Node < 24. Maybe we need to handle those cases?
There was a problem hiding this comment.
Would we consider Node 24 too early? Also, not sure if this question is silly, but would we need to polyfill Float16Array (or use an existing one like https://github.com/petamoriken/float16)?
Also, I think we would need to use the --js-float16array flag.
There was a problem hiding this comment.
No polyfill, it just will fail with an error on old runtimes just like it used to do.
On node 24, it is available by default with no flag.
There was a problem hiding this comment.
It fails with:
JsException: ReferenceError: Float16Array is not defined
when this is used, which I think is okay. If you want though I could change it to an error saying the JS runtime is too old to support Float16.
There was a problem hiding this comment.
Okay, glad to hear it's supported in Node 24 without any flags (I don't know why, but it is hard to find their release notes and CHANGELOG indicating this)
Yes, I think a clearer error message to the user would be useful, thanks!
There was a problem hiding this comment.
If it fails in the runtime not in compile time, that's fine with me. People who use Float16Array should be aware of whether their environment supports Float16Array.
We will need to make tsd happy to make our CI pass though.
../../dist/ffi.d.ts:6:124
✖ 6:124 Cannot find name Float16Array. Did you mean Float64Array?
✖ 20:1 A computed property name in a class property declaration must have a simple literal type or a unique symbol type.