@jxsuite/compiler 4.0.1 → 4.0.3

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jxsuite/compiler",
3
- "version": "4.0.1",
3
+ "version": "4.0.3",
4
4
  "description": "Jx static HTML compiler, island detector, and site builder",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -45,20 +45,20 @@
45
45
  "upgrade": "bun update --latest && bun install"
46
46
  },
47
47
  "dependencies": {
48
- "@apidevtools/json-schema-ref-parser": "^16.0.2",
49
- "@jxsuite/create": "^1.3.11",
50
- "@jxsuite/runtime": "^4.0.1",
51
- "@jxsuite/schema": "^2.2.0",
52
- "@jxsuite/site": "^2.0.1",
53
- "@vue/reactivity": "3.5.42",
48
+ "@apidevtools/json-schema-ref-parser": "^16.0.3",
49
+ "@jxsuite/create": "^1.3.12",
50
+ "@jxsuite/runtime": "^4.0.2",
51
+ "@jxsuite/schema": "^2.3.0",
52
+ "@jxsuite/site": "^2.0.2",
53
+ "@vue/reactivity": "3.5.43",
54
54
  "esbuild": "^0.28.2",
55
55
  "lit-html": "^3.3.3",
56
- "sharp": "^0.35.4"
56
+ "sharp": "^0.35.5"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@happy-dom/global-registrator": "^20.14.5",
60
- "@jxsuite/connector": "^0.6.0",
61
- "@jxsuite/parser": "^1.8.1",
60
+ "@jxsuite/connector": "^0.6.1",
61
+ "@jxsuite/parser": "^1.8.2",
62
62
  "@types/mdast": "^4.0.4"
63
63
  }
64
64
  }
@@ -2246,17 +2246,25 @@ function injectComponentScripts(
2246
2246
  .map((href) => `<link rel="modulepreload" href="${href}">`)
2247
2247
  .join("\n ");
2248
2248
 
2249
- const result = intoHead([preloads, styleBlock]);
2249
+ /*
2250
+ * The import map goes in <head>, AHEAD of the hints. The HTML spec rejects an import map that
2251
+ * arrives after a module load or preload has started, and Firefox enforces it: with the map at
2252
+ * the end of <body>, the `modulepreload` links above had already started, so the map was
2253
+ * dropped ("Import maps are not allowed after a module load or preload has started") and every
2254
+ * component module died on `@vue/reactivity` being a bare specifier nothing remapped. That took
2255
+ * down the theme toggle, site search and every interactive component, in Firefox only.
2256
+ *
2257
+ * A map already present (islands, a page template) is already in <head> and is left where it is;
2258
+ * the hints are inserted at `</head>`, behind it.
2259
+ */
2260
+ const hasImportMap = html.includes('<script type="importmap">');
2261
+ const result = intoHead([hasImportMap ? "" : importMap, preloads, styleBlock]);
2250
2262
 
2251
2263
  const moduleScripts = jsTags
2252
2264
  .map((tag: string) => `<script type="module" src="/components/${tag}.js"></script>`)
2253
2265
  .join("\n ");
2254
2266
 
2255
- // Check if an import map already exists (from islands etc.)
2256
- const hasImportMap = result.includes('<script type="importmap">');
2257
- const injection = (hasImportMap ? "" : `${importMap}\n `) + moduleScripts;
2258
-
2259
- return result.replace("</body>", ` ${injection}\n</body>`);
2267
+ return result.replace("</body>", ` ${moduleScripts}\n</body>`);
2260
2268
  }
2261
2269
 
2262
2270
  /**