-
Notifications
You must be signed in to change notification settings - Fork 29
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
Core dependency upgrades #1830
base: master
Are you sure you want to change the base?
Core dependency upgrades #1830
Conversation
--- updated-dependencies: - dependency-name: "@testing-library/dom" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@testing-library/jest-dom" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@types/testing-library__jest-dom" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@typescript-eslint/parser" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: eslint dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: eslint-config-prettier dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: eslint-import-resolver-typescript dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: eslint-plugin-flowtype dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: eslint-plugin-react-hooks dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: glob dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: got dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: husky dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: isomorphic-unfetch dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: jest dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@types/jest" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: jsdom dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: lint-staged dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: prettier dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: pretty-quick dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: typescript dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: webpack-cli dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: webpack-merge dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@lavamoat/allow-scripts" dependency-type: direct:development update-type: version-update:semver-major dependency-group: major - dependency-name: "@lavamoat/preinstall-always-fail" dependency-type: direct:development update-type: version-update:semver-major dependency-group: major - dependency-name: eslint-plugin-jsdoc dependency-type: direct:development update-type: version-update:semver-major dependency-group: major - dependency-name: clsx dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: react dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@types/react" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: react-dom dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@types/react-dom" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: react-is dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: styled-components dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@reduxjs/toolkit" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@testing-library/react" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@testing-library/user-event" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@types/jsdom" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@types/node" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@types/react-copy-to-clipboard" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@types/testing-library__jest-dom" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: concurrently dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: history dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@types/history" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: i18next dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: i18next-browser-languagedetector dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: jest-environment-jsdom dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: qrcode.react dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: react-i18next dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: react-redux dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: react-router-dom dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: redux dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: sass-loader dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: ses dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@sentry/webpack-plugin" dependency-type: direct:development update-type: version-update:semver-major dependency-group: major - dependency-name: "@stellar/prettier-config" dependency-type: direct:development dependency-group: major - dependency-name: prettier dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: typescript dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@lavamoat/allow-scripts" dependency-type: direct:development update-type: version-update:semver-major dependency-group: major - dependency-name: "@stellar/js-xdr" dependency-type: direct:production dependency-group: major - dependency-name: bignumber.js dependency-type: direct:production dependency-group: major - dependency-name: "@stellar/prettier-config" dependency-type: direct:development dependency-group: major - dependency-name: typescript dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: bignumber.js dependency-type: direct:production dependency-group: major - dependency-name: "@lavamoat/allow-scripts" dependency-type: direct:development update-type: version-update:semver-major dependency-group: major - dependency-name: "@types/react" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@types/react-dom" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: prettier dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: pretty-quick dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@lavamoat/allow-scripts" dependency-type: direct:development update-type: version-update:semver-major dependency-group: major - dependency-name: bignumber.js dependency-type: direct:production dependency-group: major - dependency-name: react dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: react-dom dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@ledgerhq/hw-app-str" dependency-type: direct:production dependency-group: major - dependency-name: "@ledgerhq/hw-transport-webusb" dependency-type: direct:production dependency-group: major - dependency-name: "@reduxjs/toolkit" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@sentry/browser" dependency-type: direct:production dependency-group: major - dependency-name: "@stellar/typescript-wallet-sdk-km" dependency-type: direct:production dependency-group: major - dependency-name: "@testing-library/react" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@testing-library/user-event" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@types/history" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@types/jsdom" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@types/lodash" dependency-type: direct:production dependency-group: major - dependency-name: "@types/node" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@types/qrcode.react" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@types/react-copy-to-clipboard" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@types/react-redux" dependency-type: direct:production dependency-group: major - dependency-name: "@types/react-router-dom" dependency-type: direct:production dependency-group: major - dependency-name: "@types/testing-library__jest-dom" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: concurrently dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: dotenv-webpack dependency-type: direct:production dependency-group: major - dependency-name: formik dependency-type: direct:production dependency-group: major - dependency-name: history dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: html-loader dependency-type: direct:production dependency-group: major - dependency-name: html-webpack-plugin dependency-type: direct:production dependency-group: major - dependency-name: i18next dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: i18next-browser-languagedetector dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: i18next-resources-to-backend dependency-type: direct:production dependency-group: major - dependency-name: jest-canvas-mock dependency-type: direct:production dependency-group: major - dependency-name: jest-environment-jsdom dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: jsonschema dependency-type: direct:production dependency-group: major - dependency-name: lodash dependency-type: direct:production dependency-group: major - dependency-name: mini-css-extract-plugin dependency-type: direct:production dependency-group: major - dependency-name: prop-types dependency-type: direct:production dependency-group: major - dependency-name: punycode dependency-type: direct:production dependency-group: major - dependency-name: qrcode.react dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: react-copy-to-clipboard dependency-type: direct:production dependency-group: major - dependency-name: react-i18next dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: react-redux dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: react-router-dom dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: redux dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: sass dependency-type: direct:production dependency-group: major - dependency-name: sass-loader dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: semver dependency-type: direct:production dependency-group: major - dependency-name: ses dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: tsconfig-paths-webpack-plugin dependency-type: direct:production dependency-group: major - dependency-name: yup dependency-type: direct:production dependency-group: major - dependency-name: "@sentry/webpack-plugin" dependency-type: direct:development update-type: version-update:semver-major dependency-group: major - dependency-name: "@types/semver" dependency-type: direct:development dependency-group: major - dependency-name: terser-webpack-plugin dependency-type: direct:development dependency-group: major - dependency-name: thread-loader dependency-type: direct:development dependency-group: major ... Signed-off-by: dependabot[bot] <support@github.com>
…r patterns to work in v7
… rely on nested routing
🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎ To accept the risk, merge this PR and you will not be notified again.
Next stepsWhat is a deprecated package?The maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed. Research the state of the package and determine if there are non-deprecated versions that can be used, or if it should be replaced with a new, supported solution. Take a deeper look at the dependencyTake a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev. Remove the packageIf you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency. Mark a package as acceptable riskTo ignore an alert, reply with a comment starting with
|
@@ -13,43 +13,73 @@ import { MigrationComplete } from "popup/components/accountMigration/MigrationCo | |||
|
|||
import "./styles.scss"; | |||
|
|||
export const AccountMigration = () => ( | |||
<> | |||
export const AccountMigration = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because of the changes to nested routes in v7, we need to only use the path after the base path from the nested structure. In order to keep the existing mappings in routes.ts
, we can split away the base path and pass the page specific path to each nested route.
This pattern is used for all nested routes but only commented about here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we create a helper for this where we pass in the nested path and the base path?
getNestedRoute(ROUTES.accountMigratonReviewMigration, ROUTES.accountMigration)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you have in mind?
It's not always the same prefix or the same number of prefix paths so I think the helper would essentially just be a wrapper around String.split.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh gotcha - it looked like the nested route was always ${baseRoute}/{subRoute}
, where you're always just extracting subRoute
. The nested routes are generally set up that way, but I see we actually have another level of nesting on some of them which makes this non-standard.
Hm, this does feel a little messy having these .split
's at the top. Maybe the real fix here is just moving away from this nested router structure 🤔 But that's maybe a new ticket
For now, to avoid duplicating the same string a bunch of times, can we at least do:
const baseRoute = `${ROUTES.accountMigration}/`;
const review Slug = ROUTES.accountMigrationReviewMigration.split(
baseRoute,
)[1];
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm not sure I see the example, aren't they all different sub paths already?
Yeah there is def a discussion about the routing because the sub routes don't work well for "full screen mode" but yeah I feel that's outside of this scope and would be a significant refactor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will pull out the base path into a var here, incoming patch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is done in 96ef7f5
|
||
const publicKey = "GA4UFF2WJM7KHHG4R5D5D2MZQ6FWMDOSVITVF7C5OLD5NFP6RBBW2FGV"; | ||
|
||
describe("SendPayment", () => { | ||
describe.skip("SendPayment", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't found a way to maintain this test as written. Because of the nested router changes and the way the send/swap component relies on location to render the appropriate copy/components, the test fails to render the correct screen. The top level router hasn't been part of the tests and the changes to the global history make maintaining this pattern difficult.
I think we can rewrite the send/swap components to rely on an injected location from the useNavigate
hook while also refactoring the tests in order to render use a test router to mimic the nested routing structure in the full application.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't done this because of the massive change set already, it seemed like this could be broken off into another PR but I am open to suggestions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree on breaking this off into another PR, sounds like the best approach for simplicity given the size and complexity of this PR
mockHistoryGetter.mockReturnValue(history); | ||
|
||
describe("Swap", () => { | ||
describe.skip("Swap", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is subject to the same details as the SendPayment tests and can be revived using the same solutions.
@@ -91,7 +83,7 @@ jest.mock("stellar-sdk", () => { | |||
}; | |||
}); | |||
|
|||
describe("Swap unfunded account", () => { | |||
describe.skip("Swap unfunded account", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comments as other skipped tests
extension/webpack.common.js
Outdated
extensions: [".ts", ".tsx"], | ||
failOnWarning: true, | ||
}), | ||
// new ESLintPlugin({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our current linting pipeline relies on @stellar/config which is not compatible with the upgraded version of typescript/react. We have to upgrade eslint & friends in that repo before we can use that config in this repo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we know what the lift is on upgrading @stellar/config? I think we should do that first if it's reasonable. If we put it off, we could introduce a bunch of linting errors we'll need to address down the line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it requires a significant rewrite of the config but not sure on the t-shirt size of it. Open to suggestions here but it seemed like doing this could introduce quite a few more changes to this already massive PR due to the likelihood of rules changing across several major versions of the tooling.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a pretty big departure since eslint 9 is wildly different but I think this gets us as close as is reasonable given the changes.
done in commit 9134812
Report too large to display inline |
@@ -13,7 +13,7 @@ jobs: | |||
- uses: actions/checkout@v4 | |||
- uses: actions/setup-node@v4 | |||
with: | |||
node-version: 21 | |||
node-version: 22 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will we need to update the node version in the other GHA's, as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not that I've found, but yeah maybe the build ones would too I can upgrade those to 22.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is done in add3f0c
/> | ||
); | ||
} | ||
return <Route {...props} />; | ||
return children; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just calling some things out as I see them - I'll pull this branch and try to see if this actually has an effect:
I notice we're not passing the props here. Wondering if this will break some views
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe it does because the re-organization and use of the the outlet makes those props no longer needed but would love another glance at that as it departed significantly from the previous patterns.
@@ -1,11 +1,16 @@ | |||
import browser from "webextension-polyfill"; | |||
|
|||
import { ROUTES } from "popup/constants/routes"; | |||
import { history } from "popup/constants/history"; | |||
// import { history } from "popup/constants/history"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's rm this comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in d88f696
arrowParens: "always" | ||
bracketSpacing: true | ||
bracketSameLine: false | ||
printWidth: 80 | ||
proseWrap: "always" | ||
semi: true | ||
singleQuote: false | ||
tabWidth: 2 | ||
trailingComma: "all" | ||
useTabs: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
await expect(page.getByTestId("asset-amount")).toContainText(".001 E2E"); | ||
await expect(page.getByTestId("asset-amount")).toContainText("0.001"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice catch on those "asset-amount" string tweaks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm, thanks for working on this!
Closes #1824
Major dependency upgrade for -
react
react-router
typescript
styled-components
clsx
@testing-library/*
@reduxjs-toolkit
Notable changes -
Improved store types
new routing API from react-router v7, significant changes to the routing paradigm and architecture, mostly found in
Router.tsx
but also impacts all nested routes.Regressions -
Send/Swap tests are not easily compatible with these changes due to the changes to nested routes. I've commented and detailed the situation and potential ways to revive them in the change set diffs for the tests.