-
Notifications
You must be signed in to change notification settings - Fork 450
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(core): only use vX
client if strictly necessary
#8466
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
2 Skipped Deployments
|
fd5b824
to
80b3ba0
Compare
No changes to documentation |
Component Testing Report Updated Feb 3, 2025 1:29 PM (UTC) ❌ Failed Tests (2) -- expand for details
|
⚡️ Editor Performance ReportUpdated Mon, 03 Feb 2025 13:31:00 GMT
Detailed information🏠 Reference resultThe performance result of
🧪 Experiment resultThe performance result of this branch
📚 Glossary
|
80b3ba0
to
bf68b2d
Compare
options: { | ||
// how to insert new document ids. Defaults to `sorted` | ||
insert?: 'sorted' | 'prepend' | 'append' | ||
} = {}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thoughts on making apiVersion part of options here?
apiVersion: 'vX', | ||
}) | ||
.fetch<SanityDocumentLike[]>(query, params, options) | ||
const apiVersion = isReleasePerspective(options?.perspective as string | string[] | undefined) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice way of feature-detecting what version to use!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a //todo: remove once releases is opt-out?
@@ -20,7 +20,7 @@ export const publish: OperationImpl<[], DisabledReason> = { | |||
throw new Error('cannot execute "publish" when draft is missing') | |||
} | |||
|
|||
return actionsApiClient(client).observable.action( | |||
return actionsApiClient(client, idPair).observable.action( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should make a note to remove these added params after backend APIs stabilize
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a TODO, thanks!
… releases
Description
In the initial implementation of content releases we modified the default studio client to use
vX
this was needed because all the new functions and versions documents checks are only available invX
for now.Now, we are aiming to merge this to
next
in the coming week, given that we don't want to use thevX
client everywhere because of the risk this involves we are adding this changes in which the client will usevX
only if it is strictly necessary.This will be when a user is doing actions over a
version
document or is using anything inside the releases plugin.This PR has been divided in logical pieces and will probably be easier to review commit per commit.
Changes in
presentation
toolI've added the checks where I noticed that we are using perspectives and could lead to errors if the client is not using the releases client (vX for now) in this commit
I've left out the following files, which I think don't require this.
What to review
Testing
vX
client should only be used when a perspective is defined or when operating in a version document.This can be verified by opening a document in
draft
and doing edits, the changes should be done using the 2024 client.If you switch to a
version
now the client should usevX
The same with search.
Notes for release