flatbuffers icon indicating copy to clipboard operation
flatbuffers copied to clipboard

WASM binary of flatc for cross-system schema compilation

Open Ctrlmonster opened this issue 8 months ago • 4 comments

Hey,

I was wondering if it'd be possible to build a wasm binary of flatc and include it with the releases.

This way anyone who's cloning a repo using flatbuffers can immediately start writing schemas and won't have to worry about preparing their system before, if that repo has a build script using the wasm binary (i.e. in a package.json or similar).

Cheers

Ctrlmonster avatar May 06 '25 10:05 Ctrlmonster

I had this working a few years ago, I am trying to update it to use an Emscripten API instead of the WASI filesystem hacks currently being used.

TJKoury avatar Jun 09 '25 14:06 TJKoury

Good news; my updated WASM branch is working.

I'm going to publish an NPM package within the next week, which will also have my --preserve-case functionality in it, for my own use.

TJKoury avatar Jul 24 '25 23:07 TJKoury

Here it is: flatc-wasm

TJKoury avatar Aug 08 '25 15:08 TJKoury

Super cool, thanks for publishing this! 🙏 Would be cool if wasm would be picked up as a target in the official release cycle and then maybe the npm lib could always point to the latest binary (?). Anyways, thanks for your involvement, very much appreciated!

Ctrlmonster avatar Aug 09 '25 04:08 Ctrlmonster