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

Core dependency upgrades #1830

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
45ecef5
Bump the major group across 5 directories with 83 updates
dependabot[bot] Jan 19, 2025
9d78969
upgrades all syntax for breaking changes
aristidesstaffieri Jan 30, 2025
d8c655a
updates test harness and syntax for new major versions, updates Route…
aristidesstaffieri Jan 30, 2025
514edaf
migrate navigateTo to use v7 API, fix tests for send payment
aristidesstaffieri Jan 30, 2025
429201d
updates account tests for new router model
aristidesstaffieri Jan 31, 2025
4a7f495
updates account creator tests for new router model
aristidesstaffieri Jan 31, 2025
081b57a
updates account history tests for new router model
aristidesstaffieri Jan 31, 2025
d68a8e7
updates grant access tests for new router model
aristidesstaffieri Jan 31, 2025
fc3d4e1
updates manage assets tests for new router model
aristidesstaffieri Jan 31, 2025
e333ae9
updates mnemonic phrase tests for new router model
aristidesstaffieri Jan 31, 2025
71102d5
updates review auth tests for new router model
aristidesstaffieri Jan 31, 2025
f95ec60
updates send token payment tests for new router model
aristidesstaffieri Jan 31, 2025
65c7d68
updates sign tx tests for new router model
aristidesstaffieri Jan 31, 2025
5cb10ab
updates swap tests for new router model
aristidesstaffieri Jan 31, 2025
a4bc4d0
updates swap unfunded tests for new router model
aristidesstaffieri Jan 31, 2025
6c80d2a
updates operation keyval tests for new router model
aristidesstaffieri Jan 31, 2025
601063f
catches up e2e tests to upstream changes
aristidesstaffieri Jan 31, 2025
c9da8f0
bumps node version in CI to 22
aristidesstaffieri Jan 31, 2025
54db544
cleans up imports in ManageAssets test, adds jest dom types to API ts…
aristidesstaffieri Jan 31, 2025
df47a2b
temporarily dont fail on eslint failure
aristidesstaffieri Jan 31, 2025
7aa9973
fixes routing logic for nested routes
aristidesstaffieri Jan 31, 2025
184d8f5
disable eslint - temporary
aristidesstaffieri Jan 31, 2025
4b1ef80
fixes nested routing path handling for router v7, disables tests that…
aristidesstaffieri Jan 31, 2025
f8f2b7f
updates test ID reference in e2e payment tests
aristidesstaffieri Feb 3, 2025
b3ab691
bumps docs node engine to >=22
aristidesstaffieri Feb 3, 2025
25909fe
trigger build to retry docs preview
aristidesstaffieri Feb 3, 2025
79eb390
bumps node version in npm rc for docs
aristidesstaffieri Feb 3, 2025
03bcd79
restores swap index route
aristidesstaffieri Feb 3, 2025
5618e3d
properly handle second level nested routed for settings
aristidesstaffieri Feb 4, 2025
96ef7f5
adds getPathFromRoute to clean up sub routing changes
aristidesstaffieri Feb 11, 2025
add3f0c
upgrades all actions to use node version 22
aristidesstaffieri Feb 11, 2025
d88f696
removes stray comment from refactor
aristidesstaffieri Feb 11, 2025
9134812
redo eslint, prettier, ts configs to be compatible with new major ver…
aristidesstaffieri Feb 11, 2025
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
2 changes: 1 addition & 1 deletion .github/workflows/runTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 21
node-version: 22
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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

- run: npm install -g yarn && yarn
- run: npx playwright install --with-deps chromium
- run: yarn setup
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v21
v22
12 changes: 6 additions & 6 deletions @shared/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
"private": true,
"dependencies": {
"@blockaid/client": "^0.31.0",
"@stellar/js-xdr": "^3.1.1",
"bignumber.js": "^9.1.1",
"prettier": "^2.0.5",
"@stellar/js-xdr": "^3.1.2",
"bignumber.js": "^9.1.2",
"prettier": "^3.4.2",
"stellar-sdk": "yarn:@stellar/stellar-sdk@13.0.0-beta.1",
"stellar-sdk-next": "yarn:@stellar/stellar-sdk@13.0.0-beta.1",
"typescript": "~3.7.2",
"typescript": "~5.7.3",
"webextension-polyfill": "^0.12.0"
},
"devDependencies": {
"@lavamoat/allow-scripts": "^2.3.1",
"@stellar/prettier-config": "^1.0.1"
"@lavamoat/allow-scripts": "^3.3.1",
"@stellar/prettier-config": "^1.2.0"
},
"lavamoat": {
"allowScripts": {
Expand Down
4 changes: 2 additions & 2 deletions @shared/constants/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"dependencies": {
"stellar-sdk": "yarn:@stellar/stellar-sdk@13.0.0-beta.1",
"stellar-sdk-next": "yarn:@stellar/stellar-sdk@13.0.0-beta.1",
"typescript": "~3.7.2"
"typescript": "~5.7.3"
},
"devDependencies": {
"@lavamoat/allow-scripts": "^2.3.1",
"@lavamoat/allow-scripts": "^3.3.1",
"@stellar/prettier-config": "^1.0.1"
},
"lavamoat": {
Expand Down
6 changes: 3 additions & 3 deletions @shared/helpers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"prettier": "@stellar/prettier-config",
"version": "1.0.0",
"dependencies": {
"bignumber.js": "^9.1.1",
"bignumber.js": "^9.1.2",
"stellar-sdk": "yarn:@stellar/stellar-sdk@13.0.0-beta.1",
"stellar-sdk-next": "yarn:@stellar/stellar-sdk@13.0.0-beta.1",
"typescript": "~3.7.2"
"typescript": "~5.7.3"
},
"devDependencies": {
"@stellar/prettier-config": "^1.0.1"
"@stellar/prettier-config": "^1.2.0"
}
}
2 changes: 1 addition & 1 deletion @stellar/freighter-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
"semver": "^7.6.3"
},
"devDependencies": {
"@lavamoat/allow-scripts": "^2.3.1"
"@lavamoat/allow-scripts": "^3.3.1"
}
}
3 changes: 2 additions & 1 deletion @stellar/freighter-api/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"outDir": "build/",
"paths": {
"@shared/*": ["../../../@shared/*"]
}
},
"types": ["@testing-library/jest-dom"]
},
"include": ["src"],
"exclude": ["build", "node_modules", "src/**/*.test.js"]
Expand Down
2 changes: 1 addition & 1 deletion config/jest/extendJest.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// Runs in setupFilesAfterEnv hook
// https://jestjs.io/docs/en/configuration#setupfilesafterenv-array
import "@testing-library/jest-dom/extend-expect";
import "@testing-library/jest-dom";
2 changes: 2 additions & 0 deletions config/jest/setupTests.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ global.DEV_SERVER = true;
global.DEV_EXTENSION = true;
global.PRODUCTION = false;
global.EXPERIMENTAL = false;
global.TextEncoder = TextEncoder;
global.TextDecoder = TextDecoder;

process.env.INDEXER_URL = "http://localhost:3002/api/v1";

Expand Down
15 changes: 9 additions & 6 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"name": "docs",
"version": "1.0.0",
"private": true,
"engines": {
"node": ">=22.0.0"
},
"scripts": {
"docusaurus": "docusaurus",
"start": "docusaurus start",
Expand All @@ -26,14 +29,14 @@
"@docusaurus/core": "3.6.3",
"@docusaurus/preset-classic": "3.6.3",
"@stellar/freighter-api": "3.0.0",
"clsx": "^1.1.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-is": "^16.13.1",
"styled-components": "^5.0.1"
"clsx": "^2.1.1",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-is": "^19.0.0",
"styled-components": "^6.1.14"
},
"devDependencies": {
"@lavamoat/allow-scripts": "^2.3.1"
"@lavamoat/allow-scripts": "^3.3.1"
},
"lavamoat": {
"allowScripts": {
Expand Down
6 changes: 3 additions & 3 deletions extension/e2e-tests/sendPayment.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ test("Send XLM payment to G address", async ({ page, extensionId }) => {
screenshot: "send-payment-details.png",
});
await expect(page.getByText("Sent XLM")).toBeVisible();
await expect(page.getByTestId("asset-amount")).toContainText("1 XLM");
await expect(page.getByTestId("asset-amount")).toContainText("1");
});

test("Send XLM payment to C address", async ({ page, extensionId }) => {
Expand Down Expand Up @@ -142,7 +142,7 @@ test("Send XLM payment to C address", async ({ page, extensionId }) => {
await page.getByText("Details").click({ force: true });

await expect(page.getByText("Sent XLM")).toBeVisible();
await expect(page.getByTestId("asset-amount")).toContainText(".001 XLM");
await expect(page.getByTestId("asset-amount")).toContainText("0.001");

await page.getByTestId("BackButton").click({ force: true });
await page.getByTestId("BottomNav-link-account").click({ force: true });
Expand Down Expand Up @@ -282,7 +282,7 @@ test("Send token payment to C address", async ({ page, extensionId }) => {
await page.getByText("Details").click({ force: true });

await expect(page.getByText("Sent E2E")).toBeVisible();
await expect(page.getByTestId("asset-amount")).toContainText(".001 E2E");
await expect(page.getByTestId("asset-amount")).toContainText("0.001");
Copy link
Contributor

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

});
test.afterAll(async ({ page, extensionId }) => {
if (
Expand Down
111 changes: 55 additions & 56 deletions extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,86 +15,85 @@
"test:e2e": "playwright test"
},
"dependencies": {
"@ledgerhq/hw-app-str": "^7.0.2",
"@ledgerhq/hw-transport-webusb": "^6.29.2",
"@reduxjs/toolkit": "1.6.0",
"@sentry/browser": "^8.34.0",
"@ledgerhq/hw-app-str": "^7.0.4",
"@ledgerhq/hw-transport-webusb": "^6.29.4",
"@reduxjs/toolkit": "2.5.0",
"@sentry/browser": "^8.50.0",
"@shared/api": "1.0.0",
"@shared/constants": "1.0.0",
"@shared/helpers": "1.0.0",
"@stellar/design-system": "2.0.0-beta.17",
"@stellar/typescript-wallet-sdk-km": "^1.0.1",
"@testing-library/react": "^14.2.1",
"@testing-library/user-event": "^7.1.2",
"@stellar/typescript-wallet-sdk-km": "^1.8.0",
"@testing-library/react": "^16.2.0",
"@testing-library/user-event": "^14.6.0",
"@types/chrome": "^0.0.287",
"@types/history": "^4.7.7",
"@types/jsdom": "^16.2.3",
"@types/lodash": "^4.14.149",
"@types/node": "^12.0.0",
"@types/qrcode.react": "^1.0.1",
"@types/react": "^18.3.4",
"@types/react-copy-to-clipboard": "^4.3.0",
"@types/react-dom": "^18.2.24",
"@types/react-redux": "^7.1.7",
"@types/react-router-dom": "^5.1.3",
"@types/history": "^5.0.0",
"@types/jsdom": "^21.1.7",
"@types/lodash": "^4.17.14",
"@types/node": "^22.10.7",
"@types/qrcode.react": "^3.0.0",
"@types/react": "^19.0.7",
"@types/react-copy-to-clipboard": "^5.0.7",
"@types/react-dom": "^19.0.3",
"@types/react-redux": "^7.1.34",
"@types/react-router-dom": "^5.3.3",
"@types/redux": "^3.6.0",
"@types/testing-library__jest-dom": "^5.14.5",
"@types/testing-library__jest-dom": "^6.0.0",
"@types/webextension-polyfill": "^0.12.0",
"@types/yup": "^0.32.0",
"bignumber.js": "^9.1.1",
"bignumber.js": "^9.1.2",
"buffer": "^6.0.3",
"classnames": "^2.5.1",
"concurrently": "^5.1.0",
"concurrently": "^9.1.2",
"copy-webpack-plugin": "^12.0.2",
"css-loader": "^7.1.2",
"dotenv-webpack": "^8.0.1",
"dotenv-webpack": "^8.1.0",
"fetch": "^1.1.0",
"formik": "^2.1.4",
"history": "^4",
"html-loader": "^5.0.0",
"html-webpack-plugin": "^5.5.3",
"i18next": "^21.8.13",
"i18next-browser-languagedetector": "^6.1.4",
"i18next-resources-to-backend": "^1.0.0",
"formik": "^2.4.6",
"html-loader": "^5.1.0",
"html-webpack-plugin": "^5.6.3",
"i18next": "^24.2.1",
"i18next-browser-languagedetector": "^8.0.2",
"i18next-resources-to-backend": "^1.2.1",
"i18next-scanner-webpack": "^0.9.1",
"jest-canvas-mock": "^2.4.0",
"jest-environment-jsdom": "^28.1.3",
"jsonschema": "^1.4.1",
"lodash": "^4.17.15",
"mini-css-extract-plugin": "^2.9.0",
"prettier": "^2.0.5",
"pretty-quick": "^2.0.1",
"prop-types": "^15.7.2",
"punycode": "^2.1.1",
"qrcode.react": "^1.0.0",
"react": "^18.2.0",
"react-copy-to-clipboard": "^5.0.2",
"react-dom": "^18.2.0",
"react-i18next": "^11.18.0",
"react-redux": "^7.2.6",
"react-router-dom": "^5.3.0",
"redux": "^4.0.5",
"sass": "^1.77.2",
"sass-loader": "^14.2.1",
"semver": "^7.5.4",
"ses": "^0.18.5",
"jest-canvas-mock": "^2.5.2",
"jest-environment-jsdom": "^29.7.0",
"jsonschema": "^1.5.0",
"lodash": "^4.17.21",
"mini-css-extract-plugin": "^2.9.2",
"prettier": "^3.4.2",
"pretty-quick": "^4.0.0",
"prop-types": "^15.8.1",
"punycode": "^2.3.1",
"qrcode.react": "^4.2.0",
"react": "^19.0.0",
"react-copy-to-clipboard": "^5.1.0",
"react-dom": "^19.0.0",
"react-i18next": "^15.4.0",
"react-redux": "^9.2.0",
"react-router-dom": "^7.1.3",
"redux": "^5.0.1",
"sass": "^1.83.4",
"sass-loader": "^16.0.4",
"semver": "^7.6.3",
"ses": "^1.10.0",
"soroswap-router-sdk": "^1.4.6",
"stellar-hd-wallet": "^0.0.10",
"stellar-identicon-js": "^1.0.0",
"stellar-sdk": "yarn:@stellar/stellar-sdk@13.0.0-beta.1",
"stellar-sdk-next": "yarn:@stellar/stellar-sdk@13.0.0-beta.1",
"svg-url-loader": "^8.0.0",
"tsconfig-paths-webpack-plugin": "^4.1.0",
"tsconfig-paths-webpack-plugin": "^4.2.0",
"tslib": "2.8.1",
"webextension-polyfill": "^0.12.0",
"yup": "^1.4.0"
"yup": "^1.6.1"
},
"devDependencies": {
"@lavamoat/allow-scripts": "^2.3.1",
"@lavamoat/allow-scripts": "^3.3.1",
"@playwright/test": "1.49.0",
"@sentry/webpack-plugin": "^2.22.0",
"@sentry/webpack-plugin": "^3.0.0",
"@svgr/webpack": "^8.1.0",
"@types/semver": "^7.5.2",
"@types/semver": "^7.5.8",
"fork-ts-checker-webpack-plugin": "^9.0.2",
"https-browserify": "^1.0.0",
"os-browserify": "^0.3.0",
Expand All @@ -103,8 +102,8 @@
"speed-measure-webpack-plugin": "^1.5.0",
"stream-browserify": "^3.0.0",
"stream-http": "^3.2.0",
"terser-webpack-plugin": "^5.3.10",
"thread-loader": "^4.0.2",
"terser-webpack-plugin": "^5.3.11",
"thread-loader": "^4.0.4",
"url": "^0.11.1",
"util": "^0.12.5"
},
Expand Down
14 changes: 9 additions & 5 deletions extension/src/background/store.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CombinedState, combineReducers } from "redux";
import { combineReducers } from "redux";
import { configureStore } from "@reduxjs/toolkit";

import { sessionSlice } from "background/ducks/session";
Expand All @@ -25,15 +25,19 @@ export async function loadState() {
}
}

function saveStore(state: CombinedState<any>) {
const rootReducer = combineReducers({
session: sessionSlice.reducer,
});

type RootState = ReturnType<typeof rootReducer>;

function saveStore(state: RootState) {
const serializedState = JSON.stringify(state);
sessionStore.setItem(REDUX_STORE_KEY, serializedState);
}

const store = configureStore({
reducer: combineReducers({
session: sessionSlice.reducer,
}),
reducer: rootReducer,
});

/*
Expand Down
26 changes: 18 additions & 8 deletions extension/src/helpers/metrics.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
import throttle from "lodash/throttle";
import { Middleware, AnyAction } from "redux";
import { Action, Middleware } from "redux";
import { captureException } from "@sentry/browser";
import { PayloadAction } from "@reduxjs/toolkit";
import { Location } from "react-router-dom";

import { store } from "popup/App";
import { METRICS_DATA } from "constants/localStorageTypes";
import { AMPLITUDE_KEY } from "constants/env";
import { settingsDataSharingSelector } from "popup/ducks/settings";
import { AccountType } from "@shared/api/types";
import { captureException } from "@sentry/browser";

type MetricHandler<AppState> = (state: AppState, action: AnyAction) => void;
type MetricsPayloadAction = PayloadAction<{
errorMessage?: string;
location?: Location;
}>;
type MetricHandler<AppState> = (
state: AppState,
action: MetricsPayloadAction,
) => void;
const handlersLookup: { [key: string]: MetricHandler<any>[] } = {};

/*
Expand All @@ -17,13 +26,14 @@ const handlersLookup: { [key: string]: MetricHandler<any>[] } = {};
* of registered handlers and passes the current state and action. These are
* intended for metrics emission, nothing else.
*/
export function metricsMiddleware<State>(): Middleware<object, State> {
export function metricsMiddleware<State>(): Middleware<Action, State> {
return ({ getState }) =>
(next) =>
(action: AnyAction) => {
(action: unknown) => {
const state = getState();
(handlersLookup[action.type] || []).forEach((handler) =>
handler(state, action),
const _action = action as PayloadAction<{ errorMessage: string }>; // Redux Middleware type forces this unknown for some reason
(handlersLookup[_action.type] || []).forEach((handler) =>
handler(state, _action),
);
return next(action);
};
Expand All @@ -40,7 +50,7 @@ export function metricsMiddleware<State>(): Middleware<object, State> {
*/
export function registerHandler<State>(
actionType: string | { type: string },
handler: (state: State, action: AnyAction) => void,
handler: (state: State, action: MetricsPayloadAction) => void,
) {
const type = typeof actionType === "string" ? actionType : actionType.type;
if (handlersLookup[type]) {
Expand Down
Loading