@kiln-js/client 0.1.3 → 0.2.0-hotfix

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 zxsty
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,51 @@
1
+ # @kiln-js/client
2
+
3
+ [![npm](https://img.shields.io/npm/v/%40kiln-js%2Fclient)](https://www.npmjs.com/package/@kiln-js/client)
4
+ [![license](https://img.shields.io/npm/l/%40kiln-js%2Fclient)](LICENSE)
5
+
6
+ Part of the Kiln framework.
7
+
8
+ Part of [Kiln](https://github.com/kiln-js/kiln), a file-based server-side rendering framework for React and Vite.
9
+
10
+ ## Install
11
+
12
+ ```bash
13
+ bun add @kiln-js/client
14
+ ```
15
+
16
+ ## Usage
17
+
18
+ ```tsx
19
+ import { createClient } from "@kiln-js/client";
20
+
21
+ createClient().then((client) => client.start());
22
+ ```
23
+
24
+ ```tsx
25
+ import { Link } from "@kiln-js/client";
26
+
27
+ export default function Layout({ children }: { children: React.ReactNode }) {
28
+ return (
29
+ <>
30
+ <nav><Link href="/">Home</Link> <Link href="/about">About</Link></nav>
31
+ {children}
32
+ </>
33
+ );
34
+ }
35
+ ```
36
+
37
+ ## Navigation
38
+
39
+ `Link` navigates without a full reload. Modifier clicks (Ctrl, Cmd, Shift, middle button) keep the default browser behavior.
40
+
41
+ ## Documentation
42
+
43
+ See the [Kiln repository](https://github.com/kiln-js/kiln) for the full API reference and guides.
44
+
45
+ ## Development
46
+
47
+ This repository is generated from the Kiln monorepo. Make changes there, then run `scripts/publish-repo.ps1` to publish them here. Report issues in this repository, and send pull requests to the monorepo.
48
+
49
+ ## License
50
+
51
+ MIT
package/dist/client.d.ts CHANGED
@@ -1,11 +1,20 @@
1
1
  import { type AnchorHTMLAttributes } from "react";
2
2
  import type { ClientRoute } from "./types";
3
- export declare function navigate(to: string, push?: boolean): Promise<void>;
4
- export declare function Link(props: AnchorHTMLAttributes<HTMLAnchorElement> & {
3
+ interface NavigateOptions {
4
+ push?: boolean;
5
+ scroll?: boolean;
6
+ restoreY?: number;
7
+ }
8
+ export declare function navigate(to: string, options?: NavigateOptions | boolean): Promise<void>;
9
+ export declare function prefetch(to: string): void;
10
+ export declare function invalidate(path?: string): void;
11
+ export interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
5
12
  href: string;
6
- }): import("react").JSX.Element;
13
+ }
14
+ export declare function Link({ href, onClick, onMouseEnter, onFocus, target, download, ...rest }: LinkProps): import("react").JSX.Element;
7
15
  export declare function createClient(options?: {
8
16
  routes?: ClientRoute[];
9
17
  }): Promise<{
10
18
  start(): Promise<void>;
11
19
  }>;
20
+ export {};
@@ -0,0 +1,15 @@
1
+ import { Component, type ReactNode } from "react";
2
+ interface Props {
3
+ children: ReactNode;
4
+ }
5
+ interface State {
6
+ error: Error | null;
7
+ }
8
+ export declare class ErrorBoundary extends Component<Props, State> {
9
+ state: State;
10
+ static getDerivedStateFromError(error: Error): State;
11
+ componentDidCatch(error: Error): void;
12
+ private reset;
13
+ render(): string | number | boolean | Iterable<ReactNode> | import("react").JSX.Element | null | undefined;
14
+ }
15
+ export {};
@@ -0,0 +1 @@
1
+ export declare function reportHydrationMismatch(serverHtml: string, container: Element, error: unknown): void;
package/dist/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
- export { createClient, navigate, Link } from "./client";
2
- export { usePathname, useParams } from "@kiln-js/core";
1
+ export { createClient, navigate, prefetch, invalidate, Link } from "./client";
2
+ export type { LinkProps } from "./client";
3
+ export { ErrorBoundary } from "./error-boundary";
4
+ export { usePathname, useParams, ClientOnly, useIsClient, Await, defer } from "@kiln-js/core";
3
5
  export type { ClientRoute, KilnBoot, RenderMode } from "./types";
package/dist/index.js CHANGED
@@ -1,79 +1,142 @@
1
- // src/client.tsx
2
- import { hydrateRoot, createRoot } from "react-dom/client";
3
- import { useState } from "react";
1
+ // packages/client/src/client.tsx
2
+ import { createElement, useState } from "react";
3
+ import { createRoot, hydrateRoot } from "react-dom/client";
4
+ import { compose, matchRoute, RouteProvider } from "@kiln-js/core";
4
5
 
5
- // ../core/dist/index.js
6
- import { jsx } from "react/jsx-runtime";
7
- import { createContext, useContext } from "react";
8
- import { jsx as jsx2 } from "react/jsx-runtime";
9
- import { createContext as createContext2, useContext as useContext2, useEffect, useLayoutEffect } from "react";
10
- import { jsx as jsx3 } from "react/jsx-runtime";
11
- function matchRoute(routes, pathname) {
12
- const parts = pathname.split("/").filter(Boolean);
13
- for (const route of routes) {
14
- const segs = route.pattern.split("/").filter(Boolean);
15
- const params = {};
16
- let ok = true;
17
- let i = 0;
18
- for (const seg of segs) {
19
- if (seg.startsWith("*")) {
20
- params[seg.slice(1)] = parts.slice(i).map(decodeURIComponent).join("/");
21
- i = parts.length;
22
- break;
23
- }
24
- if (i >= parts.length) {
25
- ok = false;
26
- break;
27
- }
28
- if (seg.startsWith(":"))
29
- params[seg.slice(1)] = decodeURIComponent(parts[i]);
30
- else if (seg !== parts[i]) {
31
- ok = false;
32
- break;
33
- }
34
- i++;
35
- }
36
- if (ok && i === parts.length)
37
- return { route, params };
6
+ // packages/client/src/error-boundary.tsx
7
+ import { Component } from "react";
8
+ import { jsx, jsxs } from "react/jsx-runtime";
9
+ var ErrorBoundary = class extends Component {
10
+ state = { error: null };
11
+ static getDerivedStateFromError(error) {
12
+ return { error };
13
+ }
14
+ componentDidCatch(error) {
15
+ console.error("[kiln] render error:", error);
16
+ }
17
+ reset = () => this.setState({ error: null });
18
+ render() {
19
+ if (!this.state.error) return this.props.children;
20
+ return /* @__PURE__ */ jsxs("div", { role: "alert", style: { padding: "2rem", fontFamily: "system-ui, sans-serif", maxWidth: "40rem" }, children: [
21
+ /* @__PURE__ */ jsx("h1", { style: { fontSize: "1.5rem", margin: "0 0 0.5rem" }, children: "Something went wrong on this page" }),
22
+ /* @__PURE__ */ jsx("p", { style: { opacity: 0.75 }, children: "The rest of the site still works. Try again, or go back to the home page." }),
23
+ /* @__PURE__ */ jsxs("details", { style: { margin: "1rem 0" }, children: [
24
+ /* @__PURE__ */ jsx("summary", { children: "Details" }),
25
+ /* @__PURE__ */ jsx("pre", { style: { whiteSpace: "pre-wrap" }, children: this.state.error.message })
26
+ ] }),
27
+ /* @__PURE__ */ jsx("button", { type: "button", onClick: this.reset, children: "Try again" }),
28
+ " ",
29
+ /* @__PURE__ */ jsx("a", { href: "/", children: "Home" })
30
+ ] });
38
31
  }
39
- return null;
40
- }
41
- function compose(page, layouts) {
42
- let tree = page;
43
- for (const Layout of [...layouts].reverse())
44
- tree = /* @__PURE__ */ jsx(Layout, {
45
- children: tree
46
- });
47
- return tree;
48
- }
49
- var RouteContext = createContext({ pathname: "/", params: {} });
50
- function RouteProvider({ value, children }) {
51
- return /* @__PURE__ */ jsx2(RouteContext.Provider, {
52
- value,
53
- children
32
+ };
33
+
34
+ // packages/client/src/hydration-viewer.ts
35
+ var DEV = import.meta.env?.DEV === true;
36
+ var shown = false;
37
+ function reportHydrationMismatch(serverHtml, container, error) {
38
+ if (!DEV) return;
39
+ console.warn("[kiln] hydration mismatch", error);
40
+ if (shown) return;
41
+ shown = true;
42
+ setTimeout(() => showPanel(serverHtml, container.innerHTML, error), 0);
43
+ }
44
+ function lines(html) {
45
+ return html.replace(/></g, ">\n<").split("\n");
46
+ }
47
+ function el(tag, text, css) {
48
+ const node = document.createElement(tag);
49
+ if (text !== void 0) node.textContent = text;
50
+ if (css) Object.assign(node.style, css);
51
+ return node;
52
+ }
53
+ function column(title, rows, other) {
54
+ const wrap = el("div", void 0, { minWidth: "0" });
55
+ wrap.append(el("div", title, { color: "#8b949e", marginBottom: "6px", fontWeight: "600" }));
56
+ const body = el("div", void 0, { whiteSpace: "pre-wrap", wordBreak: "break-all" });
57
+ rows.forEach((row, i) => {
58
+ const differs = row !== other[i];
59
+ body.append(el("div", row || " ", differs ? { background: "rgba(248,81,73,0.22)" } : void 0));
54
60
  });
61
+ wrap.append(body);
62
+ return wrap;
55
63
  }
56
- var usePathname = () => useContext(RouteContext).pathname;
57
- var useParams = () => useContext(RouteContext).params;
58
- var HeadContext = createContext2(null);
59
-
60
- // src/routes.ts
61
- function getInjectedRoutes() {
62
- const routes = globalThis.__KILN_ROUTES__;
63
- if (!routes) {
64
- throw new Error("No routes found. Pass createClient({ routes }) or run through the Kiln plugin.");
65
- }
66
- return routes;
64
+ function showPanel(serverHtml, clientHtml, error) {
65
+ document.querySelector("[data-kiln-hydration]")?.remove();
66
+ const server = lines(serverHtml);
67
+ const client = lines(clientHtml);
68
+ const panel = el("div", void 0, {
69
+ position: "fixed",
70
+ left: "0",
71
+ right: "0",
72
+ bottom: "0",
73
+ maxHeight: "50vh",
74
+ overflow: "auto",
75
+ zIndex: "2147483647",
76
+ background: "#0e1116",
77
+ color: "#e6edf3",
78
+ font: "12px/1.5 ui-monospace, monospace",
79
+ padding: "14px 18px",
80
+ borderTop: "2px solid #f85149"
81
+ });
82
+ panel.setAttribute("data-kiln-hydration", "");
83
+ const header = el("div", void 0, { display: "flex", gap: "12px", alignItems: "baseline", marginBottom: "8px" });
84
+ header.append(el("strong", "Hydration mismatch", { color: "#ff7b72" }));
85
+ header.append(el("span", error instanceof Error ? error.message : String(error), { color: "#8b949e", flex: "1" }));
86
+ const close = el("button", "Close", { cursor: "pointer", background: "transparent", color: "#e6edf3", border: "1px solid #30363d", borderRadius: "6px", padding: "2px 10px" });
87
+ close.onclick = () => panel.remove();
88
+ header.append(close);
89
+ panel.append(header);
90
+ panel.append(
91
+ el(
92
+ "p",
93
+ "Highlighted lines differ. The page shows the browser version. Common causes: Date.now(), Math.random(), toLocaleString(), or window checks during render.",
94
+ { margin: "0 0 10px", color: "#8b949e" }
95
+ )
96
+ );
97
+ const grid = el("div", void 0, { display: "grid", gridTemplateColumns: "1fr 1fr", gap: "16px" });
98
+ grid.append(column("Server HTML", server, client), column("Browser HTML", client, server));
99
+ panel.append(grid);
100
+ document.body.append(panel);
67
101
  }
68
102
 
69
- // src/client.tsx
70
- import { jsx as jsx4 } from "react/jsx-runtime";
103
+ // packages/client/src/client.tsx
104
+ import { jsx as jsx2 } from "react/jsx-runtime";
71
105
  var routes = [];
72
- var setCurrent = () => {};
106
+ var setCurrent = () => {
107
+ };
108
+ var mounted = false;
109
+ var latestNavigation = 0;
110
+ var currentPath = "";
111
+ var defaultTitle = "";
112
+ var dataCache = /* @__PURE__ */ new Map();
113
+ var isRedirect = (v) => typeof v === "object" && v !== null && typeof v.redirect === "string";
114
+ function fetchData(path) {
115
+ const request = fetch(`/__kiln/data?path=${encodeURIComponent(path)}`, {
116
+ headers: { accept: "application/json" }
117
+ }).then(async (res) => {
118
+ if (!res.ok) throw new Error(`Loader request for ${path} failed with ${res.status}`);
119
+ return res.json();
120
+ });
121
+ request.catch(() => dataCache.delete(path));
122
+ return request;
123
+ }
124
+ function takeData(path) {
125
+ const cached = dataCache.get(path);
126
+ if (cached) {
127
+ dataCache.delete(path);
128
+ return cached;
129
+ }
130
+ return fetchData(path);
131
+ }
132
+ function sameSiteUrl(to) {
133
+ const url = new URL(to, location.href);
134
+ return url.origin === location.origin ? url : null;
135
+ }
136
+ var isNavigable = (route) => !!route && !!route.load && route.mode !== "server";
73
137
  async function resolve(url, data) {
74
138
  const match = matchRoute(routes, url.pathname);
75
- if (!match?.route.load)
76
- throw new Error(`No client route for ${url.pathname}`);
139
+ if (!match || !isNavigable(match.route)) return null;
77
140
  const [mod, ...layouts] = await Promise.all([
78
141
  match.route.load(),
79
142
  ...match.route.layouts.map((l) => l())
@@ -89,62 +152,187 @@ async function resolve(url, data) {
89
152
  function App({ initial }) {
90
153
  const [current, set] = useState(initial);
91
154
  setCurrent = set;
155
+ mounted = true;
92
156
  const { Page, layouts, params, pathname, data } = current;
93
- return /* @__PURE__ */ jsx4(RouteProvider, {
94
- value: { pathname, params },
95
- children: compose(/* @__PURE__ */ jsx4(Page, {
96
- params,
97
- data
98
- }), layouts)
157
+ return /* @__PURE__ */ jsx2(ErrorBoundary, { children: /* @__PURE__ */ jsx2(RouteProvider, { value: { pathname, params }, children: compose(
158
+ /* @__PURE__ */ jsx2(ErrorBoundary, { children: /* @__PURE__ */ jsx2(Page, { params, data }) }, pathname),
159
+ layouts
160
+ ) }) });
161
+ }
162
+ function scrollToHash(hash) {
163
+ if (!hash) return;
164
+ requestAnimationFrame(() => {
165
+ document.getElementById(decodeURIComponent(hash.slice(1)))?.scrollIntoView();
99
166
  });
100
167
  }
101
- async function navigate(to, push = true) {
102
- const url = new URL(to, location.href);
103
- const match = matchRoute(routes, url.pathname);
104
- if (!match || match.route.mode === "server") {
168
+ async function navigate(to, options = {}) {
169
+ const opts = typeof options === "boolean" ? { push: options } : options;
170
+ const { push = true, scroll = true, restoreY } = opts;
171
+ const url = sameSiteUrl(to);
172
+ if (!url) {
105
173
  location.href = to;
106
174
  return;
107
175
  }
108
- const data = match.route.mode === "client" ? null : await fetch(`/__kiln/data?path=${encodeURIComponent(url.pathname)}`).then((r) => r.json());
109
- setCurrent(await resolve(url, data));
110
- if (push)
111
- history.pushState({}, "", to);
112
- window.scrollTo(0, 0);
113
- }
114
- function Link(props) {
115
- return /* @__PURE__ */ jsx4("a", {
116
- ...props,
117
- onClick: (e) => {
118
- if (e.metaKey || e.ctrlKey || e.shiftKey || e.button !== 0)
119
- return;
120
- e.preventDefault();
121
- navigate(props.href);
176
+ if (!mounted) {
177
+ location.href = url.href;
178
+ return;
179
+ }
180
+ const id = ++latestNavigation;
181
+ const match = matchRoute(routes, url.pathname);
182
+ if (!match || !isNavigable(match.route)) {
183
+ location.href = url.href;
184
+ return;
185
+ }
186
+ const path = url.pathname + url.search;
187
+ try {
188
+ const data = match.route.mode === "client" ? null : await takeData(path);
189
+ if (isRedirect(data)) {
190
+ location.assign(data.redirect);
191
+ return;
192
+ }
193
+ if (id !== latestNavigation) return;
194
+ const next = await resolve(url, data);
195
+ if (!next || id !== latestNavigation) return;
196
+ if (push) {
197
+ history.replaceState({ ...history.state, y: window.scrollY }, "");
198
+ history.pushState({ y: 0 }, "", path + url.hash);
122
199
  }
200
+ document.title = defaultTitle;
201
+ setCurrent(next);
202
+ currentPath = path;
203
+ if (!push && restoreY !== void 0) window.scrollTo(0, restoreY);
204
+ else if (scroll) window.scrollTo(0, 0);
205
+ scrollToHash(url.hash);
206
+ } catch (err) {
207
+ console.error("[kiln] navigation failed, loading the page normally", err);
208
+ location.href = url.href;
209
+ }
210
+ }
211
+ function onPopState() {
212
+ const path = location.pathname + location.search;
213
+ if (path === currentPath) return;
214
+ const y = history.state?.y ?? 0;
215
+ navigate(path, { push: false, restoreY: y });
216
+ }
217
+ function prefetch(to) {
218
+ const url = sameSiteUrl(to);
219
+ if (!url) return;
220
+ const match = matchRoute(routes, url.pathname);
221
+ if (!match || !isNavigable(match.route)) return;
222
+ void match.route.load().catch(() => {
223
+ });
224
+ const path = url.pathname + url.search;
225
+ if (match.route.mode !== "client" && !dataCache.has(path)) {
226
+ dataCache.set(path, fetchData(path));
227
+ }
228
+ }
229
+ function invalidate(path) {
230
+ if (path) dataCache.delete(path);
231
+ else dataCache.clear();
232
+ }
233
+ function leavesApp(e, href, target, download) {
234
+ if (e.defaultPrevented || e.button !== 0) return true;
235
+ if (e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) return true;
236
+ if (target && target !== "_self") return true;
237
+ if (download) return true;
238
+ const url = sameSiteUrl(href);
239
+ if (!url) return true;
240
+ if (url.pathname === location.pathname && url.search === location.search && url.hash) return true;
241
+ return false;
242
+ }
243
+ function Link({ href, onClick, onMouseEnter, onFocus, target, download, ...rest }) {
244
+ return /* @__PURE__ */ jsx2(
245
+ "a",
246
+ {
247
+ ...rest,
248
+ href,
249
+ target,
250
+ download,
251
+ onMouseEnter: (e) => {
252
+ onMouseEnter?.(e);
253
+ prefetch(href);
254
+ },
255
+ onFocus: (e) => {
256
+ onFocus?.(e);
257
+ prefetch(href);
258
+ },
259
+ onClick: (e) => {
260
+ onClick?.(e);
261
+ if (leavesApp(e, href, target, download)) return;
262
+ e.preventDefault();
263
+ navigate(href);
264
+ }
265
+ }
266
+ );
267
+ }
268
+ function injectedRoutes() {
269
+ const injected = globalThis.__KILN_ROUTES__;
270
+ if (!injected) {
271
+ throw new Error("No routes found. Pass createClient({ routes }) or run through the Kiln plugin.");
272
+ }
273
+ return injected;
274
+ }
275
+ function hydrateIslands() {
276
+ const registry = globalThis.__KILN_ISLANDS__ ?? {};
277
+ document.querySelectorAll("[data-kiln-island]").forEach((node) => {
278
+ const id = node.dataset.kilnIsland ?? "";
279
+ const load = registry[id];
280
+ if (!load) {
281
+ console.warn(`[kiln] no client code for island ${id}`);
282
+ return;
283
+ }
284
+ const serverHtml = node.innerHTML;
285
+ load().then(({ default: Component2 }) => {
286
+ const props = JSON.parse(node.dataset.props || "{}");
287
+ hydrateRoot(node, createElement(Component2, props), {
288
+ onRecoverableError: (error) => reportHydrationMismatch(serverHtml, node, error)
289
+ });
290
+ }).catch((err) => console.error(`[kiln] island ${id} failed to load`, err));
123
291
  });
124
292
  }
125
293
  async function createClient(options = {}) {
126
- routes = options.routes ?? getInjectedRoutes();
294
+ routes = options.routes ?? injectedRoutes();
127
295
  return {
128
296
  async start() {
129
- window.addEventListener("popstate", () => navigate(location.pathname + location.search, false));
130
- const boot = window.__KILN__ ?? { mode: "universal", pattern: "", data: null };
297
+ defaultTitle = document.title;
298
+ history.scrollRestoration = "manual";
299
+ window.addEventListener("popstate", onPopState);
300
+ const boot = window.__KILN__ ?? { mode: "universal", pattern: "", data: null, islands: false };
301
+ if (boot.islands) {
302
+ hydrateIslands();
303
+ return;
304
+ }
305
+ const url = new URL(location.href);
306
+ currentPath = url.pathname + url.search;
307
+ const initial = await resolve(url, boot.data);
308
+ if (!initial) throw new Error(`No client page for ${url.pathname}`);
131
309
  const container = document.getElementById("root");
132
- const initial = await resolve(new URL(location.href), boot.data);
133
- if (boot.mode === "client")
134
- createRoot(container).render(/* @__PURE__ */ jsx4(App, {
135
- initial
136
- }));
137
- else
138
- hydrateRoot(container, /* @__PURE__ */ jsx4(App, {
139
- initial
140
- }));
310
+ const serverHtml = container.innerHTML;
311
+ const tree = /* @__PURE__ */ jsx2(App, { initial });
312
+ if (boot.mode === "client") {
313
+ createRoot(container).render(tree);
314
+ } else {
315
+ hydrateRoot(container, tree, {
316
+ onRecoverableError: (error) => reportHydrationMismatch(serverHtml, container, error)
317
+ });
318
+ }
141
319
  }
142
320
  };
143
321
  }
322
+
323
+ // packages/client/src/index.ts
324
+ import { usePathname, useParams, ClientOnly, useIsClient, Await, defer } from "@kiln-js/core";
144
325
  export {
326
+ Await,
327
+ ClientOnly,
328
+ ErrorBoundary,
145
329
  Link,
146
330
  createClient,
331
+ defer,
332
+ invalidate,
147
333
  navigate,
334
+ prefetch,
335
+ useIsClient,
148
336
  useParams,
149
337
  usePathname
150
338
  };
package/dist/types.d.ts CHANGED
@@ -5,7 +5,7 @@ export interface ClientRoute {
5
5
  mode: RenderMode;
6
6
  load: (() => Promise<{
7
7
  default: ComponentType<any>;
8
- loader?: (...args: any[]) => unknown;
8
+ loader?: unknown;
9
9
  }>) | null;
10
10
  layouts: (() => Promise<{
11
11
  default: ComponentType<any>;
@@ -15,6 +15,7 @@ export interface KilnBoot {
15
15
  mode: RenderMode;
16
16
  pattern: string;
17
17
  data: unknown;
18
+ islands?: boolean;
18
19
  }
19
20
  declare global {
20
21
  interface Window {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiln-js/client",
3
- "version": "0.1.3",
3
+ "version": "0.2.0-hotfix",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -16,8 +16,10 @@
16
16
  "build": "bun build ./src/index.ts --outdir ./dist --target browser --format esm --external react --external react-dom \u0026\u0026 tsc -p tsconfig.json --emitDeclarationOnly",
17
17
  "typecheck": "tsc -p tsconfig.json --noEmit"
18
18
  },
19
+ "repository": "github:kiln-js/cli",
20
+ "homepage": "https://kiln-js.vercel.app",
19
21
  "dependencies": {
20
- "@kiln-js/core": "^0.1.3"
22
+ "@kiln-js/core": "^0.2.0-hotfix"
21
23
  },
22
24
  "peerDependencies": {
23
25
  "react": "\u003e=18",