Skip to content

Commit 9829d41

Browse files
committed
Update module sizes and clarify snapshot/sync attribute docs
1 parent 80b6dee commit 9829d41

3 files changed

Lines changed: 21 additions & 20 deletions

File tree

‎README.md‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ To load a full preset, use the CDN loader with `?preset=standard`:
6767
| edit-mode-helpers | 6.8KB | Admin-only functionality: [viewmode:disabled], [editmode:resource], [editmode:onclick] |
6868
| option-visibility | 9.2KB | Dynamic show/hide based on ancestor state with option:attribute="value" |
6969
| persist | 5KB | Persist input/select/textarea values to the DOM with [persist] attribute |
70-
| save-core | 16.6KB | Basic save function only - hyperclay.savePage() |
70+
| save-core | 18.9KB | Basic save function only - hyperclay.savePage() |
7171
| save-system | 19.8KB | CMD+S, [trigger-save] button, savestatus attribute |
7272
| save-toast | 1KB | Toast notifications for save events |
73-
| snapshot | 14.3KB | Source of truth for page state - captures DOM snapshots for save and sync |
73+
| snapshot | 14.7KB | Source of truth for page state - captures DOM snapshots for save and sync |
7474
| unsaved-warning | 1.3KB | Warn before leaving page with unsaved changes |
7575

7676
### Custom Attributes (HTML enhancements)
@@ -153,27 +153,27 @@ To load a full preset, use the CDN loader with `?preset=standard`:
153153

154154
## Presets
155155

156-
### Minimal (~76.2KB)
156+
### Minimal (~78.9KB)
157157
Essential features for basic editing
158158

159159
**Modules:** `save-core`, `snapshot`, `save-system`, `edit-mode-helpers`, `toast`, `save-toast`, `export-to-window`, `view-mode-excludes-edit-modules`
160160

161-
### Standard (~125.2KB)
161+
### Standard (~127.9KB)
162162
Standard feature set for most use cases
163163

164164
**Modules:** `save-core`, `snapshot`, `save-system`, `unsaved-warning`, `edit-mode-helpers`, `persist`, `option-visibility`, `event-attrs`, `dom-helpers`, `data`, `data-loss-panel`, `toast`, `save-toast`, `export-to-window`, `view-mode-excludes-edit-modules`
165165

166-
### CMS (~331.8KB)
166+
### CMS (~334.5KB)
167167
Visual CMS editing for rules-tag pages: hypercms sidebar, undo, drag-reorder, save
168168

169169
**Modules:** `save-core`, `snapshot`, `save-system`, `unsaved-warning`, `toast`, `save-toast`, `mutation`, `hypercms`, `sortable`, `undo`, `quickcrop`, `data-loss-panel`, `export-to-window`, `view-mode-excludes-edit-modules`
170170

171-
### Smooth Sailing (~659.2KB)
171+
### Smooth Sailing (~661.9KB)
172172
Everything, without gotchas
173173

174174
**Modules:** `save-core`, `save-system`, `unsaved-warning`, `save-toast`, `edit-mode-helpers`, `persist`, `snapshot`, `option-visibility`, `edit-mode`, `event-attrs`, `ajax-elements`, `sortable`, `movable`, `dom-helpers`, `input-helpers`, `onaftersave`, `save-freeze`, `dialogs`, `quickcrop`, `toast`, `the-modal`, `data-loss-panel`, `mutation`, `nearest`, `cookie`, `throttle`, `debounce`, `dom-ready`, `window-load`, `all-js`, `style-injection`, `form-data`, `hypercms`, `richclay`, `undo`, `data`, `upgrade`, `slugify`, `copy-to-clipboard`, `query-params`, `behavior-collector`, `send-message`, `file-upload`, `live-sync`, `refetch-on-save`, `export-to-window`, `view-mode-excludes-edit-modules`
175175

176-
### Everything (~773.2KB)
176+
### Everything (~775.9KB)
177177
All available features
178178

179179
Includes all available modules across all categories.

‎module-dependency-graph.generated.json‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
"core/host-attrs.js"
8282
],
8383
"core/isAdminOfCurrentResource.js": [
84+
"core/host-attrs.js",
8485
"string-utilities/query.js",
8586
"utilities/cookie.js"
8687
],
@@ -253,7 +254,7 @@
253254
"save-core": {
254255
"name": "save-core",
255256
"category": "core",
256-
"size": 16.6,
257+
"size": 18.9,
257258
"isEditModeOnly": true,
258259
"files": [
259260
"core/savePageCore.js"
@@ -359,7 +360,7 @@
359360
"snapshot": {
360361
"name": "snapshot",
361362
"category": "core",
362-
"size": 14.3,
363+
"size": 14.7,
363364
"isEditModeOnly": true,
364365
"files": [
365366
"core/snapshot.js"

‎website/llms.txt‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ In `standard`, `cms`, `smooth-sailing`, and `everything`. Not in `minimal`. It a
563563
- 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.
564564
- A user choice POSTs to `POST /_/data-loss/<id>` with `{ choice, file }`. Restore and revert reload the page (~350ms) after success.
565565
- On init it also calls `initUserGesture()` (so save provenance is correct even in presets without autosave) and `Mutation.ensureObserving()`.
566-
- The chip's root carries `no-save` and `snapshot-remove`, so it never reaches a saved file. Feedback uses `window.toast`.
566+
- 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`.
567567

568568
## Requirements
569569

@@ -1387,7 +1387,7 @@ insertStyles('/styles/theme.css', (link) => { link.media = 'print'; });
13871387

13881388
# live-sync
13891389

1390-
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.
1390+
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.
13911391

13921392
## Access
13931393

@@ -1404,7 +1404,7 @@ Real-time DOM sync across browsers via SSE. When one user saves, all connected b
14041404

14051405
| Name | Type | Default | Description |
14061406
|------|------|---------|-------------|
1407-
| 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 |
1407+
| 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 |
14081408

14091409
## Example
14101410

@@ -2700,15 +2700,15 @@ In every preset: `minimal`, `standard`, `smooth-sailing`, and `everything`. The
27002700

27012701
```
27022702
1. CLONE document.documentElement.cloneNode(true)
2703-
2. SNAPSHOT onSnapshot hooks + [onbeforesnapshot] + [snapshot-remove] + extension-noise strip
2703+
2. SNAPSHOT onSnapshot hooks + [onbeforesnapshot] + [no-snapshot] + extension-noise strip
27042704
├─ used by SAVE and LIVE-SYNC
27052705
└─ emits hyperclay:snapshot-ready
2706-
3. PREPARE [onbeforesave] + [no-save] + onPrepareForSave hooks
2706+
3. PREPARE [onbeforesave] + onPrepareForSave hooks + [no-save]
27072707
└─ used by SAVE only (live-sync stops at step 2)
27082708
4. SERIALIZE "<!DOCTYPE html>" + clone.outerHTML → sent to server
27092709
```
27102710

2711-
`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.
2711+
`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.
27122712

27132713
## Hooks
27142714

@@ -2724,7 +2724,7 @@ Each callback receives the cloned `<html>` element (`HTMLElement`) and mutates i
27242724

27252725
| Function | Returns | Description |
27262726
|----------|---------|-------------|
2727-
| `captureSnapshot()` | `HTMLElement` | Clones `<html>`, runs `onSnapshot` hooks, `[onbeforesnapshot]`, `[snapshot-remove]`, and strips extension noise. Nothing save-specific stripped yet |
2727+
| `captureSnapshot()` | `HTMLElement` | Clones `<html>`, runs `onSnapshot` hooks, `[onbeforesnapshot]`, `[no-snapshot]`, and strips extension noise. Nothing save-specific stripped yet |
27282728
| `captureForSave({ emitForSync = true })` | `string` | Full save pipeline. Emits `hyperclay:snapshot-ready`, then runs prepare phase. Returns `"<!DOCTYPE html>" + outerHTML` |
27292729
| `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` |
27302730
| `captureForSaveAndComparison({ emitForSync = true })` | `{ forSave, forComparison }` | Single clone, then forks into a save string and a comparison string. Cheaper than calling both separately |
@@ -2746,7 +2746,7 @@ These markup hooks are processed during capture. Inline attribute handlers run v
27462746
| Attribute | Phase | Effect |
27472747
|-----------|-------|--------|
27482748
| `onbeforesnapshot` | snapshot (save + sync) | Inline JS runs on the cloned element before any stripping |
2749-
| `snapshot-remove` | snapshot (save + sync) | Element is removed from every snapshot, so it never reaches a save, a comparison, or a live-sync broadcast |
2749+
| `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`) |
27502750
| `onbeforesave` | prepare (save + compare) | Inline JS runs on the cloned element before save-specific stripping |
27512751
| `no-save` | prepare (save + compare) | Element is removed from the saved HTML entirely (legacy alias: `save-remove`) |
27522752
| `no-trigger-autosave` | comparison only | Element is excluded from dirty-checking but still saved as-is (legacy alias: `save-ignore`) |
@@ -2765,7 +2765,7 @@ When `isCodeMirrorPage()` is true, the capture functions bypass the DOM snapshot
27652765

27662766
## Hyperclay Local
27672767

2768-
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.
2768+
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.
27692769

27702770
## Undo Flush
27712771

@@ -2793,7 +2793,7 @@ const html = captureForSave({ emitForSync: false });
27932793
```html
27942794
<!-- Markup-level hooks -->
27952795
<div onbeforesnapshot="this.dataset.snappedAt = Date.now()">...</div>
2796-
<div snapshot-remove>Never appears in any snapshot</div>
2796+
<div no-snapshot>Never appears in any snapshot</div>
27972797
<button no-save>Hidden from the saved file</button>
27982798
<div no-trigger-autosave>Saved as-is but skipped by dirty-checking</div>
27992799
```
@@ -3173,7 +3173,7 @@ toast('Uploaded successfully');
31733173
## Notes
31743174

31753175
- `message` is inserted as HTML (`innerHTML`), so do not pass untrusted user input.
3176-
- 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.
3176+
- 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.
31773177

31783178
## toastPersistent
31793179

0 commit comments

Comments
 (0)