Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
5 changes: 5 additions & 0 deletions .changeset/breezy-jars-boil.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@livekit/rtc-node': patch
---

Bump '@types/node' pkg version and remove all explicit `ReadableStream` imports
2 changes: 1 addition & 1 deletion packages/livekit-rtc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
},
"devDependencies": {
"@napi-rs/cli": "^2.18.0",
"@types/node": "^20.9.2",
"@types/node": "^22.13.10",
"prettier": "^3.0.3",
"tsup": "^8.3.5",
"typescript": "^5.2.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/livekit-rtc/src/audio_stream.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-FileCopyrightText: 2024 LiveKit, Inc.
//
// SPDX-License-Identifier: Apache-2.0
import { ReadableStream, type UnderlyingSource } from 'node:stream/web';
import type { UnderlyingSource } from 'node:stream/web';
import { AudioFrame } from './audio_frame.js';
import type { FfiEvent } from './ffi_client.js';
import { FfiClient, FfiClientEvent, FfiHandle } from './ffi_client.js';
Expand Down
1 change: 0 additions & 1 deletion packages/livekit-rtc/src/data_streams/stream_reader.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// SPDX-FileCopyrightText: 2024 LiveKit, Inc.
//
// SPDX-License-Identifier: Apache-2.0
import type { ReadableStream } from 'node:stream/web';
import { log } from '../log.js';
import type { DataStream_Chunk } from '../proto/room_pb.js';
import { bigIntToNumber } from '../utils.js';
Expand Down
1 change: 0 additions & 1 deletion packages/livekit-rtc/src/data_streams/stream_writer.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// SPDX-FileCopyrightText: 2024 LiveKit, Inc.
//
// SPDX-License-Identifier: Apache-2.0
import type { WritableStream } from 'node:stream/web';
import type { BaseStreamInfo, ByteStreamInfo, TextStreamInfo } from './types.js';

class BaseStreamWriter<T, InfoType extends BaseStreamInfo> {
Expand Down
28 changes: 13 additions & 15 deletions packages/livekit-rtc/src/participant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,29 @@ import {
ParticipantKind,
} from './proto/participant_pb.js';
import {
ChatMessage as ChatMessageModel,
DataStream_ByteHeader,
DataStream_Chunk,
DataStream_Header,
DataStream_OperationType,
DataStream_TextHeader,
DataStream_Trailer,
EditChatMessageRequest,
TranscriptionSegment as ProtoTranscriptionSegment,
type PublishDataCallback,
PublishDataRequest,
type PublishDataResponse,
type PublishSipDtmfCallback,
PublishSipDtmfRequest,
type PublishSipDtmfResponse,
type PublishTrackCallback,
PublishTrackRequest,
type PublishTrackResponse,
type PublishTranscriptionCallback,
PublishTranscriptionRequest,
type PublishTranscriptionResponse,
type SendChatMessageCallback,
SendChatMessageRequest,
type SendChatMessageResponse,
type SendStreamChunkCallback,
SendStreamChunkRequest,
Expand All @@ -46,28 +54,18 @@ import {
SendStreamTrailerRequest,
type SendStreamTrailerResponse,
type SetLocalAttributesCallback,
SetLocalAttributesRequest,
type SetLocalAttributesResponse,
type SetLocalMetadataCallback,
SetLocalMetadataRequest,
type SetLocalMetadataResponse,
type SetLocalNameCallback,
SetLocalNameRequest,
type SetLocalNameResponse,
type TrackPublishOptions,
type UnpublishTrackCallback,
type UnpublishTrackResponse,
} from './proto/room_pb.js';
import { ChatMessage as ChatMessageModel } from './proto/room_pb.js';
import {
EditChatMessageRequest,
TranscriptionSegment as ProtoTranscriptionSegment,
PublishDataRequest,
PublishSipDtmfRequest,
PublishTrackRequest,
PublishTranscriptionRequest,
SendChatMessageRequest,
SetLocalAttributesRequest,
SetLocalMetadataRequest,
SetLocalNameRequest,
UnpublishTrackRequest,
type UnpublishTrackResponse,
} from './proto/room_pb.js';
import type {
PerformRpcCallback,
Expand Down Expand Up @@ -460,7 +458,7 @@ export class LocalParticipant extends Participant {
const fileStats = await stat(path);
const file = await open(path);
try {
const stream: ReadableStream<Uint8Array> = file.readableWebStream({ type: 'bytes' });

@toubatbrian toubatbrian Jun 4, 2025

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.

Remove the payload since file.readableWebStream drops the argument since node.js v22
Screenshot 2025-06-04 at 12 14 01 AM

Screenshot 2025-06-04 at 12 15 25 AM

const stream: ReadableStream<Uint8Array> = file.readableWebStream();
const streamId = crypto.randomUUID();
const destinationIdentities = options?.destinationIdentities;

Expand Down
1 change: 0 additions & 1 deletion packages/livekit-rtc/src/room.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// SPDX-License-Identifier: Apache-2.0
import type { TypedEventEmitter as TypedEmitter } from '@livekit/typed-emitter';
import EventEmitter from 'events';
import { ReadableStream } from 'node:stream/web';
import { ByteStreamReader, TextStreamReader } from './data_streams/stream_reader.js';
import type {
ByteStreamHandler,
Expand Down
2 changes: 1 addition & 1 deletion packages/livekit-rtc/src/video_stream.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-FileCopyrightText: 2024 LiveKit, Inc.
//
// SPDX-License-Identifier: Apache-2.0
import { ReadableStream, type UnderlyingSource } from 'node:stream/web';
import type { UnderlyingSource } from 'node:stream/web';
import type { FfiEvent } from './ffi_client.js';
import { FfiClient, FfiClientEvent, FfiHandle } from './ffi_client.js';
import type { NewVideoStreamResponse, VideoRotation } from './proto/video_frame_pb.js';
Expand Down
82 changes: 47 additions & 35 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading