Skip to content

Commit

Permalink
feat(schema-wasm): support environments other than Node.js
Browse files Browse the repository at this point in the history
Previously we generated wasm-bindgen bindings for
`@prisma/prisma-schema-wasm` with `--target nodejs`. This makes the
generated glue code use Node.js `fs` module to load the WebAssembly
module from disk and then instantiate it from an array of bytes.

This commit change this to `--target bundler` which is what we use for
`query-engine-wasm`. This makes wasm-bindgen use `import` statement to
load the WebAssembly module instead.

This is a breaking change, and requires updating Prisma CLI and language
tools.
  • Loading branch information
aqrln committed Jul 11, 2024
1 parent 9618390 commit 2ffa63f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion prisma-schema-wasm/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ cp ./prisma-schema-wasm/README.md "$out"/

printf '%s\n' " -> Generating node package"
wasm-bindgen \
--target nodejs \
--target bundler \
--out-dir "$out"/src \
"target/wasm32-unknown-unknown/$TARGET_DIR/prisma_schema_build.wasm"

0 comments on commit 2ffa63f

Please sign in to comment.