Skip to content

Conversation

@judofyr
Copy link
Contributor

@judofyr judofyr commented Sep 22, 2025

Description

This introduces the concept of a "key" for a store. The main goal here is to enable the support for us using a single SanityInstance across all the stores, but still have separate stores per projectId/dataset. This is accomplished by saying that each store is determined by a "key" which can be dynamically built from the options. We first invoke the key logic and then dispatches to the right store. For now have projectId/dataset keys, but in the future we expect this to be per-resource.

This also means that it's possible to use a single SanityInstance for working with multiple projectId/dataset. If you pass in an explicit projectId/dataset then it will no longer care about the configuration on the SanityInstance.

What to review

Testing

Fun gif

@vercel
Copy link

vercel bot commented Sep 22, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
sdk-docs Ready Ready Preview, Comment Dec 19, 2025 4:13pm
sdk-kitchensink-react Ready Ready Preview, Comment Dec 19, 2025 4:13pm

Copy link
Contributor Author

judofyr commented Sep 22, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@judofyr judofyr force-pushed the holm/require-project-id branch from 2cbcac0 to 8b5e9b8 Compare September 23, 2025 14:03
@judofyr judofyr force-pushed the holm/require-project-id branch from 8b5e9b8 to 5c97111 Compare September 25, 2025 10:34
@judofyr judofyr changed the base branch from holm/require-project-id to graphite-base/632 December 15, 2025 12:11
@judofyr judofyr changed the base branch from graphite-base/632 to holm/require-project-id December 15, 2025 12:29
@judofyr judofyr self-assigned this Dec 15, 2025
@judofyr judofyr marked this pull request as ready for review December 15, 2025 12:57
@judofyr judofyr requested a review from a team as a code owner December 15, 2025 12:57
@judofyr judofyr requested review from colepeters and removed request for a team December 15, 2025 12:57
@judofyr judofyr mentioned this pull request Dec 16, 2025
@judofyr judofyr changed the base branch from holm/require-project-id to graphite-base/632 December 19, 2025 12:02
@judofyr judofyr changed the base branch from graphite-base/632 to holm/actions-unify December 19, 2025 12:03
Base automatically changed from holm/actions-unify to main December 19, 2025 14:26
This introduces the concept of a "key" for a store. The main goal here
is to enable the support for us using a single SanityInstance across all
the stores, but still have separate stores per projectId/dataset. This
is accomplished by saying that each store is determined by a "key" which
can be dynamically built from the options. We first invoke the key logic
and then dispatches to the right store. For now have projectId/dataset
keys, but in the future we expect this to be per-resource.

This also means that it's possible to use a single SanityInstance for
working with multiple projectId/dataset. If you pass in an explicit
projectId/dataset then it will no longer care about the configuration on
the SanityInstance.
Copy link
Member

@cngonzalez cngonzalez left a comment

Choose a reason for hiding this comment

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

Appreciate the lack of breaking changes to any exported utils! Also did some manual testing in those places where there could have been some divergence (how the client is retrieved in the perspective store, for example), and saw no issues.

@judofyr judofyr merged commit 1e22eed into main Dec 19, 2025
19 checks passed
@judofyr judofyr deleted the holm/dataset-bound branch December 19, 2025 16:46
@squiggler squiggler bot mentioned this pull request Dec 19, 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.

2 participants