Skip to content

Commit

Permalink
chore(core): add todo-corel comments
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrobonamin committed Jan 27, 2025
1 parent cb5ac7b commit 209e7ae
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 7 deletions.
2 changes: 2 additions & 0 deletions packages/sanity/src/core/preview/createPreviewObserver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ export function createPreviewObserver(context: {
value: Previewable,
type: PreviewableType,
options: {
// TODO: COREL - Is this missing somehow? Maybe it was implemented and we lost this
// Is perspective preview value working correctly?
perspective?: string
viewOptions?: PrepareViewOptions
apiConfig?: ApiConfig
Expand Down
1 change: 1 addition & 0 deletions packages/sanity/src/core/preview/documentPreviewStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ export function createDocumentPreviewStore({
}

const observeDocumentIdSet = createDocumentIdSetObserver(
// TODO: COREL - Replace once releases API are stable.
versionedClient.withConfig({apiVersion: 'X'}),
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {type SanityClient} from '@sanity/client'

// TODO: COREL - Replace once releases API are stable.
const ACTIONS_API_MINIMUM_VERSION = 'vX'

export function actionsApiClient(client: SanityClient): SanityClient {
Expand Down
1 change: 1 addition & 0 deletions packages/sanity/src/core/studioClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ import {type SourceClientOptions} from './config'
* @internal
*/
export const DEFAULT_STUDIO_CLIENT_OPTIONS: SourceClientOptions = {
// TODO: COREL - Replace once releases API are stable.
apiVersion: 'X',
}
1 change: 1 addition & 0 deletions packages/sanity/src/presentation/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export const EDIT_INTENT_MODE = 'presentation'
export const MAX_TIME_TO_OVERLAYS_CONNECTION = 3_000 // ms

// The API version to use when using `@sanity/client`
// TODO: COREL - Replace once releases API are stable.
export const API_VERSION = 'vX'

// Heartbeats shouldn't fire on intervals that are so short it causes performance issues
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ export const DocumentPaneProvider = memo((props: DocumentPaneProviderProps) => {
const perspective = usePerspective()

const {isReleaseLocked, selectedReleaseId, selectedPerspectiveName} = useMemo(() => {
// * TODO: COREL - Remove this after updating sanity-assist to use <PerspectiveProvider>
if (forcedVersion) {
return forcedVersion
}
Expand Down Expand Up @@ -794,8 +795,6 @@ export const DocumentPaneProvider = memo((props: DocumentPaneProviderProps) => {
views,
formState,
unstable_languageFilter: languageFilter,

// History specific
revisionId,
lastNonDeletedRevId,
}) satisfies DocumentPaneContextValue,
Expand Down Expand Up @@ -836,26 +835,26 @@ export const DocumentPaneProvider = memo((props: DocumentPaneProviderProps) => {
openPath,
index,
inspectOpen,
isDeleted,
isDeleting,
isPermissionsLoading,
isInitialValueLoading,
languageFilter,
validation,
menuItemGroups,
paneKey,
previewUrl,
ready,
schemaType,
isPermissionsLoading,
isInitialValueLoading,
permissions,
setTimelineRange,
isDeleting,
isDeleted,
timelineError,
timelineStore,
title,
value,
selectedReleaseId,
views,
formState,
languageFilter,
revisionId,
lastNonDeletedRevId,
],
Expand Down
1 change: 1 addition & 0 deletions packages/sanity/src/structure/panes/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export interface BaseStructureToolPaneProps<T extends PaneNode['type']> {
isActive?: boolean
pane: Extract<PaneNode, {type: T}>
/**
* TODO: COREL - Remove this after updating sanity-assist to use <PerspectiveProvider>
* Allows to override the global version with a specific version or release.
* @beta
*/
Expand Down

0 comments on commit 209e7ae

Please sign in to comment.