Skip to content

Add standalone document mutation functions - #10

Merged
0x80 merged 5 commits into
mainfrom
thijs/0220-add-mutation-methods
Feb 20, 2026
Merged

Add standalone document mutation functions#10
0x80 merged 5 commits into
mainfrom
thijs/0220-add-mutation-methods

Conversation

@0x80

@0x80 0x80 commented Feb 20, 2026

Copy link
Copy Markdown
Owner

Adds standalone typed write functions (setDocument, updateDocument, deleteDocument and their *SpecificDocument variants) as thin wrappers around the Firestore SDK. These allow performing mutations without fetching the document first, which is useful when the caller already knows the document path.

The set* functions use overloads matching Firebase's own setDoc signature: without options all fields are required (WithFieldValue<T>), with SetOptions partial data is accepted (PartialWithFieldValue<T>).

Also updates the README and CLAUDE.md to document the new functions.

0x80 added 2 commits February 20, 2026 12:20
Add setDocument, updateDocument, and deleteDocument (plus their
*SpecificDocument variants) as thin typed wrappers around the
Firestore SDK write operations. This allows callers to perform
mutations without fetching the document first.
Copilot AI review requested due to automatic review settings February 20, 2026 11:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds standalone Firestore write helpers to complement the existing hook- and fetch-based APIs, enabling typed document mutations when the caller already knows the document path.

Changes:

  • Introduces standalone mutation wrappers: setDocument, updateDocument, deleteDocument (+ *SpecificDocument variants).
  • Re-exports the new write helpers from the public entrypoint.
  • Documents the new write helpers in README.md and CLAUDE.md.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/write-document.ts Adds standalone typed wrappers around Firestore setDoc/updateDoc/deleteDoc.
src/index.ts Exposes the new write module via the package barrel export.
README.md Documents the new write functions and references them from the mutations section.
CLAUDE.md Updates the project API overview list to include the new write helpers.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/write-document.ts Outdated
Comment thread src/write-document.ts Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Comment thread src/write-document.ts
0x80 added 2 commits February 20, 2026 12:29
Without options, data requires all fields (WithFieldValue<T>).
With SetOptions, partial data is accepted (PartialWithFieldValue<T>).
Also removes the options ?? {} fallback.
Copilot AI review requested due to automatic review settings February 20, 2026 11:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/write-document.ts Outdated
Comment thread src/write-document.ts Outdated
@0x80
0x80 merged commit d909a70 into main Feb 20, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants