htmx-router 1.0.0-pre2 → 1.0.0-pre4

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/cli/index.js CHANGED
@@ -6,7 +6,6 @@ import * as components from "../internal/component/index.js";
6
6
  import { CompileManifest } from "../internal/compile/manifest.js";
7
7
  import { ReadConfig } from "./config.js";
8
8
  const config = await ReadConfig();
9
- console.info("");
10
9
  if (config.client) {
11
10
  console.info(`Generating ${chalk.green("client island")} manifest`);
12
11
  const source = await readFile(config.client.source, "utf8");
package/cookies.js CHANGED
@@ -15,7 +15,9 @@ export class Cookies {
15
15
  return;
16
16
  const source = typeof this.source === "object" ? this.source.cookie : this.source;
17
17
  for (const line of source.split("; ")) {
18
- const [name, value] = line.split("=");
18
+ let [name, value] = line.split("=");
19
+ name = decodeURIComponent(name);
20
+ value = decodeURIComponent(value);
19
21
  this.map[name] = value;
20
22
  }
21
23
  // keep source it document
@@ -46,7 +48,7 @@ export class Cookies {
46
48
  this.config[name] = options;
47
49
  this.map[name] = value;
48
50
  if (typeof this.source === "object")
49
- document.cookie = `${name}=${value}`;
51
+ document.cookie = `${encodeURIComponent(name)}=${encodeURIComponent(value)}`;
50
52
  }
51
53
  unset(name) {
52
54
  this.parse();
@@ -72,7 +74,7 @@ export class Cookies {
72
74
  value = value[0].toUpperCase() + value.slice(1);
73
75
  config += `; ${prop}=${value}`;
74
76
  }
75
- const cookie = name + "=" + this.map[name] + config + ";";
77
+ const cookie = encodeURIComponent(name) + "=" + encodeURIComponent(this.map[name]) + config + ";";
76
78
  headers.push(cookie);
77
79
  }
78
80
  return headers;
@@ -69,8 +69,8 @@ function BuildServerManifest(type, imported) {
69
69
  }
70
70
  out += `from "${imp.href}";\n`;
71
71
  }
72
- out += `\nimport { StyleClass } from "htmx-router/css";\n`
73
- + `const island = new StyleClass("i", ".this{display:contents;}\\n").name;\n\n`
72
+ out += `\nimport { Style } from "htmx-router/css";\n`
73
+ + `const island = new Style("i", ".this{display:contents;}\\n").name;\n\n`
74
74
  + "type FirstArg<T> = T extends (arg: infer U, ...args: any[]) => any ? U : never;\n"
75
75
  + "function mount(name: string, data: string, ssr?: JSX.Element) {\n"
76
76
  + "\treturn (<>\n"
@@ -1,6 +1,6 @@
1
1
  const generic = `import { Parameterized, ParameterShaper } from "htmx-router/util/parameters";
2
2
  import { RenderFunction } from "htmx-router";
3
- import { Deferral } from "htmx-router/dynamic";
3
+ import { Deferral } from "htmx-router/defer";
4
4
 
5
5
  export function Defer<T extends ParameterShaper>(props: {
6
6
  params?: Parameterized<T>,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "htmx-router",
3
- "version": "1.0.0-pre2",
3
+ "version": "1.0.0-pre4",
4
4
  "description": "A lightweight SSR framework with server+client islands",
5
5
  "keywords": [
6
6
  "htmx", "router", "client islands", "ssr", "vite"
@@ -22,7 +22,7 @@
22
22
  "bugs": {
23
23
  "url": "https://github.com/AjaniBilby/htmx-router/issues"
24
24
  },
25
- "homepage": "https://github.com/AjaniBilby/htmx-router#readme",
25
+ "homepage": "https://htmx-router.ajanibilby.com/",
26
26
  "dependencies": {
27
27
  "es-module-lexer": "^1.5.4",
28
28
  "vite": "^6.0.6"