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/sharp-kids-open.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@livekit/react-native': patch
---

Fix metro warning on invalid path configuration in package.json
5 changes: 5 additions & 0 deletions .changeset/tough-cities-make.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@livekit/react-native': patch
---

Polyfill for DOMException to handle usage in livekit-client
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
"name": "@livekit/react-native",
"version": "2.10.0",
"description": "LiveKit for React Native",
"main": "lib/commonjs/index",
"module": "lib/module/index",
"main": "lib/commonjs/index.js",
"module": "lib/module/index.js",
"types": "lib/typescript/src/index.d.ts",
"exports": {
".": {
"source": "./src/index.tsx",
"types": "./lib/typescript/src/index.d.ts",
"default": "./lib/commonjs/index"
"default": "./lib/commonjs/index.js"
}
},
"react-native": "src/index",
Expand Down
1 change: 1 addition & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'well-known-symbols/Symbol.asyncIterator/auto';
import 'well-known-symbols/Symbol.iterator/auto';
import './polyfills/MediaRecorderShim';
import './polyfills/DOMException';
import { registerGlobals as webrtcRegisterGlobals } from '@livekit/react-native-webrtc';
import { setupURLPolyfill } from 'react-native-url-polyfill';
import './polyfills/EncoderDecoderTogether.min.js';
Expand Down
21 changes: 21 additions & 0 deletions src/polyfills/DOMException.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* DOMException is missing in some React Native / JS runtimes but is required by
* web APIs (e.g. AbortController, fetch) that may be used in livekit-client.
*/

// @ts-expect-error: global may not declare DOMException in RN types.
if (typeof global.DOMException === 'undefined') {
class PolyfillDOMException extends Error {
readonly code: number;

constructor(message = '', name?: string) {
super(message);
this.message = message;
this.name = name ?? 'Error';
this.code = 0;
Object.setPrototypeOf(this, PolyfillDOMException.prototype);
}
};
// @ts-expect-error
global.DOMException = PolyfillDOMException;
}
Loading