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.
@@ -77,7 +77,9 @@ function createHTMLElementFromElement(element) {
77
77
  DEV_BUILD && (() => {
78
78
  let isErrored = false;
79
79
  (function connect() {
80
- const es = new EventSource(`${window.location.origin}/elegance-hot-reload`);
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(pathname)) {
414
- return domParser.parseFromString(pageStringCache.get(pathname), "text/html");
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(pathname, xmlSerializer.serializeToString(newDOM));
447
+ pageStringCache.set(targetURL.href, xmlSerializer.serializeToString(newDOM));
446
448
  return newDOM;
447
449
  };
448
450
  let navigationCallbacks = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "elegance-js",
3
- "version": "2.1.31",
3
+ "version": "2.1.33",
4
4
  "description": "Web-Framework",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",