hypersig-ts 0.0.0-stage → 0.2.0
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/CHANGELOG.md +49 -0
- package/LICENSE +15 -0
- package/README.ja.md +164 -0
- package/README.md +163 -2
- package/dist/action.d.ts +149 -0
- package/dist/action.d.ts.map +1 -0
- package/dist/action.js +339 -0
- package/dist/action.js.map +1 -0
- package/dist/browser.d.ts +2 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/browser.js +452 -0
- package/dist/browser.js.map +1 -0
- package/dist/core.d.ts +10 -0
- package/dist/core.d.ts.map +1 -0
- package/dist/core.js +3 -0
- package/dist/core.js.map +1 -0
- package/dist/custom-tag.d.ts +46 -0
- package/dist/custom-tag.d.ts.map +1 -0
- package/dist/custom-tag.js +47 -0
- package/dist/custom-tag.js.map +1 -0
- package/dist/define-element.d.ts +39 -0
- package/dist/define-element.d.ts.map +1 -0
- package/dist/define-element.js +79 -0
- package/dist/define-element.js.map +1 -0
- package/dist/diagnostics.d.ts +42 -0
- package/dist/diagnostics.d.ts.map +1 -0
- package/dist/diagnostics.js +9 -0
- package/dist/diagnostics.js.map +1 -0
- package/dist/drafts.d.ts +4 -0
- package/dist/drafts.d.ts.map +1 -0
- package/dist/drafts.js +120 -0
- package/dist/drafts.js.map +1 -0
- package/dist/element.d.ts +136 -0
- package/dist/element.d.ts.map +1 -0
- package/dist/element.js +88 -0
- package/dist/element.js.map +1 -0
- package/dist/evaluate.d.ts +14 -0
- package/dist/evaluate.d.ts.map +1 -0
- package/dist/evaluate.js +164 -0
- package/dist/evaluate.js.map +1 -0
- package/dist/hono.d.ts +82 -0
- package/dist/hono.d.ts.map +1 -0
- package/dist/hono.js +156 -0
- package/dist/hono.js.map +1 -0
- package/dist/identifier.d.ts +35 -0
- package/dist/identifier.d.ts.map +1 -0
- package/dist/identifier.js +2 -0
- package/dist/identifier.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/live-runtime.d.ts +153 -0
- package/dist/live-runtime.d.ts.map +1 -0
- package/dist/live-runtime.js +377 -0
- package/dist/live-runtime.js.map +1 -0
- package/dist/live.d.ts +113 -0
- package/dist/live.d.ts.map +1 -0
- package/dist/live.js +2 -0
- package/dist/live.js.map +1 -0
- package/dist/morph.d.ts +11 -0
- package/dist/morph.d.ts.map +1 -0
- package/dist/morph.js +94 -0
- package/dist/morph.js.map +1 -0
- package/dist/outlet.d.ts +16 -0
- package/dist/outlet.d.ts.map +1 -0
- package/dist/outlet.js +16 -0
- package/dist/outlet.js.map +1 -0
- package/dist/page-token.d.ts +45 -0
- package/dist/page-token.d.ts.map +1 -0
- package/dist/page-token.js +136 -0
- package/dist/page-token.js.map +1 -0
- package/dist/protocol.d.ts +150 -0
- package/dist/protocol.d.ts.map +1 -0
- package/dist/protocol.js +322 -0
- package/dist/protocol.js.map +1 -0
- package/dist/react.d.ts +23 -0
- package/dist/react.d.ts.map +1 -0
- package/dist/react.js +34 -0
- package/dist/react.js.map +1 -0
- package/dist/redis.d.ts +48 -0
- package/dist/redis.d.ts.map +1 -0
- package/dist/redis.js +58 -0
- package/dist/redis.js.map +1 -0
- package/dist/reload-budget.d.ts +7 -0
- package/dist/reload-budget.d.ts.map +1 -0
- package/dist/reload-budget.js +45 -0
- package/dist/reload-budget.js.map +1 -0
- package/dist/render.d.ts +59 -0
- package/dist/render.d.ts.map +1 -0
- package/dist/render.js +93 -0
- package/dist/render.js.map +1 -0
- package/dist/runtime.js +3 -0
- package/dist/sanitize.d.ts +8 -0
- package/dist/sanitize.d.ts.map +1 -0
- package/dist/sanitize.js +22 -0
- package/dist/sanitize.js.map +1 -0
- package/dist/signal-runtime.d.ts +94 -0
- package/dist/signal-runtime.d.ts.map +1 -0
- package/dist/signal-runtime.js +736 -0
- package/dist/signal-runtime.js.map +1 -0
- package/dist/signal.d.ts +369 -0
- package/dist/signal.d.ts.map +1 -0
- package/dist/signal.js +459 -0
- package/dist/signal.js.map +1 -0
- package/dist/stream.d.ts +61 -0
- package/dist/stream.d.ts.map +1 -0
- package/dist/stream.js +432 -0
- package/dist/stream.js.map +1 -0
- package/dist/topic.d.ts +21 -0
- package/dist/topic.d.ts.map +1 -0
- package/dist/topic.js +88 -0
- package/dist/topic.js.map +1 -0
- package/package.json +128 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). While the version is 0.x, a minor version may contain breaking changes; each one is listed here.
|
|
6
|
+
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
## [0.2.0] - 2026-11-25
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- `hypersig-ts/redis` exports `createRedisPubSub({ publish, subscribe, channelPrefix })`, a Pub/Sub that delivers publications between processes through Redis Pub/Sub. The application passes the `PUBLISH` and subscribe calls of its Redis client, so the package adds no dependency; the deployment guide shows node-redis, ioredis, and `Bun.RedisClient`. Each Topic is the channel `channelPrefix` (default `"hypersig:"`) followed by the JSON of its name and key, with an empty message, and the views of one adapter share one Redis subscription per Topic. `publish` resolves once Redis has accepted the message. `disconnected()`, called from the client's disconnect or reconnect event, ends every subscription, so the live runtime subscribes again and re-reads its views. Redis keeps no message for a disconnected subscriber; the guide points to `reconcileIntervalMs` and the outbox pattern for views that must catch up anyway.
|
|
14
|
+
- The Counter example keeps its counts in Redis and publishes through `createRedisPubSub()` with `Bun.RedisClient` when `REDIS_URL` is set, so an Action on one process reaches tabs on another. Its `/metrics` (with `COUNTER_METRICS=1`) reports CPU time, RSS, and heap.
|
|
15
|
+
- `bun run bench:multi` measures delivery from an Action on one of one to three counter processes sharing Redis to every SSE connection on all of them, against one process with the memory Pub/Sub. `bench/README.md` has the results for 100 to 3000 connections: on an Apple M2 Pro with 1000 connections, delivery to every connection took 75.6 ms (p50) on one process with the memory Pub/Sub, 85.8 ms on one process with Redis, and 39.9 ms on three processes with Redis.
|
|
16
|
+
- `action.call(input, { pending })` shows the user's own action until it is committed. `pending` takes `set` statements, which run when the call runs, before its input is evaluated. The runtime remembers the latest committed value of each path from every `data-hs-signals` load, lets a Live View update replace the shown value during the request, and on failure writes the latest committed value back to each path the request still owns before `onError` runs; a later call that writes the same path takes it over, and a `set` or `toggle` statement or a `bindValue` input that writes it ends the pending value, so a failure keeps that newer write. A path with no committed value makes the handler that runs the call throw and send nothing; inside another call's `onSuccess` or `onError`, the exception goes to `reportError` instead of an unhandled rejection. Any statement other than `set` is a `TypeError` when the call is built, and `isStmtNode` accepts the optional sixth element of a `call` only as a list of `set` statements. The Widgets favorite toggle uses it instead of a second signal holding the committed value. The docs now recommend the pending state alone in most cases, and say that copying server data into signals and changing it there gives the data two owners. The runtime grows by 262 B gzipped.
|
|
17
|
+
- Guidance on showing the user's own action before the server confirms it, as a pending echo, in the concepts page and `docs/architecture.md`: the line between predicting the server's result (not done) and echoing the user's own action, when to use it, and three rules (mark it pending, revert to the latest committed value on failure, let the committed value replace it). The reference no longer advises reverting to the value the page was rendered with, which is stale once another tab commits during the request.
|
|
18
|
+
- The Widgets example has a Favorite toggle that shows the click as a pending echo, with a "Fail next save" control and browser tests for the pending state, the revert, a commit from another tab during the request, and a second tab.
|
|
19
|
+
- `hypersig-ts/core` exports the `JsonValue` type, for typing Live View params that hold any JSON. A param property typed `unknown` is rejected by `PageRenderContext.view`.
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
|
|
23
|
+
- **Breaking:** `on.keydown` counts Shift for a character key when Control, Alt, or Meta is held, so `"Control+Shift+z"` and `"Control+z"` are different keys. The character after Control, Alt, or Meta is compared in either case and must be written in lowercase; `"Control+Z"` is now a type error and throws. Without Control, Alt, or Meta, Shift is still ignored for a character key and `"Shift+?"` is still rejected. As a result, `"Meta+z"` no longer also matches Cmd+Shift+Z on macOS; map `"Shift+Meta+z"` for that.
|
|
24
|
+
- **Breaking:** `bindAttr` leaves out a non-boolean attribute whose expression evaluates to `null` on the server and removes it in the browser, where it used to render the attribute empty. An attribute such as `aria-activedescendant` can now be absent instead of empty, and `bindAttr` accepts expressions of a union type such as `string | null`. An empty string still renders the attribute empty. The Widgets combobox no longer renders `aria-activedescendant=""` while closed.
|
|
25
|
+
- The browser runtime parses each `data-hs-on-keydown` key map once and reads it again only after the attribute changes, instead of parsing every enclosing map on every keydown.
|
|
26
|
+
- The README overview is shorter, lists the packages, and presents Void as a host; the rating example is called Reviews.
|
|
27
|
+
- The "Live View page token is too long" error says that the SSR snapshots of shared views count toward the limit as well as params.
|
|
28
|
+
|
|
29
|
+
### Fixed
|
|
30
|
+
|
|
31
|
+
- `customElement()` with an attribute kind other than `string`, `number`, `boolean`, or `json` now reports a type error naming the attribute and its kind, instead of a misleading message about attribute names.
|
|
32
|
+
|
|
33
|
+
## [0.1.0] - 2026-11-25
|
|
34
|
+
|
|
35
|
+
First public release on npm as `hypersig-ts`. Earlier internal versions, including the `1.0.0` placeholder in `package.json`, were never published.
|
|
36
|
+
|
|
37
|
+
### Added
|
|
38
|
+
|
|
39
|
+
- **Live Views over SSE.** `hypersig.live()` defines a server-rendered region with `subscribe`, `authorize`, `load`, and `render`. When the application publishes a Topic after committing a change, only the subscribed views render again, and their HTML streams to open pages over Server-Sent Events, where the browser runtime morphs it into place. A reconnect reads the current state again. Nested views, keyed instances, and opt-in sharing of identical reads and renders across connections are supported.
|
|
40
|
+
- **Typed Actions, Topics, and forms.** `hypersig.action()` takes Standard Schema input and output, an `authorize` check, and `execute`. `bind()` and `call()` check button inputs, `form()` and `field()` check form field names, and `fieldError()` marks where a field's message goes. `control()` derives `required`, `minLength`, `maxLength`, `pattern`, `min`, and `max` from the input schema's JSON Schema without making the browser stricter than the server. `topic()` gives publishers and subscribers one type for each change.
|
|
41
|
+
- **Browser signals.** `signals()` and `signalFamily()` hold browser-only JSON state whose expressions are data the runtime evaluates, so pages work under `script-src 'self'` without `eval`. Bindings render on the server for a correct first paint. Statements include `set`, `toggle`, `focus`, and `action.call()`, triggered by `on.click`, `on.input`, `on.change`, `on.keydown` (typed key maps), `on.focusEnter`, and `on.focusLeave`, together with `refs()`, `timer()` for delays and debouncing, and `when()` for branching. Expressions cover numbers, booleans, strings, and arrays. `action.pending()`, `data-hs-pending`, and drafts restored with `form({ draft: true })` show progress and keep unfinished input.
|
|
42
|
+
- **Page tokens.** A page's view registrations are sealed into an encrypted token bound to the app (`pageContext`), so any process holding the same `pageKeys` can continue the page. Streams end after `maxStreamMs` to pick up fresh credentials, and the token is renewed while the user can still read the page.
|
|
43
|
+
- **Custom elements and React islands.** `customElement()` declares an element's tag, attributes (including JSON), and events once as a value shared by the server and the browser. `CustomTag` renders it, a signal scope's `bindElement()` binds its attributes to signals, `defineElement()` implements it in the browser from `hypersig-ts/element`, and `reactElement()` mounts a React component as the element from `hypersig-ts/react`.
|
|
44
|
+
- **Security defaults.** Actions compare the request's `Origin` header with the configured origin and validate input on the server. Live View HTML is sanitized with DOMPurify before it enters the page. `bindAttr` rejects `href`, `src`, `on*`, and `style`. Each session holds at most `maxStreamsPerSession` streams per process, and automatic reloads after a reset are limited.
|
|
45
|
+
- A Hono adapter (`createHypersig`), a renderer-agnostic core (`hypersig-ts/core`), typed outlets (`errorOutlet()`, `connectionStatusOutlet()`), diagnostics events, and examples: Counter, TodoMVC, Shared memo, Rating, Sortable, Widgets, and Void with Cloudflare Workers.
|
|
46
|
+
|
|
47
|
+
[Unreleased]: https://github.com/imaimai17468/hypersig-ts/compare/v0.2.0...HEAD
|
|
48
|
+
[0.2.0]: https://github.com/imaimai17468/hypersig-ts/compare/v0.1.0...v0.2.0
|
|
49
|
+
[0.1.0]: https://github.com/imaimai17468/hypersig-ts/releases/tag/v0.1.0
|
package/LICENSE
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
ISC License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 imaimai17468
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
7
|
+
copyright notice and this permission notice appear in all copies.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
10
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
11
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
12
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
13
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
14
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
15
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
package/README.ja.md
ADDED
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
# hypersig.ts
|
|
2
|
+
|
|
3
|
+
[English](README.md)
|
|
4
|
+
|
|
5
|
+
hypersig.ts は、サーバーが描いた画面を、保存されたデータといつも同じに保つ TypeScript の Web フレームワークです。
|
|
6
|
+
|
|
7
|
+
- データを保存して変更を知らせると、その変更に関わる部分(Live View)だけをサーバーが描き直し、開いているすべてのタブに SSE で届けます。
|
|
8
|
+
- ブラウザに送るのは HTML と小さなランタイムだけで、アプリのコードは送りません。ハイドレーションもありません。
|
|
9
|
+
- Action の名前、フォームの項目名、Live View のキーなど、ブラウザが読む名前は型から作るので、打ち間違いは型エラーになります。
|
|
10
|
+
|
|
11
|
+
アプリは Hono で書き、Node、Bun、Cloudflare Workers で動かせます。[Void](https://void.cloud/) を使う場合は、同じ Hono アプリをミドルウェアから組み込めます([Void のサンプル](examples/void/README.md))。
|
|
12
|
+
|
|
13
|
+
| パッケージ | 内容 |
|
|
14
|
+
| --------------------- | --------------------------------------------------------------------------- |
|
|
15
|
+
| `hypersig-ts` | Hono のアダプター |
|
|
16
|
+
| `hypersig-ts/core` | 描画と通信を自分で組み合わせるための中核 |
|
|
17
|
+
| `hypersig-ts/element` | カスタム要素の宣言と、ブラウザ側の実装(Hono にも React にも依存しない) |
|
|
18
|
+
| `hypersig-ts/react` | React の部品をカスタム要素として載せる(`react` と `react-dom` ^19 が必要) |
|
|
19
|
+
| `hypersig-ts/redis` | Redis の Pub/Sub でプロセスの間に発行を届ける(クライアントはアプリが渡す) |
|
|
20
|
+
|
|
21
|
+
[日本語ドキュメント](https://imaimai17468.github.io/hypersig-ts/ja/) · [English documentation](https://imaimai17468.github.io/hypersig-ts/) · [htmx からの移行](https://imaimai17468.github.io/hypersig-ts/ja/from-htmx/)
|
|
22
|
+
|
|
23
|
+
> **安定性:** 0.x の間は、マイナーバージョンでも互換性のない変更が入ることがあります。[CHANGELOG](CHANGELOG.md) を確認してください。
|
|
24
|
+
|
|
25
|
+
## インストール
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
npm install hypersig-ts hono
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
ESM のみで、Node `^22.22.2 || ^24.15.0 || >=26.0.0` または Bun で動きます。
|
|
32
|
+
|
|
33
|
+
## クイックスタート
|
|
34
|
+
|
|
35
|
+
開いているすべてのタブで値が更新されるカウンターです。入力の検証には [Standard Schema](https://standardschema.dev/) に対応したライブラリを使います。この例では Valibot(`npm install valibot`)を使います。
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
import { readFile } from "node:fs/promises";
|
|
39
|
+
import { Hono } from "hono";
|
|
40
|
+
import {
|
|
41
|
+
connectionStatusOutlet,
|
|
42
|
+
createHypersig,
|
|
43
|
+
createMemoryPubSub,
|
|
44
|
+
errorOutlet,
|
|
45
|
+
topic,
|
|
46
|
+
} from "hypersig-ts";
|
|
47
|
+
import * as v from "valibot";
|
|
48
|
+
|
|
49
|
+
const counterChanged = topic("counter", () => "main");
|
|
50
|
+
let count = 0;
|
|
51
|
+
|
|
52
|
+
const hypersig = createHypersig({
|
|
53
|
+
origin: "http://localhost:3000",
|
|
54
|
+
pubsub: createMemoryPubSub<ReturnType<typeof counterChanged>>(),
|
|
55
|
+
// 実際のセッションの読み取りに置き換え、セッションごとに別の id を返します。
|
|
56
|
+
authenticate: () => ({ sessionId: "demo" }),
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
const increment = hypersig.action("increment", {
|
|
60
|
+
input: v.object({}),
|
|
61
|
+
output: v.number(),
|
|
62
|
+
authorize: () => true,
|
|
63
|
+
async execute() {
|
|
64
|
+
count += 1;
|
|
65
|
+
await hypersig.publish(counterChanged());
|
|
66
|
+
return count;
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
const counter = hypersig.live({
|
|
71
|
+
name: "counter",
|
|
72
|
+
subscribe: () => [counterChanged()],
|
|
73
|
+
authorize: () => true,
|
|
74
|
+
load: () => count,
|
|
75
|
+
render: (value) => (
|
|
76
|
+
<p>
|
|
77
|
+
<output>{value}</output>
|
|
78
|
+
<button type="button" {...increment.bind({})}>
|
|
79
|
+
Increment
|
|
80
|
+
</button>
|
|
81
|
+
</p>
|
|
82
|
+
),
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
const app = new Hono();
|
|
86
|
+
app.route("/", hypersig.routes);
|
|
87
|
+
app.get("/runtime.js", async (c) =>
|
|
88
|
+
c.body(
|
|
89
|
+
await readFile(new URL(import.meta.resolve("hypersig-ts/runtime.js"))),
|
|
90
|
+
{
|
|
91
|
+
headers: { "Content-Type": "text/javascript; charset=utf-8" },
|
|
92
|
+
}
|
|
93
|
+
)
|
|
94
|
+
);
|
|
95
|
+
app.get("/", (c) =>
|
|
96
|
+
hypersig.page(c.req.raw, (page) => (
|
|
97
|
+
<html lang="en">
|
|
98
|
+
<head>
|
|
99
|
+
<meta charset="utf-8" />
|
|
100
|
+
<title>Counter</title>
|
|
101
|
+
{page.runtime("/runtime.js")}
|
|
102
|
+
</head>
|
|
103
|
+
<body>
|
|
104
|
+
{page.view(counter, {})}
|
|
105
|
+
<p role="status" {...connectionStatusOutlet()}></p>
|
|
106
|
+
<p role="alert" {...errorOutlet()}></p>
|
|
107
|
+
</body>
|
|
108
|
+
</html>
|
|
109
|
+
))
|
|
110
|
+
);
|
|
111
|
+
|
|
112
|
+
export default app;
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
`export default app` で Bun が配信します。Node では `@hono/node-server` の `serve()` に `app` を渡します。すべての Action はリクエストの `Origin` ヘッダーを `origin` と照合するので、`origin` にはブラウザが使う公開オリジンを設定します。あるタブで **Increment** を押すと、すべてのタブの値が更新されます。セッション、フォーム、Signal、配備については[はじめる](https://imaimai17468.github.io/hypersig-ts/ja/start/)と [API リファレンス](https://imaimai17468.github.io/hypersig-ts/ja/reference/)を参照してください。
|
|
116
|
+
|
|
117
|
+
## リポジトリのセットアップ
|
|
118
|
+
|
|
119
|
+
mise を使って、リポジトリが指定する Bun と Node を用意します。
|
|
120
|
+
|
|
121
|
+
```sh
|
|
122
|
+
mise install
|
|
123
|
+
mise exec -- bun install --frozen-lockfile
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## サンプルを動かす
|
|
127
|
+
|
|
128
|
+
```sh
|
|
129
|
+
mise exec -- bun run example:counter
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
`http://127.0.0.1:3000` を2つのタブで開き、片方で **Increment main** を押すと、両方のカウンターが更新されます。[Counter の実装](examples/counter/server.tsx)
|
|
133
|
+
|
|
134
|
+
| サンプル | 起動コマンド | 見どころ |
|
|
135
|
+
| ------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
|
|
136
|
+
| [TodoMVC](examples/todomvc/server.tsx) | `mise exec -- bun run example:todomvc` | 押した操作がすぐ処理中として表示され、値は確定してから変わる |
|
|
137
|
+
| [共有メモ](examples/shared-memo/server.tsx) | `mise exec -- bun run example:memo` | 編集元の版と下書きの復元を、手書きの JavaScript なしで書く |
|
|
138
|
+
| [レビュー](examples/rating/server.tsx) | `mise exec -- bun run example:rating` | カスタム要素の属性とイベントを型で書き、Live View の更新で子を残す |
|
|
139
|
+
| [並べ替え](examples/sortable/server.tsx) | `mise exec -- bun run example:sortable` | React と dnd-kit の部品をカスタム要素として載せ、並べ替えを保存する |
|
|
140
|
+
| [部品](examples/widgets/server.tsx) | `mise exec -- bun run example:widgets` | コンボボックス、タブ、開閉パネル、文字数カウンター、トーストを Signal の文だけで書き、お気に入りボタンで自分の操作を未確定のまま見せる |
|
|
141
|
+
| [Void](examples/void/README.md) | `cd examples/void && mise exec -- bun install && mise exec -- bun run dev` | 同じ Hono アプリを Void のミドルウェアから組み込み、Workers にも配備する |
|
|
142
|
+
|
|
143
|
+
Counter と同時に起動する場合は、どちらかに `PORT=3001` を設定します。[Void での起動手順](examples/void/README.md) · [Workers への配備例](examples/void/worker/README.md)
|
|
144
|
+
|
|
145
|
+
## 開発コマンド
|
|
146
|
+
|
|
147
|
+
mise をシェルで有効にしていない場合は、コマンドの前に `mise exec --` を付けます。
|
|
148
|
+
|
|
149
|
+
| コマンド | 内容 |
|
|
150
|
+
| ---------------------- | ---------------------------------------------------- |
|
|
151
|
+
| `bun run format:fix` | フォーマットを修正 |
|
|
152
|
+
| `bun run check` | フォーマット、lint、型を検査 |
|
|
153
|
+
| `bun run test` | Vitest と jsdom でテストを実行 |
|
|
154
|
+
| `bun run test:browser` | サンプルを起動し、Playwright で操作して確かめる |
|
|
155
|
+
| `bun run test:outbox` | 共有メモの SQLite Outbox を検証 |
|
|
156
|
+
| `bun run build` | ESM、型定義、ブラウザ用 JavaScript を `dist/` に出力 |
|
|
157
|
+
|
|
158
|
+
ブラウザテストを初めて動かすときは、`mise exec -- node node_modules/@playwright/test/cli.js install chromium` で Chromium を入れます。
|
|
159
|
+
|
|
160
|
+
## ライセンス
|
|
161
|
+
|
|
162
|
+
[ISC](LICENSE)
|
|
163
|
+
|
|
164
|
+
[開発ルール](AGENTS.md) · [設計の詳細](docs/architecture.md) · [性能計測と再現手順](bench/README.md)
|
package/README.md
CHANGED
|
@@ -1,3 +1,164 @@
|
|
|
1
|
-
#
|
|
1
|
+
# hypersig.ts
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[日本語](README.ja.md)
|
|
4
|
+
|
|
5
|
+
hypersig.ts is a TypeScript web framework that keeps server-rendered pages in step with the data you have saved.
|
|
6
|
+
|
|
7
|
+
- When you save data and announce the change, the server re-renders only the parts of the page that depend on it (Live Views) and streams them to every open tab over SSE.
|
|
8
|
+
- The browser receives HTML and a small runtime, never your application code. There is no hydration.
|
|
9
|
+
- The names the browser acts on, such as Action names, form field names, and Live View keys, come from types, so a typo is a type error.
|
|
10
|
+
|
|
11
|
+
You write the app with Hono and run it on Node, Bun, or Cloudflare Workers. With [Void](https://void.cloud/), the same Hono app plugs in through a middleware ([Void example](examples/void/README.md)).
|
|
12
|
+
|
|
13
|
+
| Package | What it is |
|
|
14
|
+
| --------------------- | ------------------------------------------------------------------------------------------ |
|
|
15
|
+
| `hypersig-ts` | The Hono adapter |
|
|
16
|
+
| `hypersig-ts/core` | The core, for combining rendering and transport yourself |
|
|
17
|
+
| `hypersig-ts/element` | Custom element declarations and their browser implementation (no Hono or React dependency) |
|
|
18
|
+
| `hypersig-ts/react` | Mounts React components as custom elements (needs `react` and `react-dom` ^19) |
|
|
19
|
+
| `hypersig-ts/redis` | Delivers publications between processes through Redis Pub/Sub (bring your own client) |
|
|
20
|
+
|
|
21
|
+
[English documentation](https://imaimai17468.github.io/hypersig-ts/) · [日本語ドキュメント](https://imaimai17468.github.io/hypersig-ts/ja/) · [Migrating from htmx](https://imaimai17468.github.io/hypersig-ts/from-htmx/)
|
|
22
|
+
|
|
23
|
+
> **Stability:** 0.x: minor versions may contain breaking changes; see [CHANGELOG](CHANGELOG.md).
|
|
24
|
+
|
|
25
|
+
## Install
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
npm install hypersig-ts hono
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
The package is ESM only and needs Node `^22.22.2 || ^24.15.0 || >=26.0.0` or Bun.
|
|
32
|
+
|
|
33
|
+
## Quick start
|
|
34
|
+
|
|
35
|
+
A counter that updates in every open tab. Input is validated with any [Standard Schema](https://standardschema.dev/) library; this example uses Valibot (`npm install valibot`).
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
import { readFile } from "node:fs/promises";
|
|
39
|
+
import { Hono } from "hono";
|
|
40
|
+
import {
|
|
41
|
+
connectionStatusOutlet,
|
|
42
|
+
createHypersig,
|
|
43
|
+
createMemoryPubSub,
|
|
44
|
+
errorOutlet,
|
|
45
|
+
topic,
|
|
46
|
+
} from "hypersig-ts";
|
|
47
|
+
import * as v from "valibot";
|
|
48
|
+
|
|
49
|
+
const counterChanged = topic("counter", () => "main");
|
|
50
|
+
let count = 0;
|
|
51
|
+
|
|
52
|
+
const hypersig = createHypersig({
|
|
53
|
+
origin: "http://localhost:3000",
|
|
54
|
+
pubsub: createMemoryPubSub<ReturnType<typeof counterChanged>>(),
|
|
55
|
+
// Replace with your own session lookup. Give every session its own id.
|
|
56
|
+
authenticate: () => ({ sessionId: "demo" }),
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
const increment = hypersig.action("increment", {
|
|
60
|
+
input: v.object({}),
|
|
61
|
+
output: v.number(),
|
|
62
|
+
authorize: () => true,
|
|
63
|
+
async execute() {
|
|
64
|
+
count += 1;
|
|
65
|
+
await hypersig.publish(counterChanged());
|
|
66
|
+
return count;
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
const counter = hypersig.live({
|
|
71
|
+
name: "counter",
|
|
72
|
+
subscribe: () => [counterChanged()],
|
|
73
|
+
authorize: () => true,
|
|
74
|
+
load: () => count,
|
|
75
|
+
render: (value) => (
|
|
76
|
+
<p>
|
|
77
|
+
<output>{value}</output>
|
|
78
|
+
<button type="button" {...increment.bind({})}>
|
|
79
|
+
Increment
|
|
80
|
+
</button>
|
|
81
|
+
</p>
|
|
82
|
+
),
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
const app = new Hono();
|
|
86
|
+
app.route("/", hypersig.routes);
|
|
87
|
+
app.get("/runtime.js", async (c) =>
|
|
88
|
+
c.body(
|
|
89
|
+
await readFile(new URL(import.meta.resolve("hypersig-ts/runtime.js"))),
|
|
90
|
+
{
|
|
91
|
+
headers: { "Content-Type": "text/javascript; charset=utf-8" },
|
|
92
|
+
}
|
|
93
|
+
)
|
|
94
|
+
);
|
|
95
|
+
app.get("/", (c) =>
|
|
96
|
+
hypersig.page(c.req.raw, (page) => (
|
|
97
|
+
<html lang="en">
|
|
98
|
+
<head>
|
|
99
|
+
<meta charset="utf-8" />
|
|
100
|
+
<title>Counter</title>
|
|
101
|
+
{page.runtime("/runtime.js")}
|
|
102
|
+
</head>
|
|
103
|
+
<body>
|
|
104
|
+
{page.view(counter, {})}
|
|
105
|
+
<p role="status" {...connectionStatusOutlet()}></p>
|
|
106
|
+
<p role="alert" {...errorOutlet()}></p>
|
|
107
|
+
</body>
|
|
108
|
+
</html>
|
|
109
|
+
))
|
|
110
|
+
);
|
|
111
|
+
|
|
112
|
+
export default app;
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
`export default app` serves the app on Bun. On Node, pass `app` to `serve()` from `@hono/node-server`. Set `origin` to the public origin the browser uses, because every Action compares it with the request's `Origin` header. Pressing **Increment** in one tab updates the count in all of them. See [Get started](https://imaimai17468.github.io/hypersig-ts/start/) and the [API reference](https://imaimai17468.github.io/hypersig-ts/reference/) for sessions, forms, Signals, and deployment.
|
|
116
|
+
|
|
117
|
+
## Set up the repository
|
|
118
|
+
|
|
119
|
+
Use mise to install the Bun and Node versions the repository pins.
|
|
120
|
+
|
|
121
|
+
```sh
|
|
122
|
+
mise install
|
|
123
|
+
mise exec -- bun install --frozen-lockfile
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Run the examples
|
|
127
|
+
|
|
128
|
+
```sh
|
|
129
|
+
mise exec -- bun run example:counter
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Open `http://127.0.0.1:3000` in two tabs and press **Increment main** in one of them; both counters update. [Counter source](examples/counter/server.tsx)
|
|
133
|
+
|
|
134
|
+
| Example | Command | What it shows |
|
|
135
|
+
| ---------------------------------------------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
136
|
+
| [TodoMVC](examples/todomvc/server.tsx) | `mise exec -- bun run example:todomvc` | An action shows as pending at once, and values change once they are committed |
|
|
137
|
+
| [Shared memo](examples/shared-memo/server.tsx) | `mise exec -- bun run example:memo` | The revision an edit started from and draft restoration, with no hand-written JavaScript |
|
|
138
|
+
| [Reviews](examples/rating/server.tsx) | `mise exec -- bun run example:rating` | Typed attributes and events on a custom element, whose children survive Live View updates |
|
|
139
|
+
| [Sortable](examples/sortable/server.tsx) | `mise exec -- bun run example:sortable` | A React and dnd-kit component mounted as a custom element, saving the new order |
|
|
140
|
+
| [Widgets](examples/widgets/server.tsx) | `mise exec -- bun run example:widgets` | A combobox, tabs, a disclosure panel, a character counter, and a toast, with Signals alone, and a favorite button that shows the click as pending |
|
|
141
|
+
| [Void](examples/void/README.md) | `cd examples/void && mise exec -- bun install && mise exec -- bun run dev` | The same Hono app plugged into Void through a middleware, also deployed to Workers |
|
|
142
|
+
|
|
143
|
+
To run one alongside Counter, set `PORT=3001` on one of them. [Running on Void](examples/void/README.md) · [Deploying to Workers](examples/void/worker/README.md)
|
|
144
|
+
|
|
145
|
+
## Development commands
|
|
146
|
+
|
|
147
|
+
If mise is not activated in your shell, prefix each command with `mise exec --`.
|
|
148
|
+
|
|
149
|
+
| Command | What it does |
|
|
150
|
+
| ---------------------- | -------------------------------------------------------------- |
|
|
151
|
+
| `bun run format:fix` | Fix formatting |
|
|
152
|
+
| `bun run check` | Check formatting, lint, and types |
|
|
153
|
+
| `bun run test` | Run the tests with Vitest and jsdom |
|
|
154
|
+
| `bun run test:browser` | Start the examples and drive them with Playwright |
|
|
155
|
+
| `bun run test:outbox` | Verify the shared memo's SQLite outbox |
|
|
156
|
+
| `bun run build` | Emit ESM, type declarations, and browser JavaScript to `dist/` |
|
|
157
|
+
|
|
158
|
+
Before running the browser tests for the first time, install Chromium with `mise exec -- node node_modules/@playwright/test/cli.js install chromium`.
|
|
159
|
+
|
|
160
|
+
## License
|
|
161
|
+
|
|
162
|
+
[ISC](LICENSE)
|
|
163
|
+
|
|
164
|
+
[Development rules](AGENTS.md) · [Architecture (Japanese)](docs/architecture.md) · [Benchmarks and reproduction steps (Japanese)](bench/README.md)
|
package/dist/action.d.ts
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import type { StandardJSONSchemaV1, StandardSchemaV1 } from "@standard-schema/spec";
|
|
2
|
+
import type { Hono } from "hono";
|
|
3
|
+
import type { Principal } from "./live.js";
|
|
4
|
+
import type { JsonValue, StmtNode } from "./protocol.js";
|
|
5
|
+
import { outletAttributes } from "./protocol.js";
|
|
6
|
+
import type { Expr } from "./signal.js";
|
|
7
|
+
export type { JsonValue } from "./protocol.js";
|
|
8
|
+
type MaybePromise<Value> = Value | Promise<Value>;
|
|
9
|
+
export interface ActionIssue {
|
|
10
|
+
message: string;
|
|
11
|
+
field?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare class ActionError extends Error {
|
|
14
|
+
readonly status: 400 | 409 | 422;
|
|
15
|
+
constructor(status: 400 | 409 | 422, message: string);
|
|
16
|
+
}
|
|
17
|
+
export type ActionFormResult<Output> = {
|
|
18
|
+
type: "success";
|
|
19
|
+
data: Output;
|
|
20
|
+
} | {
|
|
21
|
+
type: "invalid";
|
|
22
|
+
values: FormData;
|
|
23
|
+
issues: readonly ActionIssue[];
|
|
24
|
+
} | {
|
|
25
|
+
type: "rejected";
|
|
26
|
+
values: FormData;
|
|
27
|
+
error: ActionError;
|
|
28
|
+
};
|
|
29
|
+
/** Attributes for an input element, derived from the input schema. */
|
|
30
|
+
export interface FieldControl<Name extends string> {
|
|
31
|
+
name: Name;
|
|
32
|
+
required?: true;
|
|
33
|
+
minLength?: number;
|
|
34
|
+
maxLength?: number;
|
|
35
|
+
pattern?: string;
|
|
36
|
+
min?: number;
|
|
37
|
+
max?: number;
|
|
38
|
+
}
|
|
39
|
+
export interface JsonSchemaOptions {
|
|
40
|
+
/** Passed to the schema library when it converts an input schema. */
|
|
41
|
+
libraryOptions?: Record<string, unknown>;
|
|
42
|
+
}
|
|
43
|
+
export interface ActionDefinition<Wire, Input, Value, Output, User extends Principal, Schema = unknown> {
|
|
44
|
+
input: StandardSchemaV1<Wire, Input> & Schema;
|
|
45
|
+
output: StandardSchemaV1<Value, Output>;
|
|
46
|
+
authorize(input: NoInfer<Input>, user: User): MaybePromise<boolean>;
|
|
47
|
+
execute(input: NoInfer<Input>, user: User): MaybePromise<NoInfer<Value>>;
|
|
48
|
+
/** Render or redirect a standard HTML form submission. */
|
|
49
|
+
formResponse?(this: void, result: ActionFormResult<NoInfer<Output>>, request: Request, user: User): MaybePromise<Response>;
|
|
50
|
+
}
|
|
51
|
+
type BindInput<Wire> = [Wire] extends [JsonValue] ? Wire : "This Action's input is not JSON. Submit it with form() instead";
|
|
52
|
+
type CallInput<Wire> = [Wire] extends [JsonValue] ? {
|
|
53
|
+
[K in keyof Wire]: Wire[K] | Expr<Extract<Wire[K], JsonValue>>;
|
|
54
|
+
} : "This Action's input is not JSON. Submit it with form() instead";
|
|
55
|
+
type Statements = StmtNode | readonly StmtNode[];
|
|
56
|
+
export interface CallOptions<Output> extends ResultHandlers<Output> {
|
|
57
|
+
/**
|
|
58
|
+
* `set` statements that show the user's own action until it is committed.
|
|
59
|
+
* They run when the call runs, before its input is evaluated, and the
|
|
60
|
+
* runtime sends nothing when one of their paths has no committed value from
|
|
61
|
+
* a `data-hs-signals` load. A failed request writes each path it still owns
|
|
62
|
+
* back to the latest committed value before `onError` runs; a later call
|
|
63
|
+
* that writes the same path takes it over. A success leaves the value until
|
|
64
|
+
* a Live View brings the committed one, so the Action must publish the Topic
|
|
65
|
+
* that renders it. Only `set` is checked at runtime: any other statement is
|
|
66
|
+
* a `TypeError` here.
|
|
67
|
+
*/
|
|
68
|
+
pending?: Statements;
|
|
69
|
+
}
|
|
70
|
+
/** An Action's output as an expression, or `never` when it is not JSON. */
|
|
71
|
+
type OutputExpr<Output> = [Output] extends [JsonValue] ? Expr<Output> : never;
|
|
72
|
+
export interface ResultHandlers<Output> {
|
|
73
|
+
/** Runs when the Action succeeds. `output` is the Action's output. */
|
|
74
|
+
onSuccess?(this: void, output: OutputExpr<Output>): Statements;
|
|
75
|
+
/** Runs when the Action fails. */
|
|
76
|
+
onError?: Statements;
|
|
77
|
+
}
|
|
78
|
+
type FormFieldName<Input> = Input extends readonly unknown[] ? never : Input extends object ? `${Extract<keyof Input, string | number>}` : never;
|
|
79
|
+
/** `control()` exists only when the input schema converts to JSON Schema. */
|
|
80
|
+
type ControlMethods<Schema, Wire> = Schema extends StandardJSONSchemaV1 ? {
|
|
81
|
+
/**
|
|
82
|
+
* Attributes for the input named `name`, derived from the input schema's
|
|
83
|
+
* JSON Schema: `required`, `minLength`, `maxLength`, `min`, `max`, and
|
|
84
|
+
* `pattern`. None makes the browser stricter than the server:
|
|
85
|
+
* `required` appears only when the schema rejects the empty string, and
|
|
86
|
+
* `pattern` only when it is anchored with `^` and `$`, has no top-level
|
|
87
|
+
* `|`, and is valid under the `v` flag. The schema is converted on the
|
|
88
|
+
* first call; a conversion error names this Action. Only a top-level
|
|
89
|
+
* object schema is read. Anything else yields `name` alone.
|
|
90
|
+
*/
|
|
91
|
+
control<Name extends FormFieldName<Wire>>(name: Name): FieldControl<Name>;
|
|
92
|
+
} : unknown;
|
|
93
|
+
declare function createActionMethods<Wire, Output>(url: string, name: string): {
|
|
94
|
+
url: string;
|
|
95
|
+
/** Sends the input as JSON, so the schema's input type must be JSON. */
|
|
96
|
+
bind(input: BindInput<Wire>): {
|
|
97
|
+
"data-hs-action": string;
|
|
98
|
+
"data-hs-input": string;
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* A statement that sends the input, evaluating signal values in the
|
|
102
|
+
* browser when it runs. The input type must be JSON.
|
|
103
|
+
*/
|
|
104
|
+
call(input: CallInput<Wire>, options?: CallOptions<Output>): StmtNode;
|
|
105
|
+
/** True in the browser while a request to this Action is in flight. */
|
|
106
|
+
pending(): Expr<boolean>;
|
|
107
|
+
/** True in the browser when a saved draft was restored for this Action. */
|
|
108
|
+
draftRestored(): Expr<boolean>;
|
|
109
|
+
/** Check a top-level HTML field name against the schema's input type. */
|
|
110
|
+
field<Name extends FormFieldName<Wire>>(name: Name): Name;
|
|
111
|
+
/**
|
|
112
|
+
* Marks the element inside this Action's form that shows the schema's
|
|
113
|
+
* message for one field after a failed submission.
|
|
114
|
+
*/
|
|
115
|
+
fieldError<Name extends FormFieldName<Wire>>(name: Name): {
|
|
116
|
+
[outletAttributes.fieldError]: Name;
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* Names a field and keeps its value across a live registration reset. The
|
|
120
|
+
* draft is restored only into a form created with `form({ draft: true })`.
|
|
121
|
+
*/
|
|
122
|
+
draft<Name extends FormFieldName<Wire>>(name: Name): {
|
|
123
|
+
name: Name;
|
|
124
|
+
"data-hs-draft": "";
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* `draft` keys the saved draft by this Action's name. When two forms on a
|
|
128
|
+
* page set it for the same Action, only the first one keeps its draft.
|
|
129
|
+
*/
|
|
130
|
+
form(options?: ResultHandlers<Output> & {
|
|
131
|
+
resetOnSuccess?: boolean;
|
|
132
|
+
reportSuccess?: boolean;
|
|
133
|
+
draft?: boolean;
|
|
134
|
+
/** Runs in the browser, before the submit request is sent. */
|
|
135
|
+
onSubmit?: Statements;
|
|
136
|
+
}): {
|
|
137
|
+
action: string;
|
|
138
|
+
method: "post";
|
|
139
|
+
"data-hs-form": string;
|
|
140
|
+
"data-hs-reset-on-success"?: string;
|
|
141
|
+
"data-hs-action-result"?: string;
|
|
142
|
+
"data-hs-draft-form"?: string;
|
|
143
|
+
"data-hs-on-success"?: string;
|
|
144
|
+
"data-hs-on-error"?: string;
|
|
145
|
+
"data-hs-on-submit"?: string;
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
export declare function registerAction<Wire, Input, Value, Output, User extends Principal, Schema = unknown>(routes: Hono, basePath: string, name: string, origin: string, authenticate: (request: Request) => MaybePromise<User | null>, definition: ActionDefinition<Wire, Input, Value, Output, User, Schema>, jsonSchema?: JsonSchemaOptions): ReturnType<typeof createActionMethods<Wire, Output>> & ControlMethods<Schema, Wire>;
|
|
149
|
+
//# sourceMappingURL=action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../src/action.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,gBAAgB,EACjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAEjC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,KAAK,EAAY,SAAS,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAEL,gBAAgB,EAEjB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAGxC,YAAY,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE/C,KAAK,YAAY,CAAC,KAAK,IAAI,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;AAElD,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,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