restore desktop/liveview minification
This commit is contained in:
1 parent
2404bfeeb3
commit
1d664c616e
6 files changed
+43
-44
No files matched your search
@@ -28,7 +28,7 @@ fn main() {
|
||||
if (realId === null) {
|
||||
return;
|
||||
}
|
||||
const message = serializeIpcMessage("user_event", {
|
||||
const message = window.interpreter.serializeIpcMessage("user_event", {
|
||||
name: name,
|
||||
element: parseInt(realId),
|
||||
data: contents,
|
||||
@@ -56,9 +56,9 @@ fn main() {
|
||||
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();
|
||||
// let minified = String::from_utf8(out).unwrap();
|
||||
let mut out = Vec::new();
|
||||
minify(&session, TopLevelMode::Module, js.as_bytes(), &mut out).unwrap();
|
||||
let minified = String::from_utf8(out).unwrap();
|
||||
let mut file = std::fs::File::create("src/minified.js").unwrap();
|
||||
file.write_all(js.as_bytes()).unwrap();
|
||||
file.write_all(minified.as_bytes()).unwrap();
|
||||
}
|
||||
@@ -9,7 +9,7 @@ function main() {
|
||||
|
||||
class IPC {
|
||||
constructor(root) {
|
||||
initialize(root);
|
||||
window.interpreter.initialize(root);
|
||||
const ws = new WebSocket(WS_ADDR);
|
||||
ws.binaryType = "arraybuffer";
|
||||
|
||||
@@ -20,7 +20,7 @@ class IPC {
|
||||
ws.onopen = () => {
|
||||
// we ping every 30 seconds to keep the websocket alive
|
||||
setInterval(ping, 30000);
|
||||
ws.send(serializeIpcMessage("initialize"));
|
||||
ws.send(window.interpreter.serializeIpcMessage("initialize"));
|
||||
};
|
||||
|
||||
ws.onerror = (err) => {
|
||||
|
||||
Reference in new issue
Block a user