Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Chakra UI/React #1114

Merged
merged 55 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
7a90616
Upgrade Chakra UI/React.
microbit-matt-hillsdon Mar 6, 2023
1eaa63e
Use matching theme (temporarily from branch)
microbit-matt-hillsdon Mar 6, 2023
e64f165
React 18, but skip the strict mode.
microbit-matt-hillsdon Mar 6, 2023
f431405
Sidebar is back!
microbit-matt-hillsdon Mar 10, 2023
917b48f
Fix unmounted hook.
microbit-matt-hillsdon Mar 10, 2023
d876908
Fix deps of Chakra UI.
microbit-matt-hillsdon Mar 10, 2023
3375749
disabled -> isDisabled for Chakra components
microbit-matt-hillsdon Mar 10, 2023
b19d31d
e2e fixes
microbit-matt-hillsdon Mar 10, 2023
f99fd77
Fix drop test code.
microbit-matt-hillsdon Mar 10, 2023
d8a508e
Remove debug.
microbit-matt-hillsdon Mar 10, 2023
3a1ae2e
More e2e fixes.
microbit-matt-hillsdon Mar 10, 2023
bbb87f5
More e2e.
microbit-matt-hillsdon Mar 12, 2023
d0a7971
Dependency faff.
microbit-matt-hillsdon Mar 12, 2023
be774de
Merge branch 'main' into chakra-upgrade
microbit-robert May 15, 2023
6aa4cac
Fix type error
microbit-robert May 15, 2023
d6553f8
Dubious change to fix e2e tests
microbit-robert May 17, 2023
605ee5a
Revert "Dubious change to fix e2e tests"
microbit-robert May 17, 2023
6216365
This helps with some unrelated failures.
microbit-matt-hillsdon May 18, 2023
3aa8bc2
Defensiveness.
microbit-matt-hillsdon May 19, 2023
8795f08
Pin puppeteer to version before these changes.
microbit-matt-hillsdon May 19, 2023
0a89ceb
Drop the networkidle options.
microbit-matt-hillsdon May 19, 2023
e3f0234
Visual fix. Unrelated to e2e.
microbit-matt-hillsdon May 19, 2023
d79b559
Allow time for indexing to complete.
microbit-matt-hillsdon May 19, 2023
612afd0
Wait for button to be available.
microbit-matt-hillsdon May 19, 2023
e13a1db
Fix timing issue.
microbit-matt-hillsdon May 19, 2023
eddda00
Tweaks for things that aren't ready yet.
microbit-matt-hillsdon May 19, 2023
e7b5884
Note re macs.
microbit-matt-hillsdon May 19, 2023
4931f74
Lint warnings in tests.
microbit-matt-hillsdon May 19, 2023
2f60cb3
Upgrade testing-lib.
microbit-matt-hillsdon May 19, 2023
24cd7ea
testing-utils lint fixes.
microbit-matt-hillsdon May 19, 2023
2046abd
Upgrade theme library + fix types.
microbit-matt-hillsdon May 19, 2023
d71ba52
Bump an initial find timeout.
microbit-matt-hillsdon May 19, 2023
82b1b75
Apply suggestions from code review
microbit-matt-hillsdon May 19, 2023
5f1d909
Merge branch 'main' into chakra-upgrade
microbit-matt-hillsdon May 19, 2023
c4d2e41
Update package lock.
microbit-matt-hillsdon May 19, 2023
bec4b5e
Note re Mac support.
microbit-matt-hillsdon May 21, 2023
936b91c
Merge branch 'chakra-upgrade' of github.com:microbit-foundation/pytho…
microbit-matt-hillsdon May 22, 2023
d327bdf
Reinstate padding before CM upgrade.
microbit-matt-hillsdon May 22, 2023
fea39a8
Upgrade Chakra UI etc.
microbit-matt-hillsdon Jun 2, 2023
c112293
Merge branch 'main' into chakra-upgrade
microbit-matt-hillsdon Mar 4, 2024
fa3686f
Snapshot changes
microbit-matt-hillsdon Mar 4, 2024
6e731f8
Add babel package we're nagged about
microbit-matt-hillsdon Mar 4, 2024
5364c15
Version with fewer issues
microbit-matt-hillsdon Mar 4, 2024
87e9b53
Tweak to match pre-upgrade style
microbit-matt-hillsdon Mar 4, 2024
acdf541
Focus workaround
microbit-matt-hillsdon Mar 4, 2024
a4ebd10
Simplify focus handling
microbit-matt-hillsdon Mar 4, 2024
810d3cd
Fix imports
microbit-matt-hillsdon Mar 4, 2024
849f933
Fixed theme package
microbit-matt-hillsdon Mar 5, 2024
f5c6ff3
Move theme typings to postinstall
microbit-matt-hillsdon Mar 5, 2024
f344eac
Use the last working version of react-focus-lock
microbit-matt-hillsdon Mar 5, 2024
ae392a0
Update theme package to merged version
microbit-matt-hillsdon Mar 5, 2024
813b0d6
Upgrade again, for focus-lock fix
microbit-matt-hillsdon Mar 6, 2024
68921b8
Upgrade after removing explicit dep
microbit-matt-hillsdon Mar 6, 2024
cf1ca98
Stop using resize observer for sim split height
microbit-robert Mar 6, 2024
6c34c0c
Remove my from slider to match deployed version
microbit-robert Mar 6, 2024
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
36,160 changes: 15,218 additions & 20,942 deletions package-lock.json

Large diffs are not rendered by default.

17 changes: 8 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"license": "MIT",
"private": true,
"dependencies": {
"@chakra-ui/icons": "^1.1.5",
"@chakra-ui/react": "^1.8.7",
"@chakra-ui/icons": "^2.0.0",
"@chakra-ui/react": "^2.0.0",
"@codemirror/autocomplete": "^6.3.0",
"@codemirror/commands": "6.1.1",
"@codemirror/lang-python": "^6.0.2",
Expand All @@ -17,7 +17,6 @@
"@emotion/styled": "^11.6.0",
"@microbit/lunr-languages": "^1.9.0-microbit.1",
"@microbit/microbit-fs": "^0.9.2",
"@react-three/fiber": "^7.0.27",
"@sanity/block-content-to-react": "^3.0.0",
"@sanity/image-url": "^1.0.1",
"@testing-library/jest-dom": "^5.14.1",
Expand All @@ -29,8 +28,8 @@
"@types/lunr": "^2.3.4",
"@types/marked": "^4.0.1",
"@types/node": "^14.17.15",
"@types/react": "^17.0.20",
"@types/react-dom": "^17.0.9",
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
"base64-js": "^1.5.1",
"crelt": "^1.0.5",
"dapjs": "2.2.0",
Expand All @@ -43,12 +42,12 @@
"lzma": "^2.3.2",
"marked": "^4.0.15",
"mobile-drag-drop": "^2.3.0-rc.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-icons": "^4.2.0",
"react-intl": "^5.20.10",
"react-intl": "^6.2.10",
"vscode-jsonrpc": "^6.0.0",
"vscode-languageserver-protocol": "^3.16.0",
"vscode-languageserver-protocol": "3.16.0",
"web-vitals": "^1.1.1",
"xterm": "4.14.1",
"xterm-addon-fit": "^0.5.0"
Expand Down
4 changes: 2 additions & 2 deletions src/common/VisualViewportCSSVariables.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const VisualViewPortCSSVariables = () => {
return;
}
const resizeHandler = () => {
const { width, height } = window.visualViewport;
const { width, height } = window.visualViewport!;
let style = document.getElementById(styleId);
if (!style) {
style = document.head.appendChild(document.createElement("style"));
Expand All @@ -39,7 +39,7 @@ const VisualViewPortCSSVariables = () => {
window.visualViewport.addEventListener("resize", resizeHandler);
resizeHandler();
return () => {
window.visualViewport.removeEventListener("resize", resizeHandler);
window.visualViewport?.removeEventListener("resize", resizeHandler);
const style = document.getElementById(styleId);
if (style) {
style.remove();
Expand Down
2 changes: 1 addition & 1 deletion src/common/use-storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type storageType = "local" | "session";
/**
* Local and session storage-backed state (via JSON serialization).
*/
export function useStorage<T>(
export function useStorage<T extends object>(
storageType: storageType,
key: string,
defaultValue: T,
Expand Down
2 changes: 1 addition & 1 deletion src/deployment/default/components/alert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const Alert = {
variants: {
toast: (props: any) => {
const base = {
...theme.components.Alert.variants["solid"](props),
...theme.components.Alert.variants!["solid"](props),
};
return base;
},
Expand Down
4 changes: 2 additions & 2 deletions src/deployment/default/components/button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const Button = {
// Ideally we'd drop this variant.
zoom: (props: any) => {
// Theme typing issue.
const base: any = theme.components.Button.variants.solid(props);
microbit-matt-hillsdon marked this conversation as resolved.
Show resolved Hide resolved
const base: any = theme.components.Button.variants!.solid(props);
return {
...base,
_hover: {
Expand All @@ -26,7 +26,7 @@ const Button = {
sidebar: (props: any) => {
// Theme typing issue.
const base: any = {
...theme.components.Button.variants.ghost(props),
...theme.components.Button.variants!.ghost(props),
};
return {
...base,
Expand Down
2 changes: 1 addition & 1 deletion src/deployment/default/components/tabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const Tabs = {
variants: {
sidebar: (props: any) => {
// Theme typing issue.
const base = (theme.components.Tabs.variants["solid-rounded"] as any)(
const base = (theme.components.Tabs.variants!["solid-rounded"] as any)(
props
);
return {
Expand Down
4 changes: 2 additions & 2 deletions src/project/SendButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
ThemeTypings,
Tooltip,
} from "@chakra-ui/react";
import React, { ForwardedRef, useCallback, useRef } from "react";
import React, { FocusEvent, ForwardedRef, useCallback, useRef } from "react";
import { RiUsbLine } from "react-icons/ri";
import { FormattedMessage, useIntl } from "react-intl";
import { zIndexAboveTerminal } from "../common/zIndex";
Expand Down Expand Up @@ -67,7 +67,7 @@ const SendButton = React.forwardRef(
}
}, [flashing, actions, sendButtonRef]);
const handleFocus = useCallback(
(e) => {
(e: FocusEvent<unknown>) => {
const inProgress = flashing.current.flashing;
const delta = new Date().getTime() - flashing.current.lastCompleteFlash;
if (inProgress || delta < 200) {
Expand Down
1 change: 1 addition & 0 deletions src/simulator/DataLoggingModule.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { DataLog } from "../device/simulator";
import { useLogging } from "../logging/logging-hooks";
import { useDataLog } from "./data-logging-hooks";
import { useAutoScrollToBottom } from "./scroll-hooks";
import { saveAs } from "file-saver";

export interface DataLoggingModuleProps {
icon: ReactNode;
Expand Down
6 changes: 3 additions & 3 deletions src/simulator/RadioModule.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import {
Stack,
Text,
VisuallyHidden,
VStack
VStack,
} from "@chakra-ui/react";
import { ReactNode, useCallback, useState } from "react";
import { FormEvent, ReactNode, useCallback, useState } from "react";
import { RiSendPlane2Line } from "react-icons/ri";
import { FormattedMessage, useIntl } from "react-intl";
import { ReactComponent as MessageIcon } from "./icons/microbit-face-icon.svg";
Expand Down Expand Up @@ -155,7 +155,7 @@ const MessageComposer = ({
});
const [message, setMessage] = useState<string>("");
const handleSendMessage = useCallback(
(e) => {
(e: FormEvent<unknown>) => {
e.preventDefault();
onSend(message);
setMessage("");
Expand Down