Remove livekit-client from the list of external dependencies

This commit is contained in:
Timo K.
2026-10-07 12:01:21 +02:00
parent cde88a7c93
commit b408610277
5 changed files with 12 additions and 7 deletions
+3 -2
View File
@@ -306,9 +306,10 @@ directory target it rather than the repository; run them from the repository
root. The host imports the component from root. The host imports the component from
`@element-hq/element-call-component` and the stylesheet from `@element-hq/element-call-component` and the stylesheet from
`@element-hq/element-call-component/style.css`, and has to provide `react`, `@element-hq/element-call-component/style.css`, and has to provide `react`,
`react-dom`, `matrix-js-sdk`, `livekit-client`, `@vector-im/compound-web` and `react-dom`, `matrix-js-sdk`, `@vector-im/compound-web` and
`@vector-im/compound-design-tokens` itself, since the bundle leaves them `@vector-im/compound-design-tokens` itself, since the bundle leaves them
external. Compound's stylesheet are the host's to load too: the component shares external.
Compound's stylesheet are the host's to load too: the component shares
the host's copy of Compound, (required for example for tooltips) the host's copy of Compound, (required for example for tooltips)
The component is large, and a host will usually load it lazily, only once a The component is large, and a host will usually load it lazily, only once a
-1
View File
@@ -40,7 +40,6 @@
"peerDependencies": { "peerDependencies": {
"@vector-im/compound-design-tokens": "^11.0.0", "@vector-im/compound-design-tokens": "^11.0.0",
"@vector-im/compound-web": "^10.0.0", "@vector-im/compound-web": "^10.0.0",
"livekit-client": "^2.18.1",
"matrix-js-sdk": "*", "matrix-js-sdk": "*",
"react": "^19", "react": "^19",
"react-dom": "^19" "react-dom": "^19"
+3 -1
View File
@@ -76,8 +76,10 @@ Code that builds in only one is a bug.
- `build:component` — `@element-hq/element-call-component`, sources in `component/` - `build:component` — `@element-hq/element-call-component`, sources in `component/`
(its own pnpm project; run pnpm from the repo root). Host API is in the README; (its own pnpm project; run pnpm from the repo root). Host API is in the README;
`pnpm lint:externals` rejects an import of a `react` / `react-dom` / `pnpm lint:externals` rejects an import of a `react` / `react-dom` /
`matrix-js-sdk` / `livekit-client` / `@vector-im/compound-web` / `matrix-js-sdk` / `@vector-im/compound-web` /
`@vector-im/compound-design-tokens` subpath the externals list omits. `@vector-im/compound-design-tokens` subpath the externals list omits.
`livekit-client` is bundled on purpose: no host imports it, and the pinned
version travels with the component.
Compound's stylesheets are loaded by `src/index.css` for the page and by the Compound's stylesheets are loaded by `src/index.css` for the page and by the
host for the component, never by `src/base.css`. Two entry host for the component, never by `src/base.css`. Two entry
points: `index.tsx` (the component) and `api.ts` (types, enums and points: `index.tsx` (the component) and `api.ts` (types, enums and
+1 -2
View File
@@ -9,7 +9,7 @@ Please see LICENSE in the repository root for full details.
* Checks that the component build leaves the packages a host must supply to * Checks that the component build leaves the packages a host must supply to
* the host. * the host.
* *
* A host application already has React, the Matrix SDK, LiveKit and Compound, * A host application already has React, the Matrix SDK and Compound,
* and a second copy of any of them is worse than dead weight: React would hold * and a second copy of any of them is worse than dead weight: React would hold
* two sets of hooks, the Matrix client would run two sync loops, and a second * two sets of hooks, the Matrix client would run two sync loops, and a second
* Compound would style the tooltips it floats into the host's body with class * Compound would style the tooltips it floats into the host's body with class
@@ -44,7 +44,6 @@ const MUST_BE_EXTERNAL = [
"react", "react",
"react-dom", "react-dom",
"matrix-js-sdk", "matrix-js-sdk",
"livekit-client",
"@vector-im/compound-web", "@vector-im/compound-web",
"@vector-im/compound-design-tokens", "@vector-im/compound-design-tokens",
]; ];
+5 -1
View File
@@ -72,6 +72,11 @@ export default defineConfig(({ mode }) => {
// host's Compound stylesheet only when the two happened to be the same // host's Compound stylesheet only when the two happened to be the same
// version. // version.
// //
// LiveKit is deliberately not in this list. No host imports
// `livekit-client` itself, so bundling it duplicates nothing, and the
// exact version Element Call was tested against travels with it instead
// of being something every host has to pin and keep in step.
//
// Every subpath has to be named. Element Call reaches most of the Matrix // Every subpath has to be named. Element Call reaches most of the Matrix
// SDK as `matrix-js-sdk/lib/…`, and a bare "matrix-js-sdk" would not // SDK as `matrix-js-sdk/lib/…`, and a bare "matrix-js-sdk" would not
// catch those — while the pattern and callback forms of this option are // catch those — while the pattern and callback forms of this option are
@@ -88,7 +93,6 @@ export default defineConfig(({ mode }) => {
"react/compiler-runtime", "react/compiler-runtime",
"react-dom", "react-dom",
"react-dom/client", "react-dom/client",
"livekit-client",
"matrix-js-sdk", "matrix-js-sdk",
"matrix-js-sdk/lib/browser-index", "matrix-js-sdk/lib/browser-index",
"matrix-js-sdk/lib/client", "matrix-js-sdk/lib/client",