mono-jsx 0.10.0-beta.7 → 0.10.0-beta.9
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/jsx-runtime.mjs +12 -7
- package/package.json +1 -1
- package/types/jsx.d.ts +1 -0
- package/types/render.d.ts +2 -2
package/jsx-runtime.mjs
CHANGED
|
@@ -16,7 +16,7 @@ var $setup = /* @__PURE__ */ Symbol.for("mono.setup");
|
|
|
16
16
|
var $rpc = /* @__PURE__ */ Symbol.for("mono.rpc");
|
|
17
17
|
|
|
18
18
|
// version.ts
|
|
19
|
-
var VERSION = "0.10.0-beta.
|
|
19
|
+
var VERSION = "0.10.0-beta.9";
|
|
20
20
|
|
|
21
21
|
// runtime/index.ts
|
|
22
22
|
var EVENT = 1;
|
|
@@ -380,8 +380,8 @@ function renderToWebStream(root, options) {
|
|
|
380
380
|
}
|
|
381
381
|
controller.enqueue(encoder.encode(buf + "]"));
|
|
382
382
|
} catch (err) {
|
|
383
|
-
controller.enqueue(encoder.encode(stringify({ error: errorStringify(err) })));
|
|
384
383
|
console.error(err);
|
|
384
|
+
controller.enqueue(encoder.encode(stringify({ error: errorStringify(err) })));
|
|
385
385
|
} finally {
|
|
386
386
|
controller.close();
|
|
387
387
|
}
|
|
@@ -410,6 +410,9 @@ function renderToWebStream(root, options) {
|
|
|
410
410
|
}
|
|
411
411
|
}
|
|
412
412
|
}
|
|
413
|
+
} catch (err) {
|
|
414
|
+
console.error(err);
|
|
415
|
+
write("<script>console.error(" + stringify(errorStringify(err)) + ")<\/script>");
|
|
413
416
|
} finally {
|
|
414
417
|
controller.close();
|
|
415
418
|
}
|
|
@@ -846,10 +849,12 @@ async function renderNode(rc, node, stripSlotProp) {
|
|
|
846
849
|
}
|
|
847
850
|
let buf = '<meta charset="utf-8">';
|
|
848
851
|
for (const [key, value] of Object.entries(Object.assign(defaultMetadata, rc.metadata, metadata))) {
|
|
849
|
-
if (
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
852
|
+
if (value) {
|
|
853
|
+
if (key === "title") {
|
|
854
|
+
buf += "<title>" + escapeHTML(value) + "</title>";
|
|
855
|
+
} else {
|
|
856
|
+
buf += "<meta " + (key.startsWith("og:") ? "property" : "name") + "=" + toAttrStringLit(key) + " content=" + toAttrStringLit(value) + ">";
|
|
857
|
+
}
|
|
853
858
|
}
|
|
854
859
|
}
|
|
855
860
|
write(buf);
|
|
@@ -1100,7 +1105,7 @@ async function renderFC(rc, fcFn, props, eager) {
|
|
|
1100
1105
|
});
|
|
1101
1106
|
} else {
|
|
1102
1107
|
console.error(err);
|
|
1103
|
-
write("<script>console.error(" + stringify(err) + ")<\/script>");
|
|
1108
|
+
write("<script>console.error(" + stringify(errorStringify(err)) + ")<\/script>");
|
|
1104
1109
|
}
|
|
1105
1110
|
}
|
|
1106
1111
|
}
|
package/package.json
CHANGED
package/types/jsx.d.ts
CHANGED
package/types/render.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference path="./htmx.d.ts" />
|
|
2
2
|
|
|
3
|
-
import type { ComponentType, MaybeModule } from "./jsx.d.ts";
|
|
3
|
+
import type { ComponentType, MaybeModule, Metadata } from "./jsx.d.ts";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Htmx extensions.
|
|
@@ -89,7 +89,7 @@ export interface RenderOptions extends Partial<HtmxExts> {
|
|
|
89
89
|
/**
|
|
90
90
|
* Global metadata.
|
|
91
91
|
*/
|
|
92
|
-
metadata?:
|
|
92
|
+
metadata?: Metadata;
|
|
93
93
|
/**
|
|
94
94
|
* Current `Request` object to be passed to components.
|
|
95
95
|
*/
|