Repository navigation
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the Resource API documentation and release notes for version 5.4.0, detailing that only assigned or changed properties are written, in-place modifications to Date and Bytes objects are no longer tracked, and repeated addTo and subtractFrom calls (which now support bigint) combine within a transaction. The review feedback points out several instances where the component is used at the start of a paragraph in running prose, recommending replacing it with plain text (e.g., 'As of v5.4.0') to improve readability and consistency.
…mbine Covers HarperFast/harper#3586: reads are not writes, Date/Bytes must be reassigned, undeclared properties save on non-sealed tables, repeated addTo/subtractFrom calls compose, and subtractFrom accepts a BigInt. Dispatch-Task: docs-harper-3586 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… own release note Dispatch-Task: docs-harper-3586 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Dispatch-Task: docs-harper-3586 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Dispatch-Task: docs-harper-3586 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An array element edited in place still saves, and a BigInt delta on an Int, Long, Float or Number property converts to a number. Dispatch-Task: pr-maint-cdb9a84b90693592e84fe856a3e8214f Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…d Bytes Dispatch-Task: pr-maint-cdb9a84b90693592e84fe856a3e8214f Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Dispatch-Task: pr-maint-cdb9a84b90693592e84fe856a3e8214f Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
bfbb69e to
99041d7
Compare
🚀 Preview DeploymentYour preview deployment is ready! 🔗 Preview URL: https://preview.harper-documentation.harperfabric.com/pr-760 This preview will update automatically when you push new commits. |
⊙ Problem
Stop update() reads from becoming writes, and make addTo calls in one transaction add up changes what a tracked
update()record writes. The Resource API reference covers none of it:DateorBytesedit no longer saves.addTo/subtractFromcalls add up, andsubtractFromtakes a BigInt.🤔 Is the requirement right?
Yes. The in-place
Date/Byteschange can drop writes silently after an upgrade, so readers need it in the reference and the release notes.💡 Solution
update()gets a What a tracked record writes subsection, with aDate/Bytesreplacement example.addTolists how calls combine. A delta after an assignment stays an assignment, which does not merge with concurrent writers.number | bigint; old anchors still work.Date/Bytesfirst.🤔 Badged
v5.4.0The core PR merged on
mainand first shipped inv5.4.0-alpha.2. It is not inv5.3.5.🔧 Changes
reference/resources/resource-api.md: a new subsection underupdate(), the instance-methods intro (drops "declared in the schema"),addTo,subtractFrom,set, and one bullet in Concurrency and Safe Concurrent Writes. Look hardest at theaddTobullets: they state merge semantics readers will rely on.release-notes/v5-lincoln/5.4.md: new Resource API section.Date/Byteselements still save when edited in place, and other non-plain values (aMap) must be reassigned.✅ Verification
resources/tracked.ts,resources/Table.tsatv5.4.0-alpha.2) and matches a test inunitTests/resources/trackedUpdateCommit.test.js. Not run against a live Harper.npm run buildpasses, and the new and kept anchors are in the built page.npm run format:checkis clean.Docs for HarperFast/harper#3586.
🤖 Generated by Anthropic Claude Opus 5.5; posted via @kriszyp.
🤖 Generated with Claude Code
Related PRs: #779 independent (open; other sections of the same two files), #783 independent (open; same), #784 independent (open; same), 3 others independent
Complexity: easy
Origin — the dispatch brief this PR was written from
Document tracked update() changes: addTo composition, BigInt subtractFrom, reassigning Date/Bytes
Document tracked-update behavior changed by HarperFast/harper#3586 (HarperFast/harper#3586) in the Resource API reference (reference/resources/resource-api.md: the
update()/ tracked record,addTo,subtractFrom, andsetsections).What changed for users:
addTo(property, delta)/subtractFrom(property, delta)compose within one transaction. Two calls on the same property add both deltas:addTo('n', 5); addTo('n', 3)adds 8 as one commutative addition, which still merges with other writers' additions. A delta after an assignment adds to the assigned value:rec.n = 100; rec.addTo('n', 7)stores 107. An assignment afteraddToreplaces the pending delta.subtractFromaccepts a BigInt delta, likeaddTo.update()(a sub-object, an array element) is no longer a write. Only properties you change are written, sent tosource.patch, and recorded in the audit history.rec.when = new Date(...). Changing it in place (rec.when.setTime(...),rec.bytes[0] = 9) is not tracked.rec.extra = 'x') saves it, even when nothing else changed.Keep the examples short; no internals. Link the harper PR in the docs PR body.
Dispatch: task
docs-harper-3586· queued by task:harper-tracked-update-collapse-addto · ran by claude/opus/high · worker kzyp-xps-1Ready-For-Promotion: 99041d7 urgency=normal late=none
Review-Coverage: authored=claude; ran=gemini,cursor-composer,codex; adjudicated=domain; declined=cursor-grok,muse; rounds=7; full=2 @ 99041d7
Review-Attention: skim ~2m (decisions: silent-break-placement, date-bytes-copy-semantics) @ 99041d7