Clean up file uploads in desktop/liveview, remove minify
This commit is contained in:
14 files changed
+169
-156
No files matched your search
@@ -24,7 +24,6 @@ serde = { version = "1.0.151", features = ["derive"] }
|
||||
serde_json = "1.0.91"
|
||||
dioxus-html = { workspace = true, features = ["serialize", "eval", "mounted"] }
|
||||
rustc-hash = { workspace = true }
|
||||
minify-js = "0.5.6"
|
||||
dioxus-core = { workspace = true, features = ["serialize"] }
|
||||
dioxus-interpreter-js = { workspace = true, features = ["binary-protocol"] }
|
||||
dioxus-hot-reload = { workspace = true, optional = true }
|
||||
|
||||
@@ -32,7 +32,6 @@ pub enum LiveViewError {
|
||||
|
||||
fn handle_edits_code() -> String {
|
||||
use dioxus_interpreter_js::unified_bindings::SLEDGEHAMMER_JS;
|
||||
use minify_js::{minify, Session, TopLevelMode};
|
||||
|
||||
let serialize_file_uploads = r#"if (
|
||||
target.tagName === "INPUT" &&
|
||||
@@ -81,15 +80,9 @@ fn handle_edits_code() -> String {
|
||||
.unwrap_or_else(|| interpreter.len());
|
||||
interpreter.replace_range(import_start..import_end, "");
|
||||
}
|
||||
|
||||
let main_js = include_str!("./main.js");
|
||||
|
||||
let js = format!("{interpreter}\n{main_js}");
|
||||
|
||||
let session = Session::new();
|
||||
let mut out = Vec::new();
|
||||
minify(&session, TopLevelMode::Module, js.as_bytes(), &mut out).unwrap();
|
||||
String::from_utf8(out).unwrap()
|
||||
js
|
||||
}
|
||||
|
||||
/// This script that gets injected into your app connects this page to the websocket endpoint
|
||||
|
||||
Reference in new issue
Block a user