Skip to content

Commit 1c54bff

Browse files
Update to React 19 (and get rid of some dependencies) (#1269)
This updates Studio to use React 19. See commit descriptions for additional information. Test deployments: https://test.studio.opencast.org
2 parents 020b9c7 + ec71c01 commit 1c54bff

File tree

16 files changed

+99
-135
lines changed

16 files changed

+99
-135
lines changed

package-lock.json

Lines changed: 55 additions & 93 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,27 +26,27 @@
2626
"@fontsource-variable/roboto-flex": "^5.2.8",
2727
"@fontsource-variable/vazirmatn": "^5.2.8",
2828
"@iarna/toml": "^2.2.5",
29-
"@opencast/appkit": "^0.4.1",
29+
"@opencast/appkit": "^0.5.0",
3030
"@svgr/webpack": "^8.1.0",
3131
"babel-loader": "^10.0.0",
3232
"copy-webpack-plugin": "^13.0.1",
3333
"deepmerge": "^4.3.1",
3434
"fast-deep-equal": "^3.1.3",
35+
"focus-trap-react": "^11.0.4",
3536
"html-webpack-plugin": "^5.6.4",
3637
"i18next": "^25.5.2",
3738
"i18next-browser-languagedetector": "^8.2.0",
3839
"is-plain-object": "^5.0.0",
3940
"mustache": "^4.2.0",
4041
"oscilloscope": "^1.3.0",
41-
"react": "^18.3.1",
42-
"react-beforeunload": "^2.6.0",
43-
"react-dom": "^18.3.1",
42+
"react": "^19.2.0",
43+
"react-dom": "^19.2.0",
4444
"react-hook-form": "^7.63.0",
4545
"react-hotkeys-hook": "^5.1.0",
4646
"react-i18next": "^16.0.0",
4747
"react-icons": "^5.5.0",
48+
"react-merge-refs": "^3.0.2",
4849
"react-select": "^5.10.2",
49-
"use-resize-observer": "^9.1.0",
5050
"webm-duration-fix": "^1.0.4",
5151
"webpack": "^5.102.0",
5252
"webpack-cli": "^6.0.1"
@@ -57,9 +57,9 @@
5757
"@types/iarna__toml": "^2.0.5",
5858
"@types/mustache": "^4.2.6",
5959
"@types/node": "^24.6.1",
60-
"@types/react": "^18.3.23",
60+
"@types/react": "^19.2.0",
6161
"@types/react-beforeunload": "^2.1.5",
62-
"@types/react-dom": "^18.3.7",
62+
"@types/react-dom": "^19.2.0",
6363
"@types/react-page-visibility": "^6.4.4",
6464
"@typescript-eslint/eslint-plugin": "^8.45.0",
6565
"eslint": "^9.33.0",

src/App.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { ColorSchemeProvider } from "@opencast/appkit";
2-
import { useBeforeunload } from "react-beforeunload";
1+
import { ColorSchemeProvider, useUnloadBlocker } from "@opencast/appkit";
32

43
import { Root } from "./layout";
54
import { GlobalStyle } from "./ui/global-style";
@@ -24,11 +23,7 @@ const PreventClose = () => {
2423
const uploaded = upload.state === "uploaded";
2524
const uploading = upload.state === "uploading";
2625

27-
useBeforeunload(event => {
28-
if ((recordings?.length > 0 && !uploaded && !downloaded) || uploading) {
29-
event.preventDefault();
30-
}
31-
});
26+
useUnloadBlocker((recordings?.length > 0 && !uploaded && !downloaded) || uploading);
3227

3328
return null;
3429
};

src/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from "react";
1+
import React, { JSX } from "react";
22
import ReactDOM from "react-dom/client";
33
import { notNullish } from "@opencast/appkit";
44

0 commit comments

Comments
 (0)