Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/slow-swans-invite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@livekit/components-core": patch
"@livekit/components-react": patch
---

chore(react): deprecate legacy useTrackTranscriptions
2 changes: 2 additions & 0 deletions packages/core/etc/components-core.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,8 @@ export type PinState = TrackReferenceOrPlaceholder[];

// @public (undocumented)
export interface ReceivedChatMessage extends ChatMessage {
// (undocumented)
attributes?: Record<string, string>;
// (undocumented)
from?: Participant;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/react/etc/components-react.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ export interface TrackToggleProps<T extends ToggleSource> extends Omit<React_2.B
source: T;
}

// @alpha (undocumented)
// @alpha @deprecated (undocumented)
export interface TrackTranscriptionOptions {
bufferSize?: number;
onTranscription?: (newSegments: TranscriptionSegment[]) => void;
Expand Down Expand Up @@ -1185,7 +1185,7 @@ export function useTrackToggle<T extends ToggleSource>({ source, onChange, initi
export interface UseTrackToggleProps<T extends ToggleSource> extends Omit<TrackToggleProps<T>, 'showIcon'> {
}

// @alpha (undocumented)
// @alpha @deprecated (undocumented)
export function useTrackTranscription(trackRef: TrackReferenceOrPlaceholder | undefined, options?: TrackTranscriptionOptions): {
segments: ReceivedTranscriptionSegment[];
};
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/hooks/useTrackSyncTime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { useObservableState } from './internal';

/**
* @internal
* @deprecated Use useTrackSyncTime instead
*/
export function useTrackSyncTime(ref: TrackReferenceOrPlaceholder | undefined) {
Comment on lines 6 to 9
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this saying that a function is deprecated, but that a user should use the same deprecated function instead? Maybe there's a different useTrackSyncTime somewhere this is referring to, but as is it's kinda confusing.

Something that could maybe help that confusion - there's a @link tsdoc directive (more info) that could maybe be used to link to the correct implementation. If this seems like a good plan, I can make a ticket to do a pass and apply this everywhere?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uff, thanks for catching, that doesn't make any sense. It was used internally only anyways, the deprecated marker serves primarily as a reminder for us to remove it entirely for the next iteration

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, using the link directive would be great!

const observable = React.useMemo(
Expand Down
2 changes: 2 additions & 0 deletions packages/react/src/hooks/useTrackTranscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { useTrackSyncTime } from './useTrackSyncTime';

/**
* @alpha
* @deprecated Use useTranscription instead
*/
export interface TrackTranscriptionOptions {
/**
Expand All @@ -37,6 +38,7 @@ const TRACK_TRANSCRIPTION_DEFAULTS = {
/**
* @returns An object consisting of `segments` with maximum length of opts.bufferSize
* @alpha
* @deprecated Use useTranscription instead
*/
export function useTrackTranscription(
trackRef: TrackReferenceOrPlaceholder | undefined,
Expand Down