@barefootjs/hono 0.31.0 → 0.31.2

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.
Files changed (38) hide show
  1. package/dist/adapter/hono-adapter.d.ts +67 -2
  2. package/dist/adapter/hono-adapter.d.ts.map +1 -1
  3. package/dist/adapter/index.js +46 -187398
  4. package/dist/app.js +0 -71
  5. package/dist/async.js +0 -71
  6. package/dist/client-shim.js +0 -71
  7. package/dist/dev-worker.js +0 -71
  8. package/dist/dialog-context.js +0 -71
  9. package/dist/index.js +46 -187398
  10. package/dist/jsx/jsx-dev-runtime/index.d.ts +3 -1
  11. package/dist/jsx/jsx-dev-runtime/index.d.ts.map +1 -1
  12. package/dist/jsx/jsx-dev-runtime/index.js +14 -69
  13. package/dist/jsx/jsx-runtime/index.d.ts +4 -1
  14. package/dist/jsx/jsx-runtime/index.d.ts.map +1 -1
  15. package/dist/jsx/jsx-runtime/index.js +24 -69
  16. package/dist/jsx/resolve-dangerously-set-inner-html.d.ts +2 -0
  17. package/dist/jsx/resolve-dangerously-set-inner-html.d.ts.map +1 -0
  18. package/dist/portal-ssr.js +0 -71
  19. package/dist/portals.js +0 -71
  20. package/dist/preload.js +0 -71
  21. package/dist/render.js +0 -71
  22. package/dist/request-env.js +0 -71
  23. package/dist/scripts.d.ts +3 -2
  24. package/dist/scripts.d.ts.map +1 -1
  25. package/dist/scripts.js +0 -71
  26. package/dist/utils.js +0 -71
  27. package/dist/vite.js +313 -142
  28. package/package.json +2 -2
  29. package/src/__tests__/aliased-destructured-prop.test.ts +8 -7
  30. package/src/__tests__/consumer-typecheck.test.ts +403 -0
  31. package/src/__tests__/corpus-typecheck.test.ts +130 -0
  32. package/src/__tests__/dangerously-set-inner-html.test.ts +70 -0
  33. package/src/__tests__/nested-ternary-bare-branch.test.ts +70 -0
  34. package/src/adapter/hono-adapter.ts +123 -166
  35. package/src/jsx/jsx-dev-runtime/index.ts +13 -1
  36. package/src/jsx/jsx-runtime/index.ts +24 -1
  37. package/src/jsx/resolve-dangerously-set-inner-html.ts +34 -0
  38. package/src/scripts.tsx +3 -2
@@ -4,6 +4,8 @@
4
4
  * Re-exports `jsxDEV` / `Fragment` from hono/jsx and surfaces the same
5
5
  * JSX namespace as the production runtime so dev builds see identical types.
6
6
  */
7
- export { jsxDEV, Fragment } from 'hono/jsx/jsx-dev-runtime';
7
+ import { Fragment } from 'hono/jsx/jsx-dev-runtime';
8
+ export { Fragment };
8
9
  export type { JSX } from '../jsx-runtime/index.ts';
10
+ export declare function jsxDEV(tag: string | Function, props: Record<string, unknown>, key?: string): import("hono/jsx").JSXNode;
9
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/jsx/jsx-dev-runtime/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAC3D,YAAY,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/jsx/jsx-dev-runtime/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAwB,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAGzE,OAAO,EAAE,QAAQ,EAAE,CAAA;AACnB,YAAY,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAA;AAOlD,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,CAAC,EAAE,MAAM,8BAE1F"}
@@ -1,76 +1,21 @@
1
- var __create = Object.create;
2
- var __getProtoOf = Object.getPrototypeOf;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- function __accessProp(key) {
8
- return this[key];
9
- }
10
- var __toESMCache_node;
11
- var __toESMCache_esm;
12
- var __toESM = (mod, isNodeMode, target) => {
13
- var canCache = mod != null && typeof mod === "object";
14
- if (canCache) {
15
- var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
16
- var cached = cache.get(mod);
17
- if (cached)
18
- return cached;
19
- }
20
- target = mod != null ? __create(__getProtoOf(mod)) : {};
21
- const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
22
- for (let key of __getOwnPropNames(mod))
23
- if (!__hasOwnProp.call(to, key))
24
- __defProp(to, key, {
25
- get: __accessProp.bind(mod, key),
26
- enumerable: true
27
- });
28
- if (canCache)
29
- cache.set(mod, to);
30
- return to;
31
- };
32
- var __toCommonJS = (from) => {
33
- var entry = (__moduleCache ??= new WeakMap).get(from), desc;
34
- if (entry)
35
- return entry;
36
- entry = __defProp({}, "__esModule", { value: true });
37
- if (from && typeof from === "object" || typeof from === "function") {
38
- for (var key of __getOwnPropNames(from))
39
- if (!__hasOwnProp.call(entry, key))
40
- __defProp(entry, key, {
41
- get: __accessProp.bind(from, key),
42
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
43
- });
1
+ // src/jsx/jsx-dev-runtime/index.ts
2
+ import { jsxDEV as honoJsxDEV, Fragment } from "hono/jsx/jsx-dev-runtime";
3
+
4
+ // src/jsx/resolve-dangerously-set-inner-html.ts
5
+ import { raw } from "hono/html";
6
+ function resolveDangerouslySetInnerHTML(props) {
7
+ if (props && "dangerouslySetInnerHTML" in props && props.dangerouslySetInnerHTML != null && !("children" in props)) {
8
+ const { dangerouslySetInnerHTML, ...rest } = props;
9
+ const html = dangerouslySetInnerHTML.__html;
10
+ return { ...rest, children: raw(html) };
44
11
  }
45
- __moduleCache.set(from, entry);
46
- return entry;
47
- };
48
- var __moduleCache;
49
- var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
50
- var __returnValue = (v) => v;
51
- function __exportSetter(name, newValue) {
52
- this[name] = __returnValue.bind(null, newValue);
12
+ return props;
53
13
  }
54
- var __export = (target, all) => {
55
- for (var name in all)
56
- __defProp(target, name, {
57
- get: all[name],
58
- enumerable: true,
59
- configurable: true,
60
- set: __exportSetter.bind(all, name)
61
- });
62
- };
63
- var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
64
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
65
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
66
- }) : x)(function(x) {
67
- if (typeof require !== "undefined")
68
- return require.apply(this, arguments);
69
- throw Error('Dynamic require of "' + x + '" is not supported');
70
- });
71
14
 
72
15
  // src/jsx/jsx-dev-runtime/index.ts
