extend interpreter base class with platform methods

This commit is contained in:
Jonathan Kelley committed 2024-02-27 12:31:11 -08:00
1 parent 7f60010c1e
commit b5447c162f
27 files changed
+1394 -1371

No files matched your search

+11 -6
View File
@@ -5,14 +5,9 @@
pub static INTERPRETER_JS: &str = include_str!("./gen/interpreter.js");
pub static COMMON_JS: &str = include_str!("./gen/common.js");
#[cfg(feature = "sledgehammer")]
mod sledgehammer_bindings;
#[cfg(feature = "sledgehammer")]
pub use sledgehammer_bindings::*;
#[cfg(all(feature = "binary-protocol", feature = "sledgehammer"))]
mod write_native_mutations;
#[cfg(all(feature = "binary-protocol", feature = "sledgehammer"))]
pub use write_native_mutations::*;
@@ -20,8 +15,18 @@ pub use write_native_mutations::*;
#[cfg(all(feature = "minimal_bindings", feature = "webonly"))]
pub mod minimal_bindings {
use wasm_bindgen::{prelude::wasm_bindgen, JsValue};
/// Some useful snippets that we use to share common functionality between the different platforms we support.
///
/// This maintains some sort of consistency between web, desktop, and liveview
#[wasm_bindgen(module = "/src/gen/common.js")]
extern "C" {
/// Set the attribute of the node
pub fn setAttributeInner(node: JsValue, name: &str, value: JsValue, ns: Option<&str>);
pub fn collectFormValues(node: JsValue) -> JsValue;
}
}
#[cfg(feature = "sledgehammer")]
pub mod unified_bindings;