Changing generated Typescript or C++ bindings templates
The central workings of a uniffi-bingen are its templates.
uniffi-bindgen-react-native templates are in the following directories:
Templates are written for Rinja templating library.
The WASM crate is generated with quote, in the gen_rust module.
There is a small-ish runtime per target:
typescript/src, with tests and polyfills. This is the TypeScript runtime, published to npm as@ubjs/coreand shared by all targets.- [’cpp/includes
][cpp-runtime], the C++/JSI runtime for React Native, published as theuniffi-bindgen-react-native.podspec`. runtimes/napi, the N-API runtime for Node.js, published as@ubjs/node. Its Rust core is inruntimes/core.
This is intended to allow developers from outside the project to contribute more easily.
Making a change to the templates should be accompanied by an additional test, either in an existing test fixture, or a new one.
Running the tests can be done with:
cargo test
An individual fixture can be tested:
cargo test -p uniffi-fixture-$fixtureName