We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This PR significantly increases the prisma-engine wasm build and makes it impossible to build with the free Cloudflare Workers plan!
over 1M (cloudflare limit) for pogtgress
#5002 (comment)
In fact, regex crate is getting into the runtime on this line
https://github.com/prisma/prisma-engines/pull/5002/files#diff-7a3b1196bc58de119ae8a5d92271b4749892576c8a8548394ce5e17ca9019186R1-R37
I have done some preliminary research on this and it is +650k if you bundle rust regex crate with wasm.
(these are my notes in Japanese, sry) https://zenn.dev/mizchi/scraps/413cd989324fc7
For simple regular expressions like this one, you can solve it by switching to borrow the regex engine from the JS host in js_sys::RegExp.
https://rustwasm.github.io/wasm-bindgen/api/js_sys/struct.RegExp.html
Here's a simple snippet that uses it.
use js_sys::RegExp; #[wasm_bindgen]. pub fn regex_exec(input: &str) -> bool { let expr = RegExp::new(r"\w+", "u"); expr.test(input) }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
This PR significantly increases the prisma-engine wasm build and makes it impossible to build with the free Cloudflare Workers plan!
over 1M (cloudflare limit) for pogtgress
#5002 (comment)
Problem
In fact, regex crate is getting into the runtime on this line
https://github.com/prisma/prisma-engines/pull/5002/files#diff-7a3b1196bc58de119ae8a5d92271b4749892576c8a8548394ce5e17ca9019186R1-R37
I have done some preliminary research on this and it is +650k if you bundle rust regex crate with wasm.
(these are my notes in Japanese, sry)
https://zenn.dev/mizchi/scraps/413cd989324fc7
Solution.
For simple regular expressions like this one, you can solve it by switching to borrow the regex engine from the JS host in js_sys::RegExp.
https://rustwasm.github.io/wasm-bindgen/api/js_sys/struct.RegExp.html
Here's a simple snippet that uses it.
The text was updated successfully, but these errors were encountered: