Skip to content

Synchronous access to module compiled with WASM=0 #12647

@nrabinowitz

Description

@nrabinowitz

I'm using emscripten to compile C code for the h3-js library. The library is currently compiled as JS, not WASM (though we'd like to also add a WASM version as well in the future). We're currently using emscripten v1.38.43, and I was planning to upgrade, but after some digging I can see that there's a breaking change in v1.39.16 to return a Promise instead of the module itself when using MODULARIZE.

I can't use the async approach without forcing all of my library consumers to import h3-js in an async manner as well, which is a breaking change and contrary to the goals of the library and expectations of the users, which assume that the library is just a set of pure functions.

My assumption is that if I'm not using WASM, the initialization of the module is actually synchronous. Is there a way to synchronously access it in this case? The alternative seems to be to stay on our current version of Emscripten indefinitely.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions