Refer to the crate level documentation to learn more.
Example usage for WASI preview 2 plugins:
use ;
generate!;
;
// Dynamically linked modules will use `my_javy_plugin_v1` as the import
// namespace.
javy_plugin!;
export!;
See the crate documentation for WASI preview 1 plugins.
Migration for v2.0.0
Please read the extending Javy documentation for the new plugin API details.
To update your plugin:
- Create a directory named
witadjacent to theCargo.tomlfile - Inside that
witdirectory, create a WIT file matching the details in the extending Javy documentation - Create a
config() -> Configfunction that will return a Javy config - Create a
modify_runtime(runtime: Runtime) -> Runtimefunction that will perform whatever modifications toruntimethat are necessary - Add a dependency on
wit-bindgento your crate - Use
wit_bindgen::generate!to create the required traits from the WIT file - Create a struct type
- Remove
import_namespace!and usejavy_plugin!instead. Ensure you use a different value for theimport_namespaceparameter since the API has changed. Pass your struct type, yourconfigfunction, and yourmodify_runtimefunction. - Call
export!on your struct type.
Publishing to crates.io
To publish this crate to crates.io, run ./publish.sh.