Skip to content

Conversation

@lukasIO
Copy link
Contributor

@lukasIO lukasIO commented Oct 22, 2025

BarVisualizer should also accept audio tracks directly

@changeset-bot
Copy link

changeset-bot bot commented Oct 22, 2025

🦋 Changeset detected

Latest commit: 0283eb5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@livekit/components-react Patch
@livekit/component-example-next Patch
@livekit/components-js-docs Patch
@livekit/component-docs-storybook Patch
@livekit/components-docs-gen Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Oct 22, 2025

size-limit report 📦

Path Size
LiveKitRoom only 6 KB (0%)
LiveKitRoom with VideoConference 32.23 KB (0%)
All exports 42.53 KB (+0.15% 🔺)

@lukasIO lukasIO requested a review from 1egoman October 22, 2025 15:51
@lukasIO lukasIO changed the title allow localtrack passing on bar visualizer Allow localtrack passing on BarVisualizer Oct 23, 2025
Comment on lines +428 to 440
// Warning: (ae-forgotten-export) The symbol "ReceivedMessageWithType" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
export interface ReceivedChatMessage extends ChatMessage {
// (undocumented)
attributes?: Record<string, string>;
// (undocumented)
export type ReceivedAgentTranscriptionMessage = ReceivedMessageWithType<'agentTranscript', {
message: string;
}>;

// @public (undocumented)
export type ReceivedChatMessage = ReceivedMessageWithType<'chatMessage', ChatMessage & {
from?: Participant;
}
attributes?: Record<string, string>;
}>;

Copy link
Contributor

Choose a reason for hiding this comment

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

thought: It looks like some changes from #1207 didn;t get included in this file - sorry about that, my bad 😞

However, I am a bit suprised that the ci step didn't check this? Maybe this is something to make a ticket on to look into, since it seems like this file isn't being checked like the associated components-reactone is.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we don't check the API compat on CI for the core module as that's treated as an internal package.
Don't have a strong opinion on whether or not to change that.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, I see what you are saying, I guess that makes a certain amount of sense. Thinking about this in another way then - is there a good reason to even have the api-extractor tool run on the core package and generate this artifact if it won't be consumed externally?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, good point, both options sound fine to me!

Comment on lines +27 to +29
/** @deprecated use `track` field instead */
trackRef?: TrackReferenceOrPlaceholder;
track?: TrackReferenceOrPlaceholder | LocalAudioTrack | RemoteAudioTrack;
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: Other components currently seem to favor the trackRef prop name rather than track. I think I understand why you did it here (as a stepping stone to migrating away from TrackReference) but this means this component has two similar props which could be used at the same time, resulting in a less clear end interface.

What about instead, making BarVisualizerProps actually have two versions in a discriminated union, one that is the pre-existing version with trackRef (plus adding the deprecation), and the other getting rid of trackRef and adding track instead? The nice thing about doing it that way is the fields are mutually exclusive.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's somewhat cleaner that way, true. But the downside of that is that the props wouldn't be as easy to inspect anymore, right?

I thought deprecating one of them is pretty clear?

Copy link
Contributor

Choose a reason for hiding this comment

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

To be clear I don't really have a strong opinion on this, it just struck me reading this code that it would be nice if they were mutually exclusive since they really should never both be set and then once you've migrated over to the new track prop, it is as if the old trackRef prop no longer exists .

By "props wouldn't be as easy to inspect anymore" if you mean that the component props wouldn't point to a singular interface on a "go to definition" type operation and instead would be an expression of some sort - yes, that is a good point. I guess there are pros and cons to both approaches, so do whatever you think makes sense.

@lukasIO lukasIO merged commit ffd6617 into main Oct 23, 2025
6 checks passed
@lukasIO lukasIO deleted the lukas/allow-track-passing branch October 23, 2025 15:11
@github-actions github-actions bot mentioned this pull request Oct 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants