@ape-egg/vibe-compiler 4.3.0 → 4.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ape-egg/vibe-compiler",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Optional Rust compiler for Vibe \u2014 pre-renders, inlines components, and optimizes iterations. The runtime never needs it.",
|
|
6
6
|
"homepage": "https://vibe.korte.kim",
|
package/src/Cargo.lock
CHANGED
package/src/Cargo.toml
CHANGED
package/src/compiler/spa.rs
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
// filter over pages, not a rework.
|
|
10
10
|
|
|
11
11
|
use regex::Regex;
|
|
12
|
-
use crate::constants::{SPA_FRAGMENTS_DIR, FOUC_ATTR};
|
|
12
|
+
use crate::constants::{SPA_FRAGMENTS_DIR, FOUC_ATTR, HYPERSPEED_DIR, MANIFEST_SUFFIX};
|
|
13
13
|
|
|
14
14
|
/// One page of the pages tree, dissected for SPA output.
|
|
15
15
|
pub struct SpaPage {
|
|
@@ -507,6 +507,10 @@ pub fn compose_shell(
|
|
|
507
507
|
html.push_str(line);
|
|
508
508
|
html.push('\n');
|
|
509
509
|
}
|
|
510
|
+
html.push_str(&format!(
|
|
511
|
+
"\n <script>window.__MANIFEST__ = \"/{}/index.html{}\";</script>\n",
|
|
512
|
+
HYPERSPEED_DIR, MANIFEST_SUFFIX
|
|
513
|
+
));
|
|
510
514
|
html.push_str("\n <script type=\"module\">\n");
|
|
511
515
|
html.push_str(&format!(" import vibe from \"{}\";\n", vibe_spec));
|
|
512
516
|
html.push_str(&format!(
|
|
@@ -594,6 +598,17 @@ mod tests {
|
|
|
594
598
|
);
|
|
595
599
|
}
|
|
596
600
|
|
|
601
|
+
#[test]
|
|
602
|
+
fn shell_names_its_own_manifest_before_vibe_boots() {
|
|
603
|
+
let pages = vec![page("/"), page("/about")];
|
|
604
|
+
let order = route_order(&pages);
|
|
605
|
+
let shell = compose_shell(&pages, &order, None).html;
|
|
606
|
+
let hint = shell
|
|
607
|
+
.find("<script>window.__MANIFEST__ = \"/vibe-hyperspeed/index.html.manifest.js\";</script>")
|
|
608
|
+
.expect("shell hints its manifest");
|
|
609
|
+
assert!(hint < shell.find("<script type=\"module\">").unwrap());
|
|
610
|
+
}
|
|
611
|
+
|
|
597
612
|
#[test]
|
|
598
613
|
fn harvests_and_derives_shell_imports() {
|
|
599
614
|
assert_eq!(
|