htmx-router 1.0.0-pre5 → 1.0.1

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/cookies.js CHANGED
@@ -47,8 +47,9 @@ export class Cookies {
47
47
  options.path ||= "/";
48
48
  this.config[name] = options;
49
49
  this.map[name] = value;
50
- if (typeof this.source === "object")
50
+ if (this.source !== null && typeof this.source === "object") {
51
51
  document.cookie = `${encodeURIComponent(name)}=${encodeURIComponent(value)}`;
52
+ }
52
53
  }
53
54
  unset(name) {
54
55
  this.parse();
@@ -169,6 +169,8 @@ function Cleanup() {
169
169
  }
170
170
 
171
171
  function CleanNode(node: Node) {
172
+ if (document.body.contains(node)) return; // it wasn't actually removed
173
+
172
174
  if (node instanceof HTMLElement) {
173
175
  const root = mounted.get(node);
174
176
  if (root) {
package/internal/mount.js CHANGED
@@ -46,6 +46,7 @@ function ClientMounter() {
46
46
  if (!func)
47
47
  throw new Error(`Component ${funcName} is missing from client manifest`);
48
48
  func(element, json);
49
+ element.setAttribute("component", funcName);
49
50
  element.setAttribute("mounted", "yes");
50
51
  }
51
52
  function MountAll() {
package/package.json CHANGED
@@ -1,9 +1,13 @@
1
1
  {
2
2
  "name": "htmx-router",
3
- "version": "1.0.0-pre5",
3
+ "version": "1.0.1",
4
4
  "description": "A lightweight SSR framework with server+client islands",
5
5
  "keywords": [
6
- "htmx", "router", "client islands", "ssr", "vite"
6
+ "htmx",
7
+ "router",
8
+ "client islands",
9
+ "ssr",
10
+ "vite"
7
11
  ],
8
12
  "main": "./index.js",
9
13
  "type": "module",