Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(schema-wasm): support edge runtimes in addition to Node.js #4950

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aqrln
Copy link
Member

@aqrln aqrln commented Jul 10, 2024

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.

Copy link

codspeed-hq bot commented Jul 10, 2024

CodSpeed Performance Report

Merging #4950 will not alter performance

Comparing integration/schema-wasm-bundler (2ffa63f) with main (9618390)

Summary

✅ 11 untouched benchmarks

Copy link
Contributor

github-actions bot commented Jul 10, 2024

WASM Query Engine file Size

Engine This PR Base branch Diff
Postgres 2.044MiB 2.044MiB 0.000B
Postgres (gzip) 814.637KiB 814.638KiB -1.000B
Mysql 2.013MiB 2.013MiB 0.000B
Mysql (gzip) 801.104KiB 801.104KiB 0.000B
Sqlite 1.915MiB 1.915MiB 0.000B
Sqlite (gzip) 763.664KiB 763.665KiB -1.000B

@aqrln aqrln added this to the 5.17.0 milestone Jul 11, 2024
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.
@aqrln aqrln force-pushed the integration/schema-wasm-bundler branch from 816ba4d to 2ffa63f Compare July 11, 2024 18:02
@aqrln aqrln changed the title feat(schema-wasm): support environments other than Node.js feat(schema-wasm): support edge runtimes in addition to Node.js Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant