Skip to content

Commit eda3870

Browse files
committed
Updated packages to react 19
1 parent 79e7dd5 commit eda3870

File tree

111 files changed

+15863
-10321
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+15863
-10321
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
"svgo": "lerna run svgo --parallel"
3333
},
3434
"dependencies": {
35-
"react": "^17.0.2",
36-
"react-dom": "^17.0.2"
35+
"react": "^19.1",
36+
"react-dom": "^19.1"
3737
},
3838
"devDependencies": {
3939
"lerna": "^7.1.4",

packages/analytics/package.json

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
"@monkvision/types": "5.1.4"
3232
},
3333
"peerDependencies": {
34-
"react": "^17.0.2",
35-
"react-dom": "^17.0.2"
34+
"react": "^19.1",
35+
"react-dom": "^19.1"
3636
},
3737
"devDependencies": {
3838
"@monkvision/eslint-config-base": "5.1.4",
@@ -41,10 +41,9 @@
4141
"@monkvision/jest-config": "5.1.4",
4242
"@monkvision/prettier-config": "5.1.4",
4343
"@monkvision/typescript-config": "5.1.4",
44-
"@testing-library/react": "^12.1.5",
45-
"@testing-library/react-hooks": "^8.0.1",
44+
"@testing-library/react": "^16.3.0",
4645
"@types/jest": "^29.2.2",
47-
"@types/node": "^18.11.9",
46+
"@types/node": "^24.5.2",
4847
"@typescript-eslint/eslint-plugin": "^5.43.0",
4948
"@typescript-eslint/parser": "^5.43.0",
5049
"eslint": "^8.29.0",
@@ -60,13 +59,13 @@
6059
"eslint-plugin-react": "^7.27.1",
6160
"eslint-plugin-react-hooks": "^4.3.0",
6261
"eslint-utils": "^3.0.0",
63-
"jest": "^29.3.1",
62+
"jest": "^29.6",
6463
"mkdirp": "^1.0.4",
6564
"prettier": "^2.7.1",
6665
"regexpp": "^3.2.0",
6766
"rimraf": "^3.0.2",
6867
"ts-jest": "^29.0.3",
69-
"typescript": "^4.8.4"
68+
"typescript": "^5.9.2"
7069
},
7170
"prettier": "@monkvision/prettier-config",
7271
"publishConfig": {

packages/camera-web/package.json

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
},
3838
"peerDependencies": {
3939
"@auth0/auth0-react": "^2.2.4",
40-
"react": "^17.0.2",
41-
"react-dom": "^17.0.2",
40+
"react": "^19.1",
41+
"react-dom": "^19.1",
4242
"react-router-dom": "^6.22.3"
4343
},
4444
"devDependencies": {
@@ -49,11 +49,10 @@
4949
"@monkvision/prettier-config": "5.1.4",
5050
"@monkvision/test-utils": "5.1.4",
5151
"@monkvision/typescript-config": "5.1.4",
52-
"@testing-library/react": "^12.1.5",
53-
"@testing-library/react-hooks": "^8.0.1",
52+
"@testing-library/react": "^16.3.0",
5453
"@types/fscreen": "^1.0.1",
5554
"@types/jest": "^29.2.2",
56-
"@types/node": "^18.11.9",
55+
"@types/node": "^24.5.2",
5756
"@typescript-eslint/eslint-plugin": "^5.43.0",
5857
"@typescript-eslint/parser": "^5.43.0",
5958
"eslint": "^8.29.0",
@@ -69,14 +68,14 @@
6968
"eslint-plugin-react": "^7.27.1",
7069
"eslint-plugin-react-hooks": "^4.3.0",
7170
"eslint-utils": "^3.0.0",
72-
"jest": "^29.3.1",
71+
"jest": "^29.6",
7372
"jest-environment-jsdom": "^29.6.2",
7473
"mkdirp": "^1.0.4",
7574
"prettier": "^2.7.1",
7675
"regexpp": "^3.2.0",
7776
"rimraf": "^3.0.2",
7877
"ts-jest": "^29.0.3",
79-
"typescript": "^4.8.4"
78+
"typescript": "^5.9.2"
8079
},
8180
"prettier": "@monkvision/prettier-config",
8281
"publishConfig": {

packages/camera-web/src/Camera/hooks/useCameraCanvas.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export interface CameraCanvasHandle {
2828
/**
2929
* The ref to the canvas element. Forward this ref to the <canvas> tag to set it up.
3030
*/
31-
ref: RefObject<HTMLCanvasElement>;
31+
ref: RefObject<HTMLCanvasElement | null>;
3232
/**
3333
* The dimensions of the canvas.
3434
*/

packages/camera-web/src/Camera/hooks/useCameraPreview.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export interface CameraPreviewHandle extends UserMediaResult {
1616
/**
1717
* React MutableRefObject referencing the video element displaying the camera preview.
1818
*/
19-
ref: RefObject<HTMLVideoElement>;
19+
ref: RefObject<HTMLVideoElement | null>;
2020
}
2121

2222
/**

packages/camera-web/src/Camera/hooks/useCameraScreenshot.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ export interface CameraScreenshotConfig {
1515
/**
1616
* The ref to the video element to take screenshots of.
1717
*/
18-
videoRef: RefObject<HTMLVideoElement>;
18+
videoRef: RefObject<HTMLVideoElement | null>;
1919
/**
2020
* The ref to the canvas element used to draw the screenshots
2121
*/
22-
canvasRef: RefObject<HTMLCanvasElement>;
22+
canvasRef: RefObject<HTMLCanvasElement | null>;
2323
/**
2424
* The dimensions of the screenshot.
2525
*/

packages/camera-web/src/Camera/hooks/useCompression.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export interface UseCompressionParams {
1616
/**
1717
* The ref to the canvas element used to draw and compress the image.
1818
*/
19-
canvasRef: RefObject<HTMLCanvasElement>;
19+
canvasRef: RefObject<HTMLCanvasElement | null>;
2020
/**
2121
* The compression options.
2222
*/
@@ -72,7 +72,7 @@ function setCustomMeasurements(
7272

7373
function compressUsingBrowser(
7474
image: ImageData,
75-
canvasRef: RefObject<HTMLCanvasElement>,
75+
canvasRef: RefObject<HTMLCanvasElement | null>,
7676
options: CompressionOptions,
7777
): Promise<MonkPicture> {
7878
const { canvas, context } = getCanvasHandle(canvasRef);

packages/camera-web/src/Camera/hooks/useUserMedia.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ function getStreamDimensions(stream: MediaStream, checkOrientation: boolean): Pi
201201
*/
202202
export function useUserMedia(
203203
constraints: MediaStreamConstraints,
204-
videoRef: RefObject<HTMLVideoElement> | null,
204+
videoRef: RefObject<HTMLVideoElement | null> | null,
205205
): UserMediaResult {
206206
const streamRef = useRef<MediaStream | null>(null);
207207
const [stream, setStream] = useState<MediaStream | null>(null);
@@ -261,10 +261,6 @@ export function useUserMedia(
261261

262262
const getUserMedia = useCallback(async () => {
263263
setIsLoading(true);
264-
if (stream) {
265-
stream.removeEventListener('inactive', onStreamInactive);
266-
stream.getTracks().forEach((track) => track.stop());
267-
}
268264
const deviceDetails = await analyzeCameraDevices(constraints);
269265
const updatedConstraints = {
270266
...constraints,
@@ -336,6 +332,7 @@ export function useUserMedia(
336332

337333
useEffect(() => {
338334
return () => {
335+
streamRef.current?.removeEventListener('inactive', onStreamInactive);
339336
streamRef.current?.getTracks().forEach((track) => {
340337
track.stop();
341338
});

packages/camera-web/src/Camera/hooks/utils/getCanvasHandle.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export interface CanvasHandle {
1818
* Utility function used to retreive a canvas handle or throw if it is not available.
1919
*/
2020
export function getCanvasHandle(
21-
ref: RefObject<HTMLCanvasElement>,
21+
ref: RefObject<HTMLCanvasElement | null>,
2222
onError?: (err: Error) => void,
2323
): CanvasHandle {
2424
if (!ref.current) {

packages/camera-web/test/Camera/Camera.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { createRef } from 'react';
1+
import { createRef } from 'react';
22

33
Object.defineProperty(HTMLMediaElement.prototype, 'muted', {
44
set: () => {},

0 commit comments

Comments
 (0)