Skip to content

Commit ec71c01

Browse files
Update to React 19
This includes an update to appkit 0.5, using its `useUnloadBlocker`. This commit does not use any new React features, it just does the update so that everything works. Figuring out whether code can be improved by new features can be done later.
1 parent 925cebb commit ec71c01

File tree

17 files changed

+85
-112
lines changed

17 files changed

+85
-112
lines changed

package-lock.json

Lines changed: 55 additions & 63 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 & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,26 @@
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-dom": "^18.3.1",
42+
"react": "^19.2.0",
43+
"react-dom": "^19.2.0",
4344
"react-hook-form": "^7.63.0",
4445
"react-hotkeys-hook": "^5.1.0",
4546
"react-i18next": "^16.0.0",
4647
"react-icons": "^5.5.0",
48+
"react-merge-refs": "^3.0.2",
4749
"react-select": "^5.10.2",
4850
"webm-duration-fix": "^1.0.4",
4951
"webpack": "^5.102.0",
@@ -55,9 +57,9 @@
5557
"@types/iarna__toml": "^2.0.5",
5658
"@types/mustache": "^4.2.6",
5759
"@types/node": "^24.6.1",
58-
"@types/react": "^18.3.23",
60+
"@types/react": "^19.2.0",
5961
"@types/react-beforeunload": "^2.1.5",
60-
"@types/react-dom": "^18.3.7",
62+
"@types/react-dom": "^19.2.0",
6163
"@types/react-page-visibility": "^6.4.4",
6264
"@typescript-eslint/eslint-plugin": "^8.45.0",
6365
"eslint": "^9.33.0",

src/App.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import { ColorSchemeProvider } from "@opencast/appkit";
1+
import { ColorSchemeProvider, useUnloadBlocker } from "@opencast/appkit";
22

33
import { Root } from "./layout";
44
import { GlobalStyle } from "./ui/global-style";
55
import { useStudioState } from "./studio-state";
6-
import { useUnloadBlocker } from "./util";
76

87

98

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

src/layout/header.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
screenWidthAtMost, match,
66
} from "@opencast/appkit";
77
import { useTranslation } from "react-i18next";
8-
import React, { forwardRef } from "react";
8+
import React, { forwardRef, JSX } from "react";
99

1010
import { DEFINES } from "../defines";
1111
import KeyboardIcon from "../icons/keyboard.svg";
@@ -24,7 +24,7 @@ export const Header: React.FC<Props> = ({ setOverlayBoxState, inert }) => {
2424
const { scheme, isHighContrast } = useColorScheme();
2525

2626
return (
27-
<header {...{ inert: inert ? "" : null }} css={{
27+
<header {...{ inert }} css={{
2828
backgroundColor: match(scheme, {
2929
"light": () => COLORS.neutral60,
3030
"dark": () => COLORS.neutral20,

src/steps/audio-setup/mic-preview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useEffect, useId, useRef } from "react";
1+
import { JSX, useEffect, useId, useRef } from "react";
22
import { useTranslation } from "react-i18next";
33
import Oscilloscope from "oscilloscope";
44
import { Spinner, useColorScheme } from "@opencast/appkit";

src/steps/elements.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Floating, FloatingContainer, FloatingTrigger, ProtoButton, match, useCo
22
import { useTranslation } from "react-i18next";
33
import { FiChevronLeft, FiChevronRight } from "react-icons/fi";
44
import { CSSObject } from "@emotion/react";
5-
import { useState } from "react";
5+
import { JSX, useState } from "react";
66

77
import { COLORS, focusStyle } from "../util";
88
import { SHORTCUTS, ShortcutKeys, useShortcut, useShowAvailableShortcuts } from "../shortcuts";

src/steps/finish/upload.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { HTMLInputTypeAttribute, useEffect, useId, useRef, useState } from "react";
1+
import { HTMLInputTypeAttribute, JSX, useEffect, useId, useRef, useState } from "react";
22
import { Trans, useTranslation } from "react-i18next";
33
import Select, { CSSObjectWithLabel, SelectInstance } from "react-select";
44
import {

src/steps/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useState } from "react";
1+
import { JSX, useState } from "react";
22
import { useTranslation } from "react-i18next";
33
import { match, notNullish, screenWidthAbove, screenWidthAtMost, useColorScheme } from "@opencast/appkit";
44
import { FiCircle } from "react-icons/fi";
@@ -38,7 +38,7 @@ export const Main: React.FC<Props> = ({ inert }) => {
3838
};
3939

4040
return (
41-
<main {...{ inert: inert ? "" : null }} css={{
41+
<main {...{ inert }} css={{
4242
display: "flex",
4343
flex: 1,
4444
backgroundColor: COLORS.neutral10,

0 commit comments

Comments
 (0)