-
Notifications
You must be signed in to change notification settings - Fork 445
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: refactor
createTrackerScope
internals to be more efficient (#…
…6946) * feat: add new createTrackerScope implementation * refactor: remove debug code and previous implementation
- Loading branch information
1 parent
8b92196
commit c4f9a1f
Showing
29 changed files
with
472 additions
and
399 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
packages/sanity/src/_singletons/core/changeIndicators/ChangeIndicatorTrackerContexts.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import {createContext} from 'react' | ||
|
||
import type { | ||
ChangeIndicatorTrackerContextStoreType, | ||
ChangeIndicatorTrackerGetSnapshotType, | ||
} from '../../../core/changeIndicators/ChangeIndicatorTrackerContexts' | ||
|
||
/** @internal */ | ||
export const ChangeIndicatorTrackerContextStore = | ||
createContext<ChangeIndicatorTrackerContextStoreType>(null) | ||
|
||
/** @internal */ | ||
export const ChangeIndicatorTrackerContextGetSnapshot = | ||
createContext<ChangeIndicatorTrackerGetSnapshotType>(null) |
12 changes: 12 additions & 0 deletions
12
packages/sanity/src/_singletons/core/presence/overlay/PresenceTrackerContexts.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import {createContext} from 'react' | ||
|
||
import type { | ||
PresenceTrackerContextStoreType, | ||
PresenceTrackerGetSnapshotType, | ||
} from '../../../../core/presence/overlay/PresenceTrackerContexts' | ||
|
||
/** @internal */ | ||
export const PresenceTrackerContextStore = createContext<PresenceTrackerContextStoreType>(null) | ||
|
||
/** @internal */ | ||
export const PresenceTrackerContextGetSnapshot = createContext<PresenceTrackerGetSnapshotType>(null) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
packages/sanity/src/core/changeIndicators/ChangeIndicatorTrackerContexts.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { | ||
type TrackerContextGetSnapshot, | ||
type TrackerContextStore, | ||
} from '../components/react-track-elements' | ||
import {type ChangeIndicatorTrackerContextValue} from './types' | ||
|
||
/** | ||
* @internal | ||
* @hidden | ||
*/ | ||
export type ChangeIndicatorTrackerContextStoreType = | ||
TrackerContextStore<ChangeIndicatorTrackerContextValue> | null | ||
|
||
/** | ||
* @internal | ||
* @hidden | ||
*/ | ||
export type ChangeIndicatorTrackerGetSnapshotType = | ||
TrackerContextGetSnapshot<ChangeIndicatorTrackerContextValue> | null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.