Skip to content

Commit

Permalink
[e2ee] Make ratcheting configurable (#616)
Browse files Browse the repository at this point in the history
* Allow for background timers to be overriden (#556)

* Allow for background timers to be overriden for platform specific implementations

* Add changeset

* Formatting

* More timers converted and renamed to CriticalTimers

* Avoid using class scope for timers (#558)

* avoid using class scope for timers

* fix copy paste error

* protocol

* Update dependency ua-parser-js to v1.0.33 (#559)

* Update dependency ua-parser-js to v1.0.33 [SECURITY]

* Create tall-cycles-judge.md

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: lukasIO <mail@lukasseiler.de>

* Version Packages (#554)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Export CheckStatus type (#566)

* Export CheckStatus

* Create afraid-plants-grab.md

---------

Co-authored-by: lukasIO <lukas.seiler@neesh.de>

* Add getDisplayMedia support check (#562)

* Add getDisplayMedia support check

* Create friendly-trainers-yawn.md

---------

Co-authored-by: lukasIO <lukas.seiler@neesh.de>

* Handle unknown signal messages from the server (#568)

When we switched to using oneof in generated protobufs, it broke the ability to handle unknown signal messages from the server. This is due to the protobuf parser returning undefined for message field, versus a new value for $case.

* Drop local participant updates with wrong sid (#570)

* drop participant updates with wrong sid

* Create smooth-students-poke.md

* Remove redundant sid check (#571)

* Update devDependencies (non-major) (#563)

* Update devDependencies (non-major)

* rerun prettier after update

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Lukas <mail@lukasseiler.de>

* Emit `Participant.PermissionChanged` event also for remote participants (#569)

* emit Participant.PermissionChanged event also for remote participants

* fix typo

* cleanup

* update protocol with source permissions

* better compare

* Create angry-pugs-repair.md

* Version Packages (#567)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Add reconnect reason and signal rtt calculation (#573)

* Add reconnect reason and signal rtt caculation

* changeset

* Reset ping when receiving pong instead of clearing (#578)

* Provide more context to ConnectionError when connecting to a room (#575)

* Provide more context to ConnectionError when connecting to a room

* Fix prettier issues

* Create mighty-boats-wonder.md

---------

Co-authored-by: lukasIO <lukas.seiler@neesh.de>

* Only restart track after permission change if not muted (#581)

* only restart track after permission change if not muted

* fix implicit restart case

* Create rotten-bottles-work.md

* restart audio track on unmute if readyState is ended

* Version Packages (#577)

* Update docstring for RecordingStatusChanged (#583)

* Prevent concurrent setParameter call to avoid exception (#585)

if multiple get/setParameter are called concurrently, certain timing of
events could lead to the browser throwing an exception in `setParameter`,
due to a missing `getParameter` call.

* Version Packages (#591)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Update devDependencies (non-major) (#586)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency rollup-plugin-filesize to v10 (#588)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency gh-pages to v5 (#587)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Disable red encoding by default for stereo track (#593)

* Disable red encoding by default for stereo track

* changeset

* prettier

* Update src/room/track/options.ts

Co-authored-by: David Zhao <dz@livekit.io>

* Update src/room/track/options.ts

Co-authored-by: David Zhao <dz@livekit.io>

---------

Co-authored-by: David Zhao <dz@livekit.io>

* Track.streamState defaults to active (#596)

StreamState is used to communicate when congestion controller pauses.
It does not make sense to initialize this value to paused since in most
cases, congestion controller has not paused the track and we'd want it to
avoid flickering.

* Fixed incorrect state with resume then reconnect (#595)

When a resume sequence fails, a full reconnect is attempted. There were
a few issues there with that sequence
- We did not always fire EngineEvent.Restarting, so Room missed tearing down existing participants
- With selective subscriptions, when existing `isDesired` isn't cleared, it will not send a subscribe request when requested
- New tracks were not republished successfully when reconnected (due to sender not being reset early enough)

* Always fire EngineEvent.Resuming (#600)

* always fire EngineEvent.Resuming

* changed RTCEngine.connectedServerAddress to an async getter getConnectedServerAddress()

* Version Packages (#594)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Add support for experimental getDisplayMedia options (#592)

* add support for experimental getDisplayMedia options

* reset formatting

* Create .changeset/bright-dancers-worry.md

* Replace terser plugin with official rollup terser plugin (#603)

* Update to ReconnectReason enum (#606)

* update REASON to RR enum

* update protocol

* update proto stubs

* Update outdated slack community link (#607)

* Receive remote participant disconnected updates while reconnecting (#605)

* Add support for topics on data messages (#597)

* Add support for setting topics on data messages

* make destination comment clearer

* update protocol to current main

* update REASON to RR enum

* Create .changeset/metal-otters-give.md

* Defer publishing of tracks during reconnection (#608)

* defer track publishing during reconnection

* keep track of pending publications

* Create .changeset/cuddly-pumpkins-tie.md

* make sure pending promise is always deleted

* guard against multiple reconnect events emitted

* Version Packages (#601)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Reject publish future if engine disconnects (#609)

* Reject publish future if engine disconnects

* Create .changeset/gold-tips-complain.md

* set future to undefined

* Fix wrong videoSimulcastLayer default in docstring (#613)

* Allow to specify exact constraint for device switch (#612)

* Only trigger AudioPlaybackFailed when it's `NotAllowed` (#615)

Other errors could be raised when playing back an audio track.
For example: a user could attach to another track, aborting the current
attempt.

In those cases, we do not want to fire AudioPlaybackFailed incorrectly.

* dont ratchet automatically within cryptor

* fix import key

* add salt as constant

* Version Packages (#610)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* use string key

* map rtp payload type to codec

* try to detect h264 frames and fallback to vp8

* avoid unnecessary steps

* log sdp answer

* use key material in keyprovider

* expose method to ratchet key on keyProvider

* move worker files into dedicated folder

* build e2ee worker in separate build step

---------

Co-authored-by: davidliu <davidliu@deviange.net>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: otakueadwine <otaku.eadwine@gmail.com>
Co-authored-by: Daniel Kilimnik <mail@kilimnik.de>
Co-authored-by: David Zhao <dz@livekit.io>
Co-authored-by: cnderrauber <zengjie9004@gmail.com>
Co-authored-by: Herman Bilous <herman.belous@gmail.com>
  • Loading branch information
10 people committed Mar 16, 2023
1 parent 54681aa commit 329c928
Show file tree
Hide file tree
Showing 44 changed files with 3,403 additions and 2,158 deletions.
5 changes: 0 additions & 5 deletions .changeset/nervous-queens-run.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/rare-rivers-collect.md

This file was deleted.

2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Slack Community Chat
url: https://join.slack.com/t/livekit-users/shared_invite/zt-19nswkhip-4Y56hpIHM94EyWUpRH1GGQ
url: https://join.slack.com/t/livekit-users/shared_invite/zt-rrdy5abr-5pZ1wW8pXEkiQxBzFiXPUg
about: Ask questions and discuss with other LiveKit users in real time.
76 changes: 76 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,81 @@
# Change Log

## 1.6.9

### Patch Changes

- [#612](https://github.com/livekit/client-sdk-js/pull/612) [`347c497`](https://github.com/livekit/client-sdk-js/commit/347c4971fcf3d4cd549134a1341f68a3f215abc2) Thanks [@lukasIO](https://github.com/lukasIO)! - Allow to specify exact constraint for room.switchActiveDevice

- [#609](https://github.com/livekit/client-sdk-js/pull/609) [`068c05e`](https://github.com/livekit/client-sdk-js/commit/068c05e757e7218e12da971e3803834e439e139e) Thanks [@lukasIO](https://github.com/lukasIO)! - Reject publish future if engine disconnects

- [#615](https://github.com/livekit/client-sdk-js/pull/615) [`505a78e`](https://github.com/livekit/client-sdk-js/commit/505a78e459808b0e73ea6737bf333de93a84e390) Thanks [@davidzhao](https://github.com/davidzhao)! - Only trigger AudioPlaybackFailed when error is NotAllowed

## 1.6.8

### Patch Changes

- [#605](https://github.com/livekit/client-sdk-js/pull/605) [`4bc4183`](https://github.com/livekit/client-sdk-js/commit/4bc41831c0da8c3c17f9afd06f9787e6004a644a) Thanks [@cnderrauber](https://github.com/cnderrauber)! - Receive remote participant disconnected updates while reconnecting

- [#592](https://github.com/livekit/client-sdk-js/pull/592) [`fea43e4`](https://github.com/livekit/client-sdk-js/commit/fea43e4de8b79176c6485a1d181467a284242b4b) Thanks [@lukasIO](https://github.com/lukasIO)! - Add support for some experimental getDisplayMedia options in ScreenShareCaptureOptions

- [#608](https://github.com/livekit/client-sdk-js/pull/608) [`5efa607`](https://github.com/livekit/client-sdk-js/commit/5efa60710096bf050ea7438312843e694a0db5fa) Thanks [@lukasIO](https://github.com/lukasIO)! - Defer publishing of tracks during reconnection

- [#597](https://github.com/livekit/client-sdk-js/pull/597) [`27dbd6a`](https://github.com/livekit/client-sdk-js/commit/27dbd6a6d8d2950d7a90bd928bd0229c4a956008) Thanks [@lukasIO](https://github.com/lukasIO)! - Add support for topics on data messages

## 1.6.7

### Patch Changes

- [#593](https://github.com/livekit/client-sdk-js/pull/593) [`f218236`](https://github.com/livekit/client-sdk-js/commit/f21823659bfe7a5e0036be705c1751e30a3611c8) Thanks [@cnderrauber](https://github.com/cnderrauber)! - Disable red by default for stereo track

- [#600](https://github.com/livekit/client-sdk-js/pull/600) [`75d7556`](https://github.com/livekit/client-sdk-js/commit/75d75562ece4b1e57c81a879440b6101599ef7ea) Thanks [@davidzhao](https://github.com/davidzhao)! - internal getter connectedServerAddress is has been changed to an async function getConnectedServerAddress

- [#595](https://github.com/livekit/client-sdk-js/pull/595) [`75776b8`](https://github.com/livekit/client-sdk-js/commit/75776b81885109ac8e2a369c2a4e7583db2406b3) Thanks [@davidzhao](https://github.com/davidzhao)! - Fixed incorrect state with resume then reconnect

- [#596](https://github.com/livekit/client-sdk-js/pull/596) [`a9aa74f`](https://github.com/livekit/client-sdk-js/commit/a9aa74f327efbbb2595f12d121e8ee4dde283d1c) Thanks [@davidzhao](https://github.com/davidzhao)! - Track.streamState defaults to active

## 1.6.6

### Patch Changes

- [#585](https://github.com/livekit/client-sdk-js/pull/585) [`0a33b1a`](https://github.com/livekit/client-sdk-js/commit/0a33b1a7fcb4cefc4e23c12bc5d9ecfe3b41b583) Thanks [@davidzhao](https://github.com/davidzhao)! - Prevent concurrent RTCRtpSender.setParameter call to avoid exception

## 1.6.5

### Patch Changes

- [#575](https://github.com/livekit/client-sdk-js/pull/575) [`b8fd583`](https://github.com/livekit/client-sdk-js/commit/b8fd583610c13d23aa9a8f3778d765e2691807dd) Thanks [@HermanBilous](https://github.com/HermanBilous)! - Provide more context to ConnectionError when connecting to a room

- [#573](https://github.com/livekit/client-sdk-js/pull/573) [`b71ec61`](https://github.com/livekit/client-sdk-js/commit/b71ec6112fd1c6ac79c8be66fd0327824ee6044a) Thanks [@cnderrauber](https://github.com/cnderrauber)! - Add reconnect reason and signal rtt calculation

- [#581](https://github.com/livekit/client-sdk-js/pull/581) [`6b35e07`](https://github.com/livekit/client-sdk-js/commit/6b35e07482249f103ca2cf186a00ca9c6ff26032) Thanks [@lukasIO](https://github.com/lukasIO)! - Only restart track after permission change if not muted

## 1.6.4

### Patch Changes

- [#566](https://github.com/livekit/client-sdk-js/pull/566) [`f06ee24`](https://github.com/livekit/client-sdk-js/commit/f06ee2439132ba4e71444d6685036df455e0d5cd) Thanks [@otakueadwine](https://github.com/otakueadwine)! - Export CheckStatus type

- [#569](https://github.com/livekit/client-sdk-js/pull/569) [`b53f5c5`](https://github.com/livekit/client-sdk-js/commit/b53f5c56751cc2bc76092af53a85ccde6ae92023) Thanks [@lukasIO](https://github.com/lukasIO)! - Emit `Participant.PermissionChanged` event also for remote participants

- [#562](https://github.com/livekit/client-sdk-js/pull/562) [`b9cd661`](https://github.com/livekit/client-sdk-js/commit/b9cd661c3adb2f8be07cc69855243b9b2dfb8098) Thanks [@kilimnik](https://github.com/kilimnik)! - Emit DeviceUnsupportedError when getDisplayMedia is not supported on a device

- [#568](https://github.com/livekit/client-sdk-js/pull/568) [`6e35f39`](https://github.com/livekit/client-sdk-js/commit/6e35f39870bf4571289ff023f69786aa7ea78d36) Thanks [@davidzhao](https://github.com/davidzhao)! - Fixed handling of unknown signal messages

- [#570](https://github.com/livekit/client-sdk-js/pull/570) [`4ee0f5a`](https://github.com/livekit/client-sdk-js/commit/4ee0f5a3bdc1c50a0f861b4dd25522af5764ff56) Thanks [@lukasIO](https://github.com/lukasIO)! - Drop local participant updates with wrong sid

## 1.6.3

### Patch Changes

- [#553](https://github.com/livekit/client-sdk-js/pull/553) [`fe08625`](https://github.com/livekit/client-sdk-js/commit/fe0862538804b7bc6f0b4f97909890cd57703d5e) Thanks [@cnderrauber](https://github.com/cnderrauber)! - add reconnect response to update configuration while reconnecting

- [#555](https://github.com/livekit/client-sdk-js/pull/555) [`0bc67ba`](https://github.com/livekit/client-sdk-js/commit/0bc67badf5c49a51b316bd201503543cbb5e96ca) Thanks [@cnderrauber](https://github.com/cnderrauber)! - Enable nack for audio track only if offer wants it

- [#559](https://github.com/livekit/client-sdk-js/pull/559) [`d88ca0a`](https://github.com/livekit/client-sdk-js/commit/d88ca0ac0d41b7d3a1e0d3da7c7c648df51b4beb) Thanks [@renovate](https://github.com/apps/renovate)! - Update dependency ua-parser-js to v1.0.33

- [#556](https://github.com/livekit/client-sdk-js/pull/556) [`100ac49`](https://github.com/livekit/client-sdk-js/commit/100ac492d7f8e2ddd0c7af5ab7fb8f43cc6683fd) Thanks [@davidliu](https://github.com/davidliu)! - Allow for internal background timer implementation to be overridden

## 1.6.2

### Patch Changes
Expand Down
22 changes: 12 additions & 10 deletions example/sample.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
createAudioAnalyser,
DataPacket_Kind,
DisconnectReason,
createE2EEKey,
LocalAudioTrack,
LocalParticipant,
LogLevel,
Expand All @@ -27,6 +26,8 @@ import {
VideoQuality,
ExternalE2EEKeyProvider,
} from '../src/index';
//@ts-ignore
import E2EEWorker from '../src/e2ee/worker/e2ee.worker?worker';

const $ = (id: string) => document.getElementById(id);

Expand All @@ -49,9 +50,7 @@ const storedToken = searchParams.get('token') ?? '';
(<HTMLInputElement>$('token')).value = storedToken;
let storedKey = searchParams.get('key');
if (!storedKey) {
const key = createE2EEKey();
console.log('created key', key);
(<HTMLSelectElement>$('crypto-key')).value = JSON.stringify(Array.from(key));
(<HTMLSelectElement>$('crypto-key')).value = 'password';
} else {
(<HTMLSelectElement>$('crypto-key')).value = storedKey;
}
Expand Down Expand Up @@ -91,7 +90,7 @@ const appActions = {
videoCaptureDefaults: {
resolution: VideoPresets.h720.resolution,
},
e2ee: { keyProvider: state.e2eeKeyProvider },
e2ee: { keyProvider: state.e2eeKeyProvider, worker: new E2EEWorker() },
};

const connectOpts: RoomConnectOptions = {
Expand Down Expand Up @@ -127,8 +126,11 @@ const appActions = {
.on(RoomEvent.DataReceived, handleData)
.on(RoomEvent.Disconnected, handleRoomDisconnect)
.on(RoomEvent.Reconnecting, () => appendLog('Reconnecting to room'))
.on(RoomEvent.Reconnected, () => {
appendLog('Successfully reconnected. server', room.engine.connectedServerAddress);
.on(RoomEvent.Reconnected, async () => {
appendLog(
'Successfully reconnected. server',
await room.engine.getConnectedServerAddress(),
);
})
.on(RoomEvent.LocalTrackPublished, (pub) => {
const track = pub.track as LocalAudioTrack;
Expand Down Expand Up @@ -198,14 +200,14 @@ const appActions = {
try {
// read and set current key from input
const cryptoKey = (<HTMLSelectElement>$('crypto-key')).value;
state.e2eeKeyProvider.setKey(Uint8Array.from(JSON.parse(cryptoKey)));
state.e2eeKeyProvider.setKey(cryptoKey);
await room.setE2EEEnabled(true);

await room.connect(url, token, connectOptions);
const elapsed = Date.now() - startTime;
appendLog(
`successfully connected to ${room.name} in ${Math.round(elapsed)}ms`,
room.engine.connectedServerAddress,
await room.engine.getConnectedServerAddress(),
);
} catch (error: any) {
let message: any = error;
Expand All @@ -232,7 +234,7 @@ const appActions = {

// read and set current key from input
const cryptoKey = (<HTMLSelectElement>$('crypto-key')).value;
state.e2eeKeyProvider.setKey(Uint8Array.from(JSON.parse(cryptoKey)));
state.e2eeKeyProvider.setKey(cryptoKey);

await currentRoom.setE2EEEnabled(!currentRoom.isE2EEEnabled);
},
Expand Down
70 changes: 40 additions & 30 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
{
"name": "livekit-client",
"version": "1.6.2",
"version": "1.6.9",
"description": "JavaScript/TypeScript client SDK for LiveKit",
"main": "./dist/livekit-client.umd.js",
"unpkg": "./dist/livekit-client.umd.js",
"module": "./dist/livekit-client.esm.mjs",
"exports": {
"types": "./dist/src/index.d.ts",
"import": "./dist/livekit-client.esm.mjs",
"require": "./dist/livekit-client.umd.js"
".": {
"types": "./dist/src/index.d.ts",
"import": "./dist/livekit-client.esm.mjs",
"require": "./dist/livekit-client.umd.js"
},
"./e2ee-worker": {
"types": "./dist/src/e2ee/worker/e2ee.worker.d.ts",
"import": "./dist/livekit-client.e2ee.worker.mjs",
"require": "./dist/livekit-client.e2ee.worker.js"
}
},
"files": [
"dist",
Expand All @@ -18,15 +25,18 @@
"typesVersions": {
"<4.8": {
"./dist/src/index.d.ts": [
"./dist/src/ts4.2/index.d.ts"
"./dist/ts4.2/src/index.d.ts"
],
"./dist/src/e2ee/worker/e2ee.worker.d.ts": [
"./dist/ts4.2//dist/src/e2ee/worker/e2ee.worker.d.ts"
]
}
},
"repository": "git@github.com:livekit/client-sdk-js.git",
"author": "David Zhao <david@davidzhao.com>",
"license": "Apache-2.0",
"scripts": {
"build": "rollup --config --bundleConfigAsCjs && yarn downlevel-dts",
"build": "rollup --config --bundleConfigAsCjs && rollup --config rollup.config.worker.js --bundleConfigAsCjs && yarn downlevel-dts",
"build:watch": "rollup --watch --config rollup.config.js",
"build-docs": "typedoc",
"proto": "protoc --plugin=node_modules/ts-proto/protoc-gen-ts_proto --ts_proto_opt=esModuleInterop=true --ts_proto_out=./src/proto --ts_proto_opt=outputClientImpl=false,useOptionals=messages,oneof=unions -I./protocol ./protocol/livekit_rtc.proto ./protocol/livekit_models.proto",
Expand All @@ -51,40 +61,40 @@
"webrtc-adapter": "^8.1.1"
},
"devDependencies": {
"@babel/core": "7.20.7",
"@babel/core": "7.21.0",
"@babel/preset-env": "7.20.2",
"@changesets/changelog-github": "0.4.8",
"@changesets/cli": "2.26.0",
"@rollup/plugin-babel": "^6.0.3",
"@rollup/plugin-commonjs": "^24.0.1",
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-node-resolve": "^15.0.1",
"@types/jest": "29.2.5",
"@rollup/plugin-babel": "6.0.3",
"@rollup/plugin-commonjs": "24.0.1",
"@rollup/plugin-json": "6.0.0",
"@rollup/plugin-node-resolve": "15.0.1",
"@rollup/plugin-terser": "^0.4.0",
"@types/jest": "29.4.0",
"@types/sdp-transform": "2.4.5",
"@types/ua-parser-js": "0.7.36",
"@types/ws": "8.5.4",
"@typescript-eslint/eslint-plugin": "5.47.1",
"@typescript-eslint/parser": "5.47.1",
"@typescript-eslint/eslint-plugin": "5.54.0",
"@typescript-eslint/parser": "5.54.0",
"downlevel-dts": "^0.11.0",
"eslint": "8.31.0",
"eslint": "8.35.0",
"eslint-config-airbnb-typescript": "17.0.0",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-import": "2.26.0",
"gh-pages": "4.0.0",
"jest": "29.3.1",
"prettier": "2.8.1",
"eslint-config-prettier": "8.6.0",
"eslint-plugin-import": "2.27.5",
"gh-pages": "5.0.0",
"jest": "29.4.3",
"prettier": "2.8.4",
"rollup": "3.18.0",
"rollup-plugin-delete": "^2.0.0",
"rollup-plugin-filesize": "^9.1.2",
"rollup-plugin-re": "^1.0.7",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.34.1",
"rollup-plugin-web-worker-loader": "^1.6.1",
"ts-jest": "29.0.3",
"ts-proto": "1.137.0",
"typedoc": "0.23.23",
"rollup-plugin-filesize": "10.0.0",
"rollup-plugin-re": "1.0.7",
"rollup-plugin-typescript2": "0.34.1",
"ts-jest": "29.0.5",
"ts-proto": "1.140.0",
"typedoc": "0.23.26",
"typedoc-plugin-no-inherit": "1.4.0",
"typescript": "4.9.4",
"vite": "4.0.4"
"typescript": "4.9.5",
"vite": "4.1.4"
},
"browserslist": [
"safari >= 11",
Expand Down
2 changes: 1 addition & 1 deletion protocol
Submodule protocol updated 59 files
+11 −8 .github/workflows/buildtest.yaml
+6 −6 .github/workflows/generate.yaml
+77 −3 auth/grants.go
+1 −2 auth/provider_test.go
+32 −1 egress/rpc.go
+39 −29 go.mod
+94 −119 go.sum
+0 −196 ingress/rpc.go
+215 −132 livekit/livekit_analytics.pb.go
+986 −806 livekit/livekit_egress.pb.go
+172 −168 livekit/livekit_egress.twirp.go
+201 −184 livekit/livekit_ingress.pb.go
+74 −71 livekit/livekit_ingress.twirp.go
+555 −208 livekit/livekit_internal.pb.go
+829 −494 livekit/livekit_models.pb.go
+78 −67 livekit/livekit_room.pb.go
+79 −77 livekit/livekit_room.twirp.go
+81 −592 livekit/livekit_rpc_internal.pb.go
+966 −555 livekit/livekit_rtc.pb.go
+16 −1 livekit_analytics.proto
+76 −63 livekit_egress.proto
+7 −6 livekit_ingress.proto
+36 −5 livekit_internal.proto
+39 −0 livekit_models.proto
+1 −0 livekit_room.proto
+6 −43 livekit_rpc_internal.proto
+41 −2 livekit_rtc.proto
+17 −5 logger/config.go
+198 −46 logger/logger.go
+46 −0 magefile.go
+35 −6 redis/redis.go
+6 −17 renovate.json
+431 −0 rpc/egress.pb.go
+51 −0 rpc/egress.proto
+261 −0 rpc/egress.psrpc.go
+36 −0 rpc/egress_client.go
+229 −0 rpc/ingress.pb.go
+29 −0 rpc/ingress.proto
+229 −0 rpc/ingress.psrpc.go
+36 −0 rpc/ingress_client.go
+347 −0 rpc/io.pb.go
+33 −0 rpc/io.proto
+154 −0 rpc/io.psrpc.go
+63 −0 rpc/race.go
+242 −0 rpc/signal.pb.go
+32 −0 rpc/signal.proto
+122 −0 rpc/signal.psrpc.go
+17 −0 rpc/typed_api.go
+33 −0 utils/codec.go
+5 −4 utils/cpu.go
+1 −1 utils/id.go
+196 −0 utils/lock_tracker.go
+241 −0 utils/lock_tracker_test.go
+2 −2 utils/messaging.go
+43 −0 utils/parallel.go
+35 −0 utils/parallel_test.go
+151 −0 utils/timed_version.go
+53 −0 utils/timed_version_test.go
+2 −2 webhook/verifier.go
34 changes: 19 additions & 15 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,40 @@ import commonjs from '@rollup/plugin-commonjs';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import { babel } from '@rollup/plugin-babel';
import json from '@rollup/plugin-json';
import { terser } from 'rollup-plugin-terser';
import terser from '@rollup/plugin-terser';
import replace from 'rollup-plugin-re';
import filesize from 'rollup-plugin-filesize';
import webWorkerLoader from 'rollup-plugin-web-worker-loader';
// import webWorkerLoader from 'rollup-plugin-web-worker-loader';
import del from 'rollup-plugin-delete';

import packageJson from './package.json';

function kebabCaseToPascalCase(string = '') {
export function kebabCaseToPascalCase(string = '') {
return string.replace(/(^\w|-\w)/g, (replaceString) =>
replaceString.replace(/-/, '').toUpperCase(),
);
}

export const commonPlugins = [
nodeResolve({ browser: true, preferBuiltins: false }),
typescript({ tsconfig: './tsconfig.json' }),
commonjs(),
json(),
// webWorkerLoader({ extensions: ['.js', '.ts'], pattern: /(.+)\?worker/ }),
babel({
babelHelpers: 'bundled',
plugins: ['@babel/plugin-proposal-object-rest-spread'],
presets: ['@babel/preset-env'],
extensions: ['.js', '.ts', '.mjs'],
}),
];

export default {
input: 'src/index.ts',
output: [
{
file: `dist/${packageJson.name}.esm.mjs`,
format: 'esm',
format: 'es',
strict: true,
sourcemap: true,
},
Expand All @@ -37,17 +51,7 @@ export default {
],
plugins: [
del({ targets: 'dist/*' }),
nodeResolve({ browser: true, preferBuiltins: false }),
typescript({ tsconfig: './tsconfig.json' }),
commonjs(),
json(),
webWorkerLoader({ extensions: ['.js', '.ts'], pattern: /(.+)\?worker/ }),
babel({
babelHelpers: 'bundled',
plugins: ['@babel/plugin-proposal-object-rest-spread'],
presets: ['@babel/preset-env'],
extensions: ['.js', '.ts', '.mjs'],
}),
...commonPlugins,
replace({
patterns: [
{
Expand Down
25 changes: 25 additions & 0 deletions rollup.config.worker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import terser from '@rollup/plugin-terser';
import filesize from 'rollup-plugin-filesize';
import packageJson from './package.json';
import { commonPlugins, kebabCaseToPascalCase } from './rollup.config';

export default {
input: 'src/e2ee/worker/e2ee.worker.ts',
output: [
{
file: `dist/${packageJson.name}.e2ee.worker.mjs`,
format: 'es',
strict: true,
sourcemap: true,
},
{
file: `dist/${packageJson.name}.e2ee.worker.js`,
format: 'umd',
strict: true,
sourcemap: true,
name: kebabCaseToPascalCase(packageJson.name) + '.e2ee.worker',
plugins: [terser()],
},
],
plugins: [...commonPlugins, filesize()],
};
Loading

0 comments on commit 329c928

Please sign in to comment.