0.4.0 release prep: ship FORMAT.md, presence docs, error hygiene - #10
Merged
Conversation
- Ship the spec: add FORMAT.md and pacts/ to the npm tarball so README links resolve from node_modules (files was bin+dist only). - Document the ./presence-awareness export with a runnable README example, executed by check-readme-examples like every other fenced block. - lync sync against a dead relay printed 'socket error from ws://...:' with an empty reason (Node ErrorEvent.message can be ""). New socketErrorReason falls back to the underlying error's message, code (e.g. ECONNREFUSED), or name, and never returns empty. Covered by a dead-relay integration test and unit tests. - README status line: format is a v0 draft, envelope v:1 is stable. - README 'Why not Yjs / Automerge?' section grounded in FORMAT.md's actual argument (immutable events, union by id, no merge logic).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pre-publish fixes for the 0.4.0 npm release, from a cold-read of the package as a stranger would install it. Prep only — do not merge or publish without the owner's call.
1. Ship the spec in the tarball
fileswas["bin", "dist"], so the README's links to FORMAT.md and pacts/*.md were dead fromnode_modules. AddedFORMAT.mdandpactstofiles.npm pack --dry-run(dist/* elided — 136 files, unchanged):2. Document
./presence-awarenessThe export existed with no README surface. New "Presence: who is here right now" section with a runnable example (two awareness instances wired to each other; the SyncedStore wiring is stated in prose), plus a line in Subpath exports. The example carries no
fragmentdirective, socheck-readme-examplesexecutes it inpnpm verifyand CI — it runs as example 6.3. Non-empty socket error reason
lync syncagainst a dead relay printedsocket error from ws://...:with nothing after the colon — Node's built-in WebSocket fires an ErrorEvent whosemessagecan be the empty string. NewsocketErrorReasoninsrc/cli/sync.tsfalls back to the underlying error's message, then itscode(e.g.ECONNREFUSED), then its name, and never returns empty. Covered by a dead-relay integration test (relay started, port noted, relay killed, sync attempted) asserting the reason after the colon is non-empty, plus unit tests over every event shape.4. README status line
Top of the README now states: format is a v0 draft (matching FORMAT.md's own status line), envelope
v:1is stable.5. "Why not Yjs / Automerge?"
Short honest section grounded in FORMAT.md's actual argument: events are immutable so there is no concurrent-mutation problem; merge is set union by id with no merge logic; same-id-different-bytes is surfaced, not resolved; CRDTs solve a different problem and are the right choice when state mutates. Notes that presence uses LWW clocks, not a CRDT.
Verification
pnpm test: 21 test files, 125 tests, all passed (includes the 2 new socket-error tests).pnpm verify(path guard + tests + build + typecheck + README examples): passed. Examples: 9 executed (including the new presence example), 4 skipped as declared fragments.npm pack --dry-run: file list above; FORMAT.md and all four pacts included.