Repository navigation
Conversation
`pnpm size:breakdown` bundles `export { Room }` with esbuild and reports the
minified bytes per feature, plus what each feature would save if it were
left out of the bundle.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… behind it `Room` becomes `CoreRoom.with(dataStreams, rpc)`. `CoreRoom.with(...)` returns a room class that installs the given extensions and their dependencies in its constructor. Each extension returns the methods it adds to the room and to the local participant, under the names the SDK uses today. The full entry augments `CoreRoom` and `LocalParticipant` with the extension APIs, so the full build keeps its types wherever those classes appear. Also adds `Room.dispose()`, and moves `import 'webrtc-adapter'` into the main entry so a core-only bundle can leave it out. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Core keeps the data track channel in RTCEngine and the `dataTracks` map on RemoteParticipant. The extension owns both managers, the engine event wiring, the signal request errors and `publishDataTrack`. Core gains hooks for participant creation and updates, the sync state and the E2EE slot. Remote data tracks of a leaving participant now unpublish after that participant's media tracks, not before. Both still happen before the room emits ParticipantDisconnected to user listeners. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Core keeps the E2EE manager slot that RTCEngine and the publish path read. The `e2ee` extension creates the manager from the room options, fills the slot through the extension context, wires the encryption events and adds `setE2EEEnabled`. The `frameMetadata` extension owns the receiver side manager. The full Room now installs all five extensions. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
`src/core.ts` exports `CoreRoom` and the extensions. `pnpm check:core` bundles `CoreRoom` alone and fails if any extension module is reachable. The entry is not in package.json exports yet. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
`import { type X }` keeps a runtime import under verbatimModuleSyntax, so
SignalClient pulled data-track/types into the core bundle. The main entry
now exports the types that `Room.with` and `TrackProcessor.onPublish`
reference.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
`dist/livekit-client.core.esm.mjs` is built from src/core.ts (ESM only,
not in package.json exports yet). size-limit now also measures
`{ CoreRoom }` and `{ CoreRoom, rpc }` from it.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 5056f99 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Contributor
size-limit report 📦
|
Camera and screen share capture, simulcast, SVC, backup codecs, codec
selection and the dynacast quality updates now live in src/room/video.
Core keeps receiving video. Two slots connect them: the publish pipeline
on LocalParticipant (`videoPublisher`) and the video track factory in
track/create.ts. The full entry registers the factory at module load so
`createLocalTracks({ video })` works before a Room exists. Video presets
are marked pure so an audio-only bundle drops them.
Core bundle: 353.3 -> 329.2 KiB minified, 96.5 -> 89.2 KiB gzip.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
`src/exports.ts` is the export surface both entries share. The main entry adds `Room` and the type augmentations; the core entry adds `CoreRoom` and the extension objects. The core entry is built per module with dependencies left external (dist/core/), so a consumer's bundler drops unused modules whole; a single-file core bundle was not tree-shakeable by esbuild. The connection checker builds its own room from CoreRoom so that the full Room never reaches the core graph. Also adds examples/core, a README section, and size-limit entries for the new entry. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…nsions `simulatedParticipants` adds `room.simulateParticipants()`; core keeps a small `simulateConnected()` seam and `simulateScenario`. `chat` adds `sendChatMessage` / `editChatMessage` and routes the chatMessage data packet; the full Room installs it, the core entry does not export it. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Loggers created at module scope, the default reconnect policy, the extension symbols, the data track and serializer tags, the packet trailer magic bytes, the facing-mode maps and the preset arrays are side-effect free. The annotation lets bundlers drop them with the code that uses them. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The resolver moves out of the class into installExtensions(): the full
Room installs every extension in its constructor, and the core entry's
createRoom() installs the list an app gives it. Dependencies install
first, an explicitly listed instance wins over a dependency's default,
and a key listed twice throws.
e2ee, frameMetadata and dataStreams take their options directly
(`e2ee({ keyProvider, worker })`); listed bare they read RoomOptions as
before, and a function is evaluated per room. CoreRoomOptions is
RoomOptions without those slices.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… types
tsc's declaration emitter wrote import("../..") for inferred types that
it could reach through the index barrel, and three source files imported
types from '../..'. Both pulled index.d.ts, with its declare module
augmentations, into every consumer of livekit-client/core, so a room
built with [rpc] typed as if every extension were installed.
Import those types from their modules, give the extension objects and
the ConnectionCheck room explicit types, and compile a consumer probe
against emitted declarations in pnpm check:core. The core example's
tsconfig no longer includes all of src.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
getOrCreateParticipant() and simulateConnected() are private on CoreRoom again and reachable through the context, and the byte stream opener and video publisher live in one LocalParticipantSlots object the room hands to LocalParticipant instead of two public fields. Only installExtensions() stays @internal on CoreRoom. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The core rollup build had declaration: false, so its stripInternal had nothing to act on and the entry's types came from the main build. It now emits its own declarations to dist/core/types, and package.json points the core entry (and its downlevel copy) there. The main entry keeps its @internal members for the packages that use them. stripInternal removes whatever is tagged, so symbols that public signatures name lose their tag: ExtensionContext, installExtensions, InternalRoomOptions, the RTCEngine, PCTransport, SignalClient and OutgoingDataStreamManager classes, getLogger, getBrowser, VideoPublisher and LocalParticipantSlots. BaseE2EEManager tags the same members as E2EEManager, and rpc/index.ts no longer re-exports internal helpers. pnpm check:core type-checks the stripped declarations with skipLibCheck off, so a dangling reference fails the gate. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… rechecks disposed
frameMetadata({ worker }) only fed the receive-side manager. The engine
worker lookup, the join request capability and publishTrack read
room.options.frameMetadata, so a configured extension now fills that
slice. connect() rechecks `disposed` after it acquired the disconnect
lock, because dispose() can run while a connect waits for a disconnect
to finish.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The explicit aliases were a workaround for the barrel import in the emitted declarations; the core declaration program is rooted at core.ts now, so inference is safe and shorter. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
src/room/Room.ts is the file that became CoreRoom.ts, with most of its content unchanged. With the small full Room class at the same path, git and GitHub cannot pair the two as a rename and show a 6,000-line diff; with the full entry's class next to index.ts and core.ts, the diff is the ~770 lines that actually changed. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Loggers, symbols, presets, lookup maps and the default reconnect policy are created at module load. The /* @__PURE__ */ annotation lets a bundler drop them with the module when nothing imports them. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Conflicts came from code that moved into extensions: - Room.ts -> CoreRoom.ts: subscriberAllowPause is sent with the join request; simulateParticipants keeps its silent tracks accountable through ctx.acquireEmptyAudioStreamTrack(), so a disconnect releases them (#2029). - LocalParticipant.publishAdditionalCodecForTrack -> video/publisher.ts: the backup codec request carries the processed track's dimensions and per-codec layers (#2137); its tests call the publisher. - index.ts: releaseEmptyAudioStreamTrack is exported from exports.ts. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…e build - loglevel is CommonJS; the core build leaves it external, so the namespace import threw in plain Node ESM. A default import works everywhere, and the build now imports both built entries in Node. - Two test files imported paths that the Room move and the named LocalParticipant export changed. - A Room subclass may override an extension method: the override stays and the extension's copy is not installed. Only core and other extensions collide. - The resolver dedupes dependencies by key, not by instance, so two configured instances of one extension from two dependency lists no longer reach the room twice. - An app-supplied E2EE manager gets this room's listeners removed on dispose instead of keeping them for the life of the manager. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… spaces works Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Merged
rafaelhutter
added a commit
to rafaelhutter/client-sdk-js
that referenced
this pull request
Oct 23, 2026
Resolve conflicts with the CoreRoom split (livekit#2141): take main's Room.ts and apply the initial-connection restart handling to CoreRoom.ts, where handleRestarting and handleSignalRestarted now live. Keep the new tests from both sides.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Split
RoomintoCoreRoomplus extensions.createRoom(options, [extensions])fromlivekit-client/corebuilds a room with only the extensions an application needs;e2ee,frameMetadataanddataStreamstake their options directly.Room.dispose()releases a room for good. Video publishing (camera, screen share, simulcast, SVC, backup codecs) is thevideoextension; receiving video stays in core. The newlivekit-client/coreentry (ESM only, experimental) exportsCoreRoomand the extensions.simulateParticipantsand the legacy chat messages are extensions too; the core entry does not offer legacy chat.