feat: turn interpreter into crate
This commit is contained in:
1 parent
80d792910f
commit
ee67a041d2
8 files changed
+19
-6
No files matched your search
@@ -0,0 +1,8 @@
|
||||
[package]
|
||||
name = "dioxus-interpreter-js"
|
||||
version = "0.0.0"
|
||||
edition = "2018"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
File renamed without changes.
@@ -0,0 +1,6 @@
|
||||
use std::process::Command;
|
||||
|
||||
fn main() {
|
||||
println!("cargo:rerun-if-changed=interpreter.ts");
|
||||
Command::new("tsc").spawn().unwrap();
|
||||
}
|
||||
@@ -198,7 +198,7 @@ export class Interpreter {
|
||||
this.RemoveEventListener(edit.root, edit.event_name);
|
||||
break;
|
||||
case "NewEventListener":
|
||||
// this handler is only provided on desktop implementations since this
|
||||
// this handler is only provided on desktop implementations since this
|
||||
// method is not used by the web implementation
|
||||
let handler = (event) => {
|
||||
let target = event.target;
|
||||
@@ -1,7 +1,3 @@
|
||||
|
||||
|
||||
|
||||
|
||||
export function main() {
|
||||
let root = window.document.getElementById("main");
|
||||
if (root != null) {
|
||||
@@ -245,7 +241,7 @@ export class Interpreter {
|
||||
case "NewEventListener":
|
||||
|
||||
|
||||
// this handler is only provided on desktop implementations since this
|
||||
// this handler is only provided on desktop implementations since this
|
||||
// method is not used by the web implementation
|
||||
let handler = (event: Event) => {
|
||||
let target = event.target as Element | null;
|
||||
@@ -0,0 +1 @@
|
||||
pub static INTERPRTER_JS: &str = include_str!("../interpreter.js");
|
||||
File renamed without changes.
Reference in new issue
Block a user