Clean up file uploads in desktop/liveview, remove minify
This commit is contained in:
14 files changed
+169
-156
No files matched your search
@@ -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