Merge pull request #1986 from ealmloff/bump-sledgehammer-bindgen

Bump the sledgehammer bindgen version
This commit is contained in:
Jonathan Kelley authored and GitHub committed 2024-02-27 12:33:10 -08:00
commit 0c4c0e70e5
12 files changed
+251 -151

No files matched your search

+4 -3
View File
@@ -43,6 +43,7 @@ fn handle_edits_code() -> String {
}"#;
let polling_request = format!(
r#"// Poll for requests
window.interpreter = new JSChannel();
window.interpreter.wait_for_request = (headless) => {{
fetch(new Request("{EDITS_PATH}"))
.then(response => {{
@@ -50,11 +51,11 @@ fn handle_edits_code() -> String {
.then(bytes => {{
// In headless mode, the requestAnimationFrame callback is never called, so we need to run the bytes directly
if (headless) {{
run_from_bytes(bytes);
window.interpreter.run_from_bytes(bytes);
}}
else {{
requestAnimationFrame(() => {{
run_from_bytes(bytes);
window.interpreter.run_from_bytes(bytes);
}});
}}
window.interpreter.wait_for_request(headless);
@@ -74,7 +75,7 @@ fn handle_edits_code() -> String {
interpreter.replace_range(import_start..import_end, "");
}
format!("{interpreter}\nconst config = new InterpreterConfig(true);")
format!("{interpreter}\nconst intercept_link_redirects = true;")
}
static DEFAULT_INDEX: &str = include_str!("./index.html");