v3.73.0
✨ Highlights
Presentation tool is now using Sanity Live Content API
The Presentation tool is now using Sanity Live Content API to drive Live Mode in integrations like @sanity/react-loader
, @sanity/svelte-loader
, @nuxtjs/sanity
and @sanity/core-loader
.
The new setup allows query refetching to only happen when actually needed, as opposed to every two seconds.
Why was fetching happening every two seconds before?
This aggressive polling was in place to capture changes that couldn’t be reliably predicted client-side using Content Source Maps/CSM. The goal was to ensure that such changes were detected and that eventual consistency was maintained in the live preview.
count(*[_type == "person" && isPublished])
For the client to know when this query count will change it would need to monitor every person document and ifisPublished
is true. This doesn't scale.*[slug.current == "discounted"]
If any document is given the slugdiscounted
, the query needs to refetch. The client would need to monitor every single document mutation in the dataset and check if a new document now has the slug, as well as check if any fields on the current matching document has changed, or if the matching document got deleted and there's a fallback match, or none at all.
The gist of it is the client can't predict everything, and if it tries, it winds up using a lot of memory and perform work, just in case anything has changed.
While this over-fetching never counted towards your Sanity API hit quota, the intention has always been to move over to a better architecture.
Enter the new Sanity Live API; it's built to solve "when should a query refetch?" and it allows Presentation to rely on the backend for telling it when it needs to refetch, thus using far less memory, less network resources, and less work on the main thread.
🐛 Notable bugfixes
- Internal document types will no longer appear in validation results in the CLI
- Fixes an issue where write tokens were not being set in .env file after initializing a remote template
- Fixes an issue where splitting a Portable Text block right before an inline object might cause the editor to crash
- Fixes an issue where using Shift+Enter to insert a line break (
\n
) in the Portable Text input would not work as expected in Safari
Install or upgrade Sanity Studio
To initiate a new Sanity Studio project or upgrade an existing one, please refer to our comprehensive guide on Installing and Upgrading Sanity Studio.
If you are updating from a version earlier than 3.37.0, you should also check out this article to ensure your dependencies are up to date.
📓 Full changelog
Author | Message | Commit |
---|---|---|
renovate[bot] | chore(lockfile): update dependency @tanstack/react-virtual to v3.11.3 (#8432) | ee48358 |
renovate[bot] | chore(deps): update pnpm to v9.15.4 (#8435) | b544969 |
renovate[bot] | fix(deps): update dependency @sanity/ui to ^2.11.7 (#8434) | ac0f20c |
renovate[bot] | chore(deps): update dependency framer-motion to v12 (#8438) | 465d9f2 |
ecospark[bot] | chore(prettier): fix unformatted files 🤖 ✨ (#8439) | ca0adf9 |
Rostislav Melkumyan | fix(cli): apply write token (#8450) | 11dff40 |
RitaDias | fix(cli): fix issue where core sanity types were appearing in the validation for schemas and documents (#8445) | 81a3bc6 |
Bjørge Næss | fix: set strictRequires to auto when building auto updating studios (#8367) | 01a9cd9 |
Bjørge Næss | chore(deps): upgrade vite (back) to v6 (#8370) | fdca354 |
Cody Olsen | fix(presentation): use live content API for loaders (#8429) | 86e5af8 |
renovate[bot] | fix(deps): Update dev-non-major (#8461) | 53b8009 |
Bjørge Næss | fix(migrate): always use raw perspective for migrations (#8467) | c317461 |
renovate[bot] | fix(deps): update dependency @portabletext/editor to ^1.28.0 (#8448) | 8e7c346 |
renovate[bot] | fix(deps): update dependency @portabletext/editor to ^1.30.1 (#8479) | b6ebfb7 |
renovate[bot] | fix(deps): update dependency @portabletext/editor to ^1.30.2 (#8485) | f4600d7 |
ecospark[bot] | fix(deps): update React Compiler dependencies 🤖 ✨ (#8477) | e5c8951 |
renovate[bot] | fix(deps): update dependency @portabletext/block-tools to ^1.1.4 (#8446) | 29a712c |
renovate[bot] | fix(deps): update dependency groq-js to ^1.15.0 (#8481) | 763561c |
ecospark[bot] | chore(deps): dedupe pnpm-lock.yaml (#8486) | 5891966 |
renovate[bot] | fix(deps): update dependency react-rx to ^4.1.18 (#8487) | 0e51cbe |
renovate[bot] | fix(deps): update dependency @sanity/ui to ^2.11.8 (#8488) | 5cf7afc |
renovate[bot] | chore(deps): update dependency vitest to v2.1.9 (#8489) | 60f2503 |
renovate[bot] | chore(deps): update dependency @sanity/visual-editing to v2.12.12 (#8493) | 8f6f088 |