fix: remove unused ubrn WASM scaffolding - #727
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
Included review availability: Your plan provides up to 2 included reviews per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe change adds a shared React Native cleanup helper. The create flow uses it instead of local web entrypoint cleanup. The Noir build flow calls it after React Native bindings generation. ChangesReact Native cleanup
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The change removes stale web/WASM artifacts that can break React Native installation and build preparation; no actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
moven0831
left a comment
There was a problem hiding this comment.
Hi, the PR looks good to me. It's ready to be merged once the cargo fmt is fixed.
Thanks for the contribution!
Summary
npm install/run android's
prepare: bob buildstep fails after rebuilding and updating the react-native app bindings because of a stale rn-web templateindex.web.tsthat tries to import missingsrc/generated/wasm-bindgen/which is never a target in Mopro (ubrn web buildnever runs).This only happens if we build Noir rn android targets since the solution you guys adopted on zig linker dropping the .symtab is to run
ubrn generate all <lib>.so --flavor jsion an NDK linked android lib to extract UniFFI metadata. This solution works fine butgenerate allwith no specified platform will still render both JSI and WASM templates,--flavor jsionly tells ubrn how the UniFFI TS/C++ from the .so is written.This problem was already cited and semi-solved in
cli/src/create/react_native.rsBut this solution is temporary and only covers the template creation step by correctly removing
index.web.ts(it also still leaves other junk like the wasm crate inrust_modulesdir). Once we update the bindings of the app,index.web.tsand the warm crate will appear again in the app bindings dir, leading to the same error we discussed until now.Fix
To properly and definitely fix this I simply added a public helper in
mopro-ffi/src/app_config/react_native.rsto be shared by bothreact_native_noir.rsandcreate/react_native.rs. To manage the removal of all the wasm glue, bothindex.web.tsandrust_modules/wasm, this helper gets called after the noir rn android build duringmopro buildand after the copying of the bindings in rn template duringmopro createnote: I put the helper in mopro-ffi's react_native.rs file since it is how create and build share rn dir cleanup.
Summary by CodeRabbit