elegance-js 2.1.31 → 2.1.33
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/dist/client/runtime.js +6 -4
- package/package.json +1 -1
package/dist/client/runtime.js
CHANGED
|
@@ -77,7 +77,9 @@ function createHTMLElementFromElement(element) {
|
|
|
77
77
|
DEV_BUILD && (() => {
|
|
78
78
|
let isErrored = false;
|
|
79
79
|
(function connect() {
|
|
80
|
-
const
|
|
80
|
+
const url = new URL("/elegance-hot-reload", window.location.origin);
|
|
81
|
+
url.port = "4000";
|
|
82
|
+
const es = new EventSource(url);
|
|
81
83
|
es.onopen = () => {
|
|
82
84
|
if (isErrored) {
|
|
83
85
|
window.location.reload();
|
|
@@ -410,8 +412,8 @@ const domParser = new DOMParser();
|
|
|
410
412
|
const xmlSerializer = new XMLSerializer();
|
|
411
413
|
const fetchPage = async (targetURL) => {
|
|
412
414
|
const pathname = sanitizePathname(targetURL.pathname);
|
|
413
|
-
if (pageStringCache.has(
|
|
414
|
-
return domParser.parseFromString(pageStringCache.get(
|
|
415
|
+
if (pageStringCache.has(targetURL.href)) {
|
|
416
|
+
return domParser.parseFromString(pageStringCache.get(targetURL.href), "text/html");
|
|
415
417
|
}
|
|
416
418
|
const res = await fetch(targetURL);
|
|
417
419
|
const newDOM = domParser.parseFromString(await res.text(), "text/html");
|
|
@@ -442,7 +444,7 @@ const fetchPage = async (targetURL) => {
|
|
|
442
444
|
newDOM.head.appendChild(script);
|
|
443
445
|
}
|
|
444
446
|
}
|
|
445
|
-
pageStringCache.set(
|
|
447
|
+
pageStringCache.set(targetURL.href, xmlSerializer.serializeToString(newDOM));
|
|
446
448
|
return newDOM;
|
|
447
449
|
};
|
|
448
450
|
let navigationCallbacks = [];
|