Open pedrobonamin opened 2 weeks ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
live-visual-editing-next | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Nov 6, 2024 2:46pm |
visual-editing-next-with-i18n | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Nov 6, 2024 2:46pm |
visual-editing-storybook | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Nov 6, 2024 2:46pm |
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
Package | New capabilities | Transitives | Size | Publisher |
---|---|---|---|---|
npm/@sanity/client@6.22.2-bundle-perspective-2 | Transitive: environment, network | +26 |
3.58 MB | pedro-sanity |
npm/@sanity/icons@3.5.0-corel.0 | None | 0 |
1.45 MB | mariuslundgard |
npm/@sanity/types@3.59.2-corel.333 | None | 0 |
404 kB | pedro-sanity |
npm/@sanity/ui@2.10.0-corel.0 | Transitive: environment | +52 |
14.5 MB | mariuslundgard |
npm/@sanity/util@3.59.2-corel.333 | None | +1 |
4.53 MB | pedro-sanity |
npm/@sanity/vision@3.59.2-corel.333 | Transitive: environment | +81 |
13.6 MB | pedro-sanity |
npm/groq@3.59.2-corel.333 | None | 0 |
11.8 kB | pedro-sanity |
npm/sanity@3.59.2-corel.333 | Transitive: environment, eval, filesystem, network, shell, unsafe | +2147 |
377 MB | pedro-sanity |
🚮 Removed packages: npm/@sanity/client@6.22.2, npm/@sanity/icons@3.4.0, npm/@sanity/ui@2.8.10, npm/@sanity/util@3.62.2, npm/@sanity/vision@3.62.2, npm/groq@3.62.2
Pre read
This branch builds on top of
releases
branch, which includes the necessary packages updates.6.22.2-bundle-perspective
corel
Next steps:
bundlePerspective
data as a query paramapplySourceDocuments
in theclient
to work with perspectives. Investigate what this does.Changes:
With the introduction of
releases
the perspective is now a global studio concern and a new type of perspective has been introducedbundle.{releaseId}
Example of a published release selection
Video 🎥
Video explaining the details https://www.loom.com/share/3894e17c19b247548dccf3976f661a29?sid=59625a39-bdbf-400f-ad9c-d4243acf4018
The issue with the drafts is now fixed.
Perspective selector removed
Given we have this new perspective selector, the
draft | published
selector from Presentation tool was removed<RevisionSwitcher/>
removedThis is not needed anymore, structure now knows about perspectives and it infers them from the global state and the form reacts according to the perspective selected.
Loaders updated.
The loaders
LiveQueries
andLoaderQueries
were updated to use the bundlePerspective param.Perspective type updated to include
bundle.${string}
The global perspective can be any of
published | previewDrafts | bundle.${string}
this has been reflected in the code by updating the types were needed, this could be centralized instead of manually adding it everywhere, but wanted to easily reflect the intention in code for the review. This is relevant at the moment we need to query the data. When receiving abundle.${string}
perspective it should not use theperspective
option inclient.fetch
, instead, it should use thebundlePerspective
option, which takes an array of perspectives.How does
bundlePerspective
works: bundles perspective allows the client to fetch data in a similar way aspreviewDrafts
, but instead of only stacking changes of published and drafts, it allows us to stack multiple perspectives inside. So given you have the following documents:versions.summer.foo
andbar
versions.summer.foo
and - -versions.winter.bar
(This supports multiple perspectives in one query)drafts.foo
andbar
This
bundlePerspective
array is exposed by theusePerspective
hook fromsanity
which takes care of applying the perspectives in the correct order, the perspectives will apply on top of each other from right to left. So if the same document is in two perspectives, it will be returned only in the first one found.