Skip to content

fix: make item drafts mutable#408

Merged
samwillis merged 2 commits intoTanStack:mainfrom
pawelblaszczyk5:make-draft-mutable
Aug 25, 2025
Merged

fix: make item drafts mutable#408
samwillis merged 2 commits intoTanStack:mainfrom
pawelblaszczyk5:make-draft-mutable

Conversation

@pawelblaszczyk5
Copy link
Contributor

Closes #407

I wasn't sure whether it's fine to install dependency for it, or just copy paste it (but the type is a little bit bulky). As this type unfortunately has a lot of weird edge cases 😅 Lmk if you'd prefer to avoid the dependency!

@kevin-dp
Copy link
Contributor

Since we're only using 1 type from it, first reaction would be to vendor it in. But, it's a type so we could make it a dev dependency in which case i'm less worried about the additional dependency (cc @samwillis).

@pawelblaszczyk5
Copy link
Contributor Author

pawelblaszczyk5 commented Aug 14, 2025

Tbh I'm not sure about npm packaging and was wondering whether I should put this in dependencies or devDependencies. On one hand it's type only, but on the other hand it'll be part of generated d.ts files and user will need it to work correctly? 🤔

@kevin-dp
Copy link
Contributor

@pawelblaszczyk5 Indeed, i might be wrong here. It may need to be a regular dependency because the type is needed by the users of our library. In that case, i think it's best to vendor in that one type.

@samwillis
Copy link
Collaborator

samwillis commented Aug 18, 2025

Yep, I would prefer to vendor a minimal type helper for this rather than have a dependancy. We are aiming for almost no dependancies (we only depend on standard schema at the moment).

@pawelblaszczyk5
Copy link
Contributor Author

pawelblaszczyk5 commented Aug 18, 2025

I’ll change that then, thanks :)

@changeset-bot
Copy link

changeset-bot bot commented Aug 19, 2025

🦋 Changeset detected

Latest commit: c356557

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
@tanstack/db Patch
@tanstack/electric-db-collection Patch
@tanstack/query-db-collection Patch
@tanstack/react-db Patch
@tanstack/solid-db Patch
@tanstack/svelte-db Patch
@tanstack/trailbase-db-collection Patch
@tanstack/vue-db Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pawelblaszczyk5
Copy link
Contributor Author

I changed it - venodred the type from type-fest

@pkg-pr-new
Copy link

pkg-pr-new bot commented Aug 20, 2025

More templates

@tanstack/db

npm i https://pkg.pr.new/@tanstack/db@408

@tanstack/db-ivm

npm i https://pkg.pr.new/@tanstack/db-ivm@408

@tanstack/electric-db-collection

npm i https://pkg.pr.new/@tanstack/electric-db-collection@408

@tanstack/query-db-collection

npm i https://pkg.pr.new/@tanstack/query-db-collection@408

@tanstack/react-db

npm i https://pkg.pr.new/@tanstack/react-db@408

@tanstack/solid-db

npm i https://pkg.pr.new/@tanstack/solid-db@408

@tanstack/svelte-db

npm i https://pkg.pr.new/@tanstack/svelte-db@408

@tanstack/trailbase-db-collection

npm i https://pkg.pr.new/@tanstack/trailbase-db-collection@408

@tanstack/vue-db

npm i https://pkg.pr.new/@tanstack/vue-db@408

commit: c356557

@samwillis samwillis merged commit 3d60fad into TanStack:main Aug 25, 2025
6 checks passed
@github-actions github-actions bot mentioned this pull request Aug 25, 2025
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.

draft in update collection method should be writable even if collection type is readonly

3 participants