From 2ffa63fd33dd7e91a23a7baf5806a3fb89e859b1 Mon Sep 17 00:00:00 2001 From: Alexey Orlenko Date: Wed, 10 Jul 2024 22:37:23 +0200 Subject: [PATCH] feat(schema-wasm): support environments other than Node.js 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. --- prisma-schema-wasm/scripts/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prisma-schema-wasm/scripts/install.sh b/prisma-schema-wasm/scripts/install.sh index aafc335956d7..2affbc656619 100755 --- a/prisma-schema-wasm/scripts/install.sh +++ b/prisma-schema-wasm/scripts/install.sh @@ -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"