Skip to content

Commit 7a5a46d

Browse files
final build
1 parent f5e2865 commit 7a5a46d

4 files changed

Lines changed: 15 additions & 150 deletions

File tree

dist/index.html

Lines changed: 3 additions & 132 deletions
Original file line numberDiff line numberDiff line change
@@ -2,146 +2,17 @@
22
<html>
33
<head>
44
<title>Search By Username</title>
5-
<link rel="modulepreload" href="/todo-app-9cb44b8cbf451417.js" crossorigin="anonymous" integrity="sha384-8RL8dOyNnUzPYYoSBjyW8JmsQrKS5Yj421TttEF8I4/INt1F8dsXfXIN2kijrDZu"><link rel="preload" href="/todo-app-9cb44b8cbf451417_bg.wasm" crossorigin="anonymous" integrity="sha384-ABGt2mNygzaXpQbTQqRbu5+suhoquYx5kt1NRBu3ZYRHBQyASAl5Cav/gWwhQugW" as="fetch" type="application/wasm"></head>
5+
<link rel="modulepreload" href="/todo-app-e725b6a9874cd26e.js" crossorigin="anonymous" integrity="sha384-qGrvU8ebpPC2Yj8x84spanioiyqJldiFWdPT8jMnccifG0Ce1/xnX2vlJ723tGle"><link rel="preload" href="/todo-app-e725b6a9874cd26e_bg.wasm" crossorigin="anonymous" integrity="sha384-ztIT8wc3CTVeSO38/5STOjqApBJf+QUgUXEHo1C7ek5m15T08/Nqt8ANcTV2dfHU" as="fetch" type="application/wasm"></head>
66
<body>
77
<script type="module">
8-
import init, * as bindings from '/todo-app-9cb44b8cbf451417.js';
9-
const wasm = await init({ module_or_path: '/todo-app-9cb44b8cbf451417_bg.wasm' });
8+
import init, * as bindings from '/todo-app-e725b6a9874cd26e.js';
9+
const wasm = await init({ module_or_path: '/todo-app-e725b6a9874cd26e_bg.wasm' });
1010

1111

1212
window.wasmBindings = bindings;
1313

1414

1515
dispatchEvent(new CustomEvent("TrunkApplicationStarted", {detail: {wasm}}));
1616

17-
</script><script>"use strict";
18-
19-
(function () {
20-
21-
const address = '{{__TRUNK_ADDRESS__}}';
22-
const base = '{{__TRUNK_WS_BASE__}}';
23-
let protocol = '';
24-
protocol =
25-
protocol
26-
? protocol
27-
: window.location.protocol === 'https:'
28-
? 'wss'
29-
: 'ws';
30-
const url = protocol + '://' + address + base + '.well-known/trunk/ws';
31-
32-
class Overlay {
33-
constructor() {
34-
// create an overlay
35-
this._overlay = document.createElement("div");
36-
const style = this._overlay.style;
37-
style.height = "100vh";
38-
style.width = "100vw";
39-
style.position = "fixed";
40-
style.top = "0";
41-
style.left = "0";
42-
style.backgroundColor = "rgba(222, 222, 222, 0.5)";
43-
style.fontFamily = "sans-serif";
44-
// not sure that's the right approach
45-
style.zIndex = "1000000";
46-
style.backdropFilter = "blur(1rem)";
47-
48-
const container = document.createElement("div");
49-
// center it
50-
container.style.position = "absolute";
51-
container.style.top = "30%";
52-
container.style.left = "15%";
53-
container.style.maxWidth = "85%";
54-
55-
this._title = document.createElement("div");
56-
this._title.innerText = "Build failure";
57-
this._title.style.paddingBottom = "2rem";
58-
this._title.style.fontSize = "2.5rem";
59-
60-
this._message = document.createElement("div");
61-
this._message.style.whiteSpace = "pre-wrap";
62-
63-
const icon= document.createElement("div");
64-
icon.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" fill="#dc3545" viewBox="0 0 16 16"><path d="M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z"/></svg>';
65-
this._title.prepend(icon);
66-
67-
container.append(this._title, this._message);
68-
this._overlay.append(container);
69-
70-
this._inject();
71-
window.setInterval(() => {
72-
this._inject();
73-
}, 250);
74-
}
75-
76-
set reason(reason) {
77-
this._message.textContent = reason;
78-
}
79-
80-
_inject() {
81-
if (!this._overlay.isConnected) {
82-
// prepend it
83-
document.body?.prepend(this._overlay);
84-
}
85-
}
86-
87-
}
88-
89-
class Client {
90-
constructor(url) {
91-
this.url = url;
92-
this.poll_interval = 5000;
93-
this._overlay = null;
94-
}
95-
96-
start() {
97-
const ws = new WebSocket(this.url);
98-
ws.onmessage = (ev) => {
99-
const msg = JSON.parse(ev.data);
100-
switch (msg.type) {
101-
case "reload":
102-
this.reload();
103-
break;
104-
case "buildFailure":
105-
this.buildFailure(msg.data)
106-
break;
107-
}
108-
};
109-
ws.onclose = () => this.onclose();
110-
}
111-
112-
onclose() {
113-
window.setTimeout(
114-
() => {
115-
// when we successfully reconnect, we'll force a
116-
// reload (since we presumably lost connection to
117-
// trunk due to it being killed, so it will have
118-
// rebuilt on restart)
119-
const ws = new WebSocket(this.url);
120-
ws.onopen = () => window.location.reload();
121-
ws.onclose = () => this.onclose();
122-
},
123-
this.poll_interval);
124-
}
125-
126-
reload() {
127-
window.location.reload();
128-
}
129-
130-
buildFailure({reason}) {
131-
// also log the console
132-
console.error("Build failed:", reason);
133-
134-
console.debug("Overlay", this._overlay);
135-
136-
if (!this._overlay) {
137-
this._overlay = new Overlay();
138-
}
139-
this._overlay.reason = reason;
140-
}
141-
}
142-
143-
new Client(url).start();
144-
145-
})()
14617
</script></body>
14718
</html>
-6.41 MB
Binary file not shown.
Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -203,19 +203,19 @@ function debugString(val) {
203203
return className;
204204
}
205205
function __wbg_adapter_30(arg0, arg1) {
206-
wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h4a392e71719cebaa(arg0, arg1);
206+
wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h5b6cdd4bcc43373c(arg0, arg1);
207207
}
208208

