Skip to content

Commit

Permalink
Bump React and related dependencies, as well as styled-jsx
Browse files Browse the repository at this point in the history
Some light typing tweaks were needed, but otherwise this was a clean
upgrade with fairly minimal non-version-bump dependency changes to boot.
The biggest one was a renaming of apollo-* packages to @apollo/.
  • Loading branch information
Shadowfiend committed Aug 26, 2023
1 parent 02ff01a commit 74c9e2a
Show file tree
Hide file tree
Showing 7 changed files with 570 additions and 1,034 deletions.
2 changes: 1 addition & 1 deletion background/redux-slices/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export type BackgroundAsyncThunk<
TypePrefix extends string,
Returned,
ThunkArg = void,
ThunkApiConfig = { extra: { main: Main } }
ThunkApiConfig extends AsyncThunkConfig = { extra: { main: Main } }
> = ((
payload: ThunkArg
) => BackgroundAsyncThunkAction<TypePrefix, Returned> & { payload: ThunkArg }) &
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"@tallyho/tally-ui": "0.0.1",
"@tallyho/window-provider": "0.0.1",
"buffer": "^6.0.3",
"react": "^17.0.2",
"react": "^18.2.0",
"sinon": "^14.0.1",
"webext-options-sync": "^2.0.1",
"webext-redux": "^2.1.7",
Expand All @@ -100,7 +100,7 @@
"@babel/preset-typescript": "^7.15.0",
"@babel/register": "^7.14.5",
"@playwright/test": "^1.31",
"@redux-devtools/cli": "^1.0.7",
"@redux-devtools/cli": "^2.0.0",
"@thesis-co/eslint-config": "^0.5.0",
"@types/archiver": "^5.1.0",
"@types/copy-webpack-plugin": "^8.0.0",
Expand Down Expand Up @@ -132,7 +132,7 @@
"process": "^0.11.10",
"size-plugin": "^2.0.2",
"stream-browserify": "^3.0.0",
"styled-jsx": "^3.4.4",
"styled-jsx": "^5.1.2",
"terser-webpack-plugin": "^5.1.1",
"ts-loader": "^9.2.3",
"typescript": "^5.0.4",
Expand Down
2 changes: 1 addition & 1 deletion ui/components/Claim/ClaimDelegate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function CustomDelegatePanel({
}, [dispatch, selectedDelegate.enteredBy])

const handleAddressInputChange = useCallback(
(value) => {
(value: string) => {
if (isAddress(value)) {
setErrorMessage("")
dispatch(chooseDelegate({ address: value, enteredBy: "custom" }))
Expand Down
4 changes: 2 additions & 2 deletions ui/components/NFTs/NFTCollection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default function NFTCollection(props: {
[id, owner, network, dispatch]
)

const intersectionCallback = useCallback(
const intersectionCallback = useCallback<IntersectionObserverCallback>(
([element]) => {
if (element.isIntersecting && !wasUpdated) {
// if collection doesn't have nfts then load some
Expand Down Expand Up @@ -79,7 +79,7 @@ export default function NFTCollection(props: {
{ threshold: 0.1 }
)

const loadMoreCallback = useCallback(
const loadMoreCallback = useCallback<IntersectionObserverCallback>(
([element]) => {
if (element.isIntersecting && !isUpdating) {
if (hasNextPage) setIsUpdating(true) // if next page is known show loader
Expand Down
8 changes: 3 additions & 5 deletions ui/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { ComponentType } from "react"
import ReactDOM from "react-dom"
import ReactDOM from "react-dom/client"
import { Store } from "webext-redux"
import { browser, newProxyStore } from "@tallyho/tally-background"
import "./_locales/i18n"
Expand All @@ -25,10 +25,8 @@ export async function attachUIToRootElement(

const backgroundStore = store ?? (await newProxyStore())

ReactDOM.render(
React.createElement(component, { store: backgroundStore }),
rootElement
)
const root = ReactDOM.createRoot(rootElement)
root.render(React.createElement(component, { store: backgroundStore }))
}

export async function attachTabUIToRootElement(): Promise<void> {
Expand Down
15 changes: 7 additions & 8 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"@tallyho/provider-bridge-shared": "0.0.1",
"@tallyho/tally-background": "0.0.1",
"@testing-library/jest-dom": "5.16.5",
"@testing-library/react": "12.1.5",
"@testing-library/react": "14.0.0",
"@testing-library/user-event": "14.4.3",
"lodash": "^4.17.21",
"classnames": "^2.3.1",
Expand All @@ -42,20 +42,19 @@
"history": "^4.9.0",
"i18next": "^21.8.10",
"prop-types": "^15.7.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-error-boundary": "^3.1.4",
"react-i18next": "^11.17.2",
"react-qr-code": "^2.0.0",
"react-redux": "^7.2.4",
"react-router-dom": "^5.3.0",
"react-transition-group": "^4.4.2",
"react-qr-code": "2.0.11",
"react-redux": "^7.2.9",
"react-router-dom": "^5.3.4",
"react-transition-group": "^4.4.5",
"redux": "^4.1.0",
"webextension-polyfill": "^0.8.0",
"zxcvbn": "^4.4.2"
},
"devDependencies": {
"@types/react-dom": "^17.0.9",
"@types/react-transition-group": "^4.4.4",
"@types/zxcvbn": "^4.4.1",
"webext-redux": "^2.1.7"
Expand Down
Loading

0 comments on commit 74c9e2a

Please sign in to comment.