Clean up file uploads in desktop/liveview, remove minify

This commit is contained in:
Jonathan Kelley committed 2024-03-05 13:00:27 -08:00
1 parent 56a365742c
commit 403e8e2f49
14 files changed
+169 -156

No files matched your search

+1 -8
View File
@@ -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