209209
function __wbg_adapter_33(arg0, arg1, arg2) {
210-
wasm.closure1241_externref_shim(arg0, arg1, arg2);
210+
wasm.closure916_externref_shim(arg0, arg1, arg2);
211211
}
212212

213213
function __wbg_adapter_36(arg0, arg1, arg2) {
214-
wasm.closure1307_externref_shim(arg0, arg1, arg2);
214+
wasm.closure970_externref_shim(arg0, arg1, arg2);
215215
}
216216

217-
function __wbg_adapter_229(arg0, arg1, arg2, arg3) {
218-
wasm.closure1332_externref_shim(arg0, arg1, arg2, arg3);
217+
function __wbg_adapter_215(arg0, arg1, arg2, arg3) {
218+
wasm.closure992_externref_shim(arg0, arg1, arg2, arg3);
219219
}
220220

221221
const __wbindgen_enum_ReadableStreamType = ["bytes"];
@@ -606,7 +606,7 @@ function __wbg_get_imports() {
606606
const a = state0.a;
607607
state0.a = 0;
608608
try {
609-
return __wbg_adapter_229(a, state0.b, arg0, arg1);
609+
return __wbg_adapter_215(a, state0.b, arg0, arg1);
610610
} finally {
611611
state0.a = a;
612612
}
@@ -839,12 +839,6 @@ function __wbg_get_imports() {
839839
const ret = arg0.view;
840840
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
841841
};
842-
imports.wbg.__wbg_warn_14410cc27be5552a = function(arg0, arg1, arg2) {
843-
console.warn(arg0, arg1, arg2);
844-
};
845-
imports.wbg.__wbg_warn_4ca3906c248c47c4 = function(arg0) {
846-
console.warn(arg0);
847-
};
848842
imports.wbg.__wbindgen_cb_drop = function(arg0) {
849843
const obj = arg0.original;
850844
if (obj.cnt-- == 1) {
@@ -854,16 +848,16 @@ function __wbg_get_imports() {
854848
const ret = false;
855849
return ret;
856850
};
857-
imports.wbg.__wbindgen_closure_wrapper12062 = function(arg0, arg1, arg2) {
858-
const ret = makeMutClosure(arg0, arg1, 1017, __wbg_adapter_30);
851+
imports.wbg.__wbindgen_closure_wrapper1601 = function(arg0, arg1, arg2) {
852+
const ret = makeMutClosure(arg0, arg1, 796, __wbg_adapter_30);
859853
return ret;
860854
};
861-
imports.wbg.__wbindgen_closure_wrapper16703 = function(arg0, arg1, arg2) {
862-
const ret = makeMutClosure(arg0, arg1, 1242, __wbg_adapter_33);
855+
imports.wbg.__wbindgen_closure_wrapper1924 = function(arg0, arg1, arg2) {
856+
const ret = makeMutClosure(arg0, arg1, 917, __wbg_adapter_33);
863857
return ret;
864858
};
865-
imports.wbg.__wbindgen_closure_wrapper21909 = function(arg0, arg1, arg2) {
866-
const ret = makeMutClosure(arg0, arg1, 1308, __wbg_adapter_36);
859+
imports.wbg.__wbindgen_closure_wrapper3556 = function(arg0, arg1, arg2) {
860+
const ret = makeMutClosure(arg0, arg1, 971, __wbg_adapter_36);
867861
return ret;
868862
};
869863
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
1.38 MB
Binary file not shown.

0 commit comments

Comments
 (0)