You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 45f6aae
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: CHANGELOG.md
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,16 @@
1
1
# Changelog
2
2
3
+
## [1.38.0] - 2026-08-29
4
+
5
+
### Breaking Changes
6
+
-**The save token is read under one name, `savetoken`.**`htmlclaytoken`, the pre-rename spelling, is no longer accepted as a credential. This breaks documents served by HTML Clay 1.8.0 or earlier, which inject only the old name: the page stays editable, because that host also sets the edit-mode cookie, and every save posts to the bare `/_/save`, which that host does not route. Upgrade HTML Clay to 1.9.0 or newer, which serves both names. The library says so in the console when it finds the old name. The old name is still stripped from every save and kept out of an incoming morph, because what a host injects must be removed whether or not this library reads it.
7
+
8
+
### Changed
9
+
- Saves send `Document-URL`, the header spec §3 names, alongside the older `Page-URL`. Both Hyperclay hosts read the new name first and fall back to the old one, so nothing changes against them; a third-party host implementing only the specification would have refused every save this library sent.
10
+
11
+
### Fixed
12
+
- A document's durable file identity is no longer read as a save token. `documentid` and `htmlclayid` shared one list with the token spellings, so a document carrying an identity but no token posted to `/_/save/{id}` with credentials omitted and opened in edit mode for every visitor. Identities have their own list now: still stripped before a save, still kept out of an incoming morph, never read as a credential.
Copy file name to clipboardExpand all lines: docs/api/data-loss-panel.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ In `standard`, `cms`, `smooth-sailing`, and `everything`. Not in `minimal`. It a
14
14
- External / cross-device clobbers (another device, a CLI tool, a raw disk edit) produce no `save-saved` here, so on non-livesync presets they surface on the next reload (the page-load `GET`). Hyperclay Local's sync watcher reloads the page on external change, which re-runs that check.
15
15
- A user choice POSTs to `POST /_/data-loss/<id>` with `{ choice, file }`. Restore and revert reload the page (~350ms) after success.
16
16
- On init it also calls `initUserGesture()` (so save provenance is correct even in presets without autosave) and `Mutation.ensureObserving()`.
17
-
- The chip's root carries `no-save` and `snapshot-remove`, so it never reaches a saved file. Feedback uses `window.toast`.
17
+
- The chip's root carries `no-save` and `snapshot-remove`, the legacy alias for `no-snapshot`, so it never reaches a saved file. Feedback uses `window.toast`.
Copy file name to clipboardExpand all lines: docs/api/liveSync.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# live-sync
2
2
3
-
Real-time DOM sync across browsers via SSE. When one user saves, all connected browsers see the changes instantly via HyperMorph. Works with Hyperclay Local app.
3
+
Real-time DOM sync across browsers via SSE. Edit-mode tabs exchange working snapshots on the live lane as changes are captured. View-mode tabs receive durable documents on the saved lane after the host persists them. HyperMorph applies both in place. Works with Hyperclay Local app.
4
4
5
5
## Access
6
6
@@ -17,7 +17,7 @@ Real-time DOM sync across browsers via SSE. When one user saves, all connected b
17
17
18
18
| Name | Type | Default | Description |
19
19
|------|------|---------|-------------|
20
-
| file | string | — | Optional. A presence guard and log label only; it does **not** select the sync channel. The channel is keyed off the page URL (`window.location.href` / the `Page-URL` header). Auto-detected from the pathname when omitted |
20
+
| file | string | — | Optional. A presence guard and log label only; it does **not** select the sync channel. The current page URL selects the channel, sent as `Document-URL` on the spec POST and `document-url` on the spec GET. Older hosts use the discovered legacy wire. Auto-detected from the pathname when omitted |
4. SERIALIZE "<!DOCTYPE html>" + clone.outerHTML → sent to server
33
33
```
34
34
35
-
`captureForComparison` and the compare half of `captureForSaveAndComparison` additionally strip every region whose autosave-trigger is off (`[no-trigger-autosave]`, plus `[no-save]`, `[freeze]`, and `[no-watch]`) so runtime-only elements do not trip dirty-checking. See [region attributes](./region-attributes.md); the legacy `save-*` / `mutations-ignore` markers are recognized as aliases.
35
+
`captureForComparison` and the compare half of `captureForSaveAndComparison` additionally strip every region whose autosave-trigger is off (`[no-trigger-autosave]`, plus `[no-save]`, `[freeze]`, and `[no-watch]`) so runtime-only elements do not trip dirty-checking. See [region attributes](./region-attributes.md); the legacy `save-*`, `mutations-ignore`, and `snapshot-remove` markers are recognized as aliases.
36
36
37
37
## Hooks
38
38
@@ -48,7 +48,7 @@ Each callback receives the cloned `<html>` element (`HTMLElement`) and mutates i
|`captureForSave({ emitForSync = true })`|`string`| Full save pipeline. Emits `hyperclay:snapshot-ready`, then runs prepare phase. Returns `"<!DOCTYPE html>" + outerHTML`|
53
53
|`captureForComparison()`|`string`| Like the save path but also strips every region whose autosave-trigger is off (`[no-trigger-autosave]` and friends). For comparing current state against a baseline. Does not emit `snapshot-ready`|
54
54
|`captureForSaveAndComparison({ emitForSync = true })`|`{ forSave, forComparison }`| Single clone, then forks into a save string and a comparison string. Cheaper than calling both separately |
@@ -70,7 +70,7 @@ These markup hooks are processed during capture. Inline attribute handlers run v
70
70
| Attribute | Phase | Effect |
71
71
|-----------|-------|--------|
72
72
|`onbeforesnapshot`| snapshot (save + sync) | Inline JS runs on the cloned element before any stripping |
73
-
|`snapshot-remove`| snapshot (save + sync) | Element is removed from every snapshot, so it never reaches a save, a comparison, or a live-sync broadcast |
73
+
|`no-snapshot`| snapshot (save + sync) | Element is removed from every snapshot, so it never reaches a save, a comparison, or a live-sync broadcast (legacy alias: `snapshot-remove`)|
74
74
|`onbeforesave`| prepare (save + compare) | Inline JS runs on the cloned element before save-specific stripping |
75
75
|`no-save`| prepare (save + compare) | Element is removed from the saved HTML entirely (legacy alias: `save-remove`) |
76
76
|`no-trigger-autosave`| comparison only | Element is excluded from dirty-checking but still saved as-is (legacy alias: `save-ignore`) |
@@ -89,7 +89,7 @@ When `isCodeMirrorPage()` is true, the capture functions bypass the DOM snapshot
89
89
90
90
## Hyperclay Local
91
91
92
-
On `localhost` / `127.0.0.1`, `captureForSaveAndComparison` stores the full unstripped snapshot HTML on `window.__hyperclaySnapshotHtml`. The save system sends both the stripped content and this full snapshot as JSON so the desktop platform can mirror the page exactly. The value is cleared after each send.
92
+
Saving uses the same two requests on every host. The save system sends the stripped document as text to `/_/save`. When live-sync is loaded, it separately sends the prepared snapshot root as JSON to `/_/sync`, or to the discovered legacy relay on an older host.
Copy file name to clipboardExpand all lines: docs/api/toast.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,7 +35,7 @@ toast('Uploaded successfully');
35
35
## Notes
36
36
37
37
-`message` is inserted as HTML (`innerHTML`), so do not pass untrusted user input.
38
-
- A toast auto-dismisses after ~6.6s and is also click-to-dismiss. Its container and styles carry `save-remove`/`snapshot-remove`, so they never reach a saved file.
38
+
- A toast auto-dismisses after ~6.6s and is also click-to-dismiss. Its container and styles use the legacy `save-remove` and `snapshot-remove` aliases for `no-save` and `no-snapshot`, so they never reach a saved file.
0 commit comments