73
- import { jsxDEV, Fragment } from "hono/jsx/jsx-dev-runtime";
16
+ function jsxDEV(tag, props, key) {
17
+ return honoJsxDEV(tag, typeof tag === "string" ? resolveDangerouslySetInnerHTML(props) : props, key);
18
+ }
74
19
  export {
75
20
  jsxDEV,
76
21
  Fragment
@@ -9,7 +9,10 @@
9
9
  * Usage in tsconfig.json:
10
10
  * "jsxImportSource": "@barefootjs/hono/jsx"
11
11
  */
12
- export { jsx, jsxs, Fragment, jsxAttr, jsxEscape, jsxTemplate } from 'hono/jsx/jsx-runtime';
12
+ import { Fragment, jsxAttr, jsxEscape, jsxTemplate } from 'hono/jsx/jsx-runtime';
13
+ export { Fragment, jsxAttr, jsxEscape, jsxTemplate };
14
+ export declare function jsx(tag: string | Function, props: Record<string, unknown>, key?: string): import("hono/jsx").JSXNode;
15
+ export declare function jsxs(tag: string | Function, props: Record<string, unknown>, key?: string): import("hono/jsx").JSXNode;
13
16
  import type { JSX as BaseJSX } from '@barefootjs/jsx/jsx-runtime';
14
17
  export declare namespace JSX {
15
18
  type Element = import('hono/jsx/jsx-runtime').JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/jsx/jsx-runtime/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAG3F,OAAO,KAAK,EAAE,GAAG,IAAI,OAAO,EAAE,MAAM,6BAA6B,CAAA;AAEjE,MAAM,CAAC,OAAO,WAAW,GAAG,CAAC,CAAC;IAE5B,KAAK,OAAO,GAAG,OAAO,sBAAsB,EAAE,GAAG,CAAC,OAAO,CAAA;IAGzD,KAAK,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAA;IAClD,KAAK,mBAAmB,GAAG,OAAO,CAAC,mBAAmB,CAAA;IACtD,KAAK,wBAAwB,GAAG,OAAO,CAAC,wBAAwB,CAAA;CACjE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/jsx/jsx-runtime/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAGL,QAAQ,EACR,OAAO,EACP,SAAS,EACT,WAAW,EACZ,MAAM,sBAAsB,CAAA;AAG7B,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,CAAA;AAOpD,wBAAgB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,CAAC,EAAE,MAAM,8BAEvF;AAED,wBAAgB,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,CAAC,EAAE,MAAM,8BAExF;AAGD,OAAO,KAAK,EAAE,GAAG,IAAI,OAAO,EAAE,MAAM,6BAA6B,CAAA;AAEjE,MAAM,CAAC,OAAO,WAAW,GAAG,CAAC,CAAC;IAE5B,KAAK,OAAO,GAAG,OAAO,sBAAsB,EAAE,GAAG,CAAC,OAAO,CAAA;IAGzD,KAAK,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAA;IAClD,KAAK,mBAAmB,GAAG,OAAO,CAAC,mBAAmB,CAAA;IACtD,KAAK,wBAAwB,GAAG,OAAO,CAAC,wBAAwB,CAAA;CACjE"}
@@ -1,76 +1,31 @@
1
- var __create = Object.create;
2
- var __getProtoOf = Object.getPrototypeOf;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- function __accessProp(key) {
8
- return this[key];
9
- }
10
- var __toESMCache_node;
11
- var __toESMCache_esm;
12
- var __toESM = (mod, isNodeMode, target) => {
13
- var canCache = mod != null && typeof mod === "object";
14
- if (canCache) {
15
- var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
16
- var cached = cache.get(mod);
17
- if (cached)
18
- return cached;
19
- }
20
- target = mod != null ? __create(__getProtoOf(mod)) : {};
21
- const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
22
- for (let key of __getOwnPropNames(mod))
23
- if (!__hasOwnProp.call(to, key))
24
- __defProp(to, key, {
25
- get: __accessProp.bind(mod, key),
26
- enumerable: true
27
- });
28
- if (canCache)
29
- cache.set(mod, to);
30
- return to;
31
- };
32
- var __toCommonJS = (from) => {
33
- var entry = (__moduleCache ??= new WeakMap).get(from), desc;
34
- if (entry)
35
- return entry;
36
- entry = __defProp({}, "__esModule", { value: true });
37
- if (from && typeof from === "object" || typeof from === "function") {
38
- for (var key of __getOwnPropNames(from))
39
- if (!__hasOwnProp.call(entry, key))
40
- __defProp(entry, key, {
41
- get: __accessProp.bind(from, key),
42
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
43
- });
1
+ // src/jsx/jsx-runtime/index.ts
2
+ import {
3
+ jsx as honoJsx,
4
+ jsxs as honoJsxs,
5
+ Fragment,
6
+ jsxAttr,
7
+ jsxEscape,
8
+ jsxTemplate
9
+ } from "hono/jsx/jsx-runtime";
10
+
11
+ // src/jsx/resolve-dangerously-set-inner-html.ts
12
+ import { raw } from "hono/html";
13
+ function resolveDangerouslySetInnerHTML(props) {
14
+ if (props && "dangerouslySetInnerHTML" in props && props.dangerouslySetInnerHTML != null && !("children" in props)) {
15
+ const { dangerouslySetInnerHTML, ...rest } = props;
16
+ const html = dangerouslySetInnerHTML.__html;
17
+ return { ...rest, children: raw(html) };
44
18
  }
45
- __moduleCache.set(from, entry);
46
- return entry;
47
- };
48
- var __moduleCache;
49
- var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
50
- var __returnValue = (v) => v;
51
- function __exportSetter(name, newValue) {
52
- this[name] = __returnValue.bind(null, newValue);
19
+ return props;
53
20
  }
54
- var __export = (target, all) => {
55
- for (var name in all)
56
- __defProp(target, name, {
57
- get: all[name],
58
- enumerable: true,
59
- configurable: true,
60
- set: __exportSetter.bind(all, name)
61
- });
62
- };
63
- var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
64
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
65
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
66
- }) : x)(function(x) {
67
- if (typeof require !== "undefined")
68
- return require.apply(this, arguments);
69
- throw Error('Dynamic require of "' + x + '" is not supported');
70
- });
71
21
 
72
22
  // src/jsx/jsx-runtime/index.ts
73
- import { jsx, jsxs, Fragment, jsxAttr, jsxEscape, jsxTemplate } from "hono/jsx/jsx-runtime";
23
+ function jsx(tag, props, key) {
24
+ return honoJsx(tag, typeof tag === "string" ? resolveDangerouslySetInnerHTML(props) : props, key);
25
+ }
26
+ function jsxs(tag, props, key) {
27
+ return honoJsxs(tag, typeof tag === "string" ? resolveDangerouslySetInnerHTML(props) : props, key);
28
+ }
74
29
  export {
75
30
  jsxs,
76
31
  jsxTemplate,
@@ -0,0 +1,2 @@
1
+ export declare function resolveDangerouslySetInnerHTML(props: Record<string, unknown>): Record<string, unknown>;
2
+ //# sourceMappingURL=resolve-dangerously-set-inner-html.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-dangerously-set-inner-html.d.ts","sourceRoot":"","sources":["../../src/jsx/resolve-dangerously-set-inner-html.ts"],"names":[],"mappings":"AAqBA,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAYtG"}
@@ -1,74 +1,3 @@
1
- var __create = Object.create;
2
- var __getProtoOf = Object.getPrototypeOf;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- function __accessProp(key) {
8
- return this[key];
9
- }
10
- var __toESMCache_node;
11
- var __toESMCache_esm;
12
- var __toESM = (mod, isNodeMode, target) => {
13
- var canCache = mod != null && typeof mod === "object";
14
- if (canCache) {
15
- var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
16
- var cached = cache.get(mod);
17
- if (cached)
18
- return cached;
19
- }
20
- target = mod != null ? __create(__getProtoOf(mod)) : {};
21
- const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
22
- for (let key of __getOwnPropNames(mod))
23
- if (!__hasOwnProp.call(to, key))
24
- __defProp(to, key, {
25
- get: __accessProp.bind(mod, key),
26
- enumerable: true
27
- });
28
- if (canCache)
29
- cache.set(mod, to);
30
- return to;
31
- };
32
- var __toCommonJS = (from) => {
33
- var entry = (__moduleCache ??= new WeakMap).get(from), desc;
34
- if (entry)
35
- return entry;
36
- entry = __defProp({}, "__esModule", { value: true });
37
- if (from && typeof from === "object" || typeof from === "function") {
38
- for (var key of __getOwnPropNames(from))
39
- if (!__hasOwnProp.call(entry, key))
40
- __defProp(entry, key, {
41
- get: __accessProp.bind(from, key),
42
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
43
- });
44
- }
45
- __moduleCache.set(from, entry);
46
- return entry;
47
- };
48
- var __moduleCache;
49
- var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
50
- var __returnValue = (v) => v;
51
- function __exportSetter(name, newValue) {
52
- this[name] = __returnValue.bind(null, newValue);
53
- }
54
- var __export = (target, all) => {
55
- for (var name in all)
56
- __defProp(target, name, {
57
- get: all[name],
58
- enumerable: true,
59
- configurable: true,
60
- set: __exportSetter.bind(all, name)
61
- });
62
- };
63
- var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
64
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
65
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
66
- }) : x)(function(x) {
67
- if (typeof require !== "undefined")
68
- return require.apply(this, arguments);
69
- throw Error('Dynamic require of "' + x + '" is not supported');
70
- });
71
-
72
1
  // src/portals.tsx
73
2
  import { useRequestContext } from "hono/jsx-renderer";
74
3
  import { Fragment } from "hono/jsx";
package/dist/portals.js CHANGED
@@ -1,74 +1,3 @@
1
- var __create = Object.create;
2
- var __getProtoOf = Object.getPrototypeOf;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- function __accessProp(key) {
8
- return this[key];
9
- }
10
- var __toESMCache_node;
11
- var __toESMCache_esm;
12
- var __toESM = (mod, isNodeMode, target) => {
13
- var canCache = mod != null && typeof mod === "object";
14
- if (canCache) {
15
- var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
16
- var cached = cache.get(mod);
17
- if (cached)
18
- return cached;
19
- }
20
- target = mod != null ? __create(__getProtoOf(mod)) : {};
21
- const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
22
- for (let key of __getOwnPropNames(mod))
23
- if (!__hasOwnProp.call(to, key))
24
- __defProp(to, key, {
25
- get: __accessProp.bind(mod, key),
26
- enumerable: true
27
- });
28
- if (canCache)
29
- cache.set(mod, to);
30
- return to;
31
- };
32
- var __toCommonJS = (from) => {
33
- var entry = (__moduleCache ??= new WeakMap).get(from), desc;
34
- if (entry)
35
- return entry;
36
- entry = __defProp({}, "__esModule", { value: true });
37
- if (from && typeof from === "object" || typeof from === "function") {
38
- for (var key of __getOwnPropNames(from))
39
- if (!__hasOwnProp.call(entry, key))
40
- __defProp(entry, key, {
41
- get: __accessProp.bind(from, key),
42
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
43
- });
44
- }
45
- __moduleCache.set(from, entry);
46
- return entry;
47
- };
48
- var __moduleCache;
49
- var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
50
- var __returnValue = (v) => v;
51
- function __exportSetter(name, newValue) {
52
- this[name] = __returnValue.bind(null, newValue);
53
- }
54
- var __export = (target, all) => {
55
- for (var name in all)
56
- __defProp(target, name, {
57
- get: all[name],
58
- enumerable: true,
59
- configurable: true,
60
- set: __exportSetter.bind(all, name)
61
- });
62
- };
63
- var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
64
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
65
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
66
- }) : x)(function(x) {
67
- if (typeof require !== "undefined")
68
- return require.apply(this, arguments);
69
- throw Error('Dynamic require of "' + x + '" is not supported');
70
- });
71
-
72
1
  // src/portals.tsx
73
2
  import { useRequestContext } from "hono/jsx-renderer";
74
3
  import { Fragment } from "hono/jsx";
package/dist/preload.js CHANGED
@@ -1,74 +1,3 @@
1
- var __create = Object.create;
2
- var __getProtoOf = Object.getPrototypeOf;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- function __accessProp(key) {
8
- return this[key];
9
- }
10
- var __toESMCache_node;
11
- var __toESMCache_esm;
12
- var __toESM = (mod, isNodeMode, target) => {
13
- var canCache = mod != null && typeof mod === "object";
14
- if (canCache) {
15
- var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
16
- var cached = cache.get(mod);
17
- if (cached)
18
- return cached;
19
- }
20
- target = mod != null ? __create(__getProtoOf(mod)) : {};
21
- const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
22
- for (let key of __getOwnPropNames(mod))
23
- if (!__hasOwnProp.call(to, key))
24
- __defProp(to, key, {
25
- get: __accessProp.bind(mod, key),
26
- enumerable: true
27
- });
28
- if (canCache)
29
- cache.set(mod, to);
30
- return to;
31
- };
32
- var __toCommonJS = (from) => {
33
- var entry = (__moduleCache ??= new WeakMap).get(from), desc;
34
- if (entry)
35
- return entry;
36
- entry = __defProp({}, "__esModule", { value: true });
37
- if (from && typeof from === "object" || typeof from === "function") {
38
- for (var key of __getOwnPropNames(from))
39
- if (!__hasOwnProp.call(entry, key))
40
- __defProp(entry, key, {
41
- get: __accessProp.bind(from, key),
42
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
43
- });
44
- }
45
- __moduleCache.set(from, entry);
46
- return entry;
47
- };
48
- var __moduleCache;
49
- var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
50
- var __returnValue = (v) => v;
51
- function __exportSetter(name, newValue) {
52
- this[name] = __returnValue.bind(null, newValue);
53
- }
54
- var __export = (target, all) => {
55
- for (var name in all)
56
- __defProp(target, name, {
57
- get: all[name],
58
- enumerable: true,
59
- configurable: true,
60
- set: __exportSetter.bind(all, name)
61
- });
62
- };
63
- var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
64
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
65
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
66
- }) : x)(function(x) {
67
- if (typeof require !== "undefined")
68
- return require.apply(this, arguments);
69
- throw Error('Dynamic require of "' + x + '" is not supported');
70
- });
71
-
72
1
  // src/preload.tsx
73
2
  import { Fragment } from "hono/jsx";
74
3
  import { jsxDEV } from "hono/jsx/jsx-dev-runtime";
package/dist/render.js CHANGED
@@ -1,74 +1,3 @@
1
- var __create = Object.create;
2
- var __getProtoOf = Object.getPrototypeOf;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- function __accessProp(key) {
8
- return this[key];
9
- }
10
- var __toESMCache_node;
11
- var __toESMCache_esm;
12
- var __toESM = (mod, isNodeMode, target) => {
13
- var canCache = mod != null && typeof mod === "object";
14
- if (canCache) {
15
- var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
16
- var cached = cache.get(mod);
17
- if (cached)
18
- return cached;
19
- }
20
- target = mod != null ? __create(__getProtoOf(mod)) : {};
21
- const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
22
- for (let key of __getOwnPropNames(mod))
23
- if (!__hasOwnProp.call(to, key))
24
- __defProp(to, key, {
25
- get: __accessProp.bind(mod, key),
26
- enumerable: true
27
- });
28
- if (canCache)
29
- cache.set(mod, to);
30
- return to;
31
- };
32
- var __toCommonJS = (from) => {
33
- var entry = (__moduleCache ??= new WeakMap).get(from), desc;
34
- if (entry)
35
- return entry;
36
- entry = __defProp({}, "__esModule", { value: true });
37
- if (from && typeof from === "object" || typeof from === "function") {
38
- for (var key of __getOwnPropNames(from))
39
- if (!__hasOwnProp.call(entry, key))
40
- __defProp(entry, key, {
41
- get: __accessProp.bind(from, key),
42
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
43
- });
44
- }
45
- __moduleCache.set(from, entry);
46
- return entry;
47
- };
48
- var __moduleCache;
49
- var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
50
- var __returnValue = (v) => v;
51
- function __exportSetter(name, newValue) {
52
- this[name] = __returnValue.bind(null, newValue);
53
- }
54
- var __export = (target, all) => {
55
- for (var name in all)
56
- __defProp(target, name, {
57
- get: all[name],
58
- enumerable: true,
59
- configurable: true,
60
- set: __exportSetter.bind(all, name)
61
- });
62
- };
63
- var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
64
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
65
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
66
- }) : x)(function(x) {
67
- if (typeof require !== "undefined")
68
- return require.apply(this, arguments);
69
- throw Error('Dynamic require of "' + x + '" is not supported');
70
- });
71
-
72
1
  // src/render.ts
73
2
  import { renderToReadableStream } from "hono/jsx/streaming";
74
3
  async function renderToHtml(node) {
@@ -1,74 +1,3 @@
1
- var __create = Object.create;
2
- var __getProtoOf = Object.getPrototypeOf;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- function __accessProp(key) {
8
- return this[key];
9
- }
10
- var __toESMCache_node;
11
- var __toESMCache_esm;
12
- var __toESM = (mod, isNodeMode, target) => {
13
- var canCache = mod != null && typeof mod === "object";
14
- if (canCache) {
15
- var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
16
- var cached = cache.get(mod);
17
- if (cached)
18
- return cached;
19
- }
20
- target = mod != null ? __create(__getProtoOf(mod)) : {};
21
- const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
22
- for (let key of __getOwnPropNames(mod))
23
- if (!__hasOwnProp.call(to, key))
24
- __defProp(to, key, {
25
- get: __accessProp.bind(mod, key),
26
- enumerable: true
27
- });
28
- if (canCache)
29
- cache.set(mod, to);
30
- return to;
31
- };
32
- var __toCommonJS = (from) => {
33
- var entry = (__moduleCache ??= new WeakMap).get(from), desc;
34
- if (entry)
35
- return entry;
36
- entry = __defProp({}, "__esModule", { value: true });
37
- if (from && typeof from === "object" || typeof from === "function") {
38
- for (var key of __getOwnPropNames(from))
39
- if (!__hasOwnProp.call(entry, key))
40
- __defProp(entry, key, {
41
- get: __accessProp.bind(from, key),
42
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
43
- });
44
- }
45
- __moduleCache.set(from, entry);
46
- return entry;
47
- };
48
- var __moduleCache;
49
- var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
50
- var __returnValue = (v) => v;
51
- function __exportSetter(name, newValue) {
52
- this[name] = __returnValue.bind(null, newValue);
53
- }
54
- var __export = (target, all) => {
55
- for (var name in all)
56
- __defProp(target, name, {
57
- get: all[name],
58
- enumerable: true,
59
- configurable: true,
60
- set: __exportSetter.bind(all, name)
61
- });
62
- };
63
- var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
64
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
65
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
66
- }) : x)(function(x) {
67
- if (typeof require !== "undefined")
68
- return require.apply(this, arguments);
69
- throw Error('Dynamic require of "' + x + '" is not supported');
70
- });
71
-
72
1
  // src/request-env.ts
73
2
  var {AsyncLocalStorage} = (() => ({}));
74
3
  var envStore = new AsyncLocalStorage;
package/dist/scripts.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import type { JSX } from 'hono/jsx/jsx-runtime';
1
2
  import { type BarefootBuildManifest } from './app.ts';
2
3
  export type CollectedScript = {
3
4
  src: string;
@@ -51,7 +52,7 @@ export interface BfScriptsProps {
51
52
  * will check this flag and output their scripts inline instead of
52
53
  * collecting them here.
53
54
  */
54
- export declare function BfScripts(props?: BfScriptsProps): import("hono/jsx/jsx-dev-runtime").JSX.Element | null;
55
+ export declare function BfScripts(props?: BfScriptsProps): JSX.Element | null;
55
56
  /**
56
57
  * Register `urls` (a component's resolved script URLs for THIS render) into
57
58
  * the same request-context collector `BfScripts` reads, and return the
@@ -124,7 +125,7 @@ export declare function registerComponentPreloads(urls: string[]): string[];
124
125
  * only ever pass `inlineScripts` (a component with `scriptAssets` but no
125
126
  * `preloadAssets`) keep compiling and behaving exactly as before.
126
127
  */
127
- export declare function wrapWithInlineScripts(jsx: unknown, inlineScripts: string[], inlinePreloads?: string[]): unknown;
128
+ export declare function wrapWithInlineScripts(jsx: unknown, inlineScripts: string[], inlinePreloads?: string[]): JSX.Element;
128
129
  /**
129
130
  * Walk stub-rewrite edges from each manifest entry in `roots`,
130
131
  * returning the script URLs for every transitively reachable
@@ -1 +1 @@
1
- {"version":3,"file":"scripts.d.ts","sourceRoot":"","sources":["../src/scripts.tsx"],"names":[],"mappings":"AA0CA,OAAO,EAA6B,KAAK,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAEhF,MAAM,MAAM,eAAe,GAAG;IAC5B,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAA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