Commit 7dd5a44
build(deps): DEP-10 — styled-components 6 (WALLET-1337) (#1387)
* build(deps): DEP-7 — redux 5 + react-redux 9 + reselect 5 + redux-saga 1.5 (WALLET-1333)
Bump redux 4.2.1 -> 5.0.1, react-redux 8.1.3 -> 9.3.0, reselect 4.1.7 -> 5.2.0,
and redux-saga 1.2.3 -> 1.5.0.
Fix a dead deep-import (`react-redux/es/exports`) left over from react-redux 8,
which no longer resolves under react-redux 9's ESM `exports` map.
Wrap four previously-unmemoized selectors (selectVaultAccountsPublicKeys,
selectVaultAccountsExceptLedgersAccounts, selectAllContactsNames,
selectAllContactsPublicKeys) in createSelector, and split
selectIsAccountConnected's tuple-returning input selector into two scalar
input selectors — both were returning a new reference on every call, which
reselect 5's new default inputStabilityCheck/react-redux 9's stabilityCheck
now surface as dev-mode warnings.
* build(deps): DEP-8 — bump react-router-dom 7 + yup 1 + resolvers 5 + react-hook-form 7.80 (WALLET-1335)
Atomic bump of 4 coupled packages: @hookform/resolvers@5 is typed against
yup@1 and peers on react-hook-form@^7.55, so all three must move together;
react-router-dom@7 tags along since it needs the same Node 20 baseline.
Mechanical fallout fixed: 12 deep imports of
@hookform/resolvers/yup/dist/yup -> @hookform/resolvers/yup (v5 dist
layout changed), 2 deep imports of yup/es/types -> yup (v1 dropped es/),
and use-typed-location.ts's Location import moved from the now-removed
@remix-run/router package to react-router-dom's re-export.
Type reconciliation for yup 1's stricter inference (yupResolver vs
FormValues) is deliberately out of scope here and follows in later
commits.
* fix(forms): DEP-8 — yup 1 type reconciliation for password/phrase/buy-cspr forms (WALLET-1335)
yup 1 infers Yup.string() without .required()/.defined() as an
optional/undefinable output, which broke yupResolver's strict typing
against useForm<FormValues>() wherever the *FormValues interface
declared the field as a plain required string.
- form-validation-rules.ts: add .required() to useCreatePasswordRule,
useVerifyPasswordAgainstHashRule, useRepeatPasswordRule, and
useValidSecretPhraseRule — all four back genuinely required fields
(password, confirm password, secret phrase), so this is also a type
fix and a validation-completeness fix.
- buy-cspr.ts: casperAmount is an unvalidated derived/display field
(set via setValue, never user-required), so relax
BuyCSPRFormValues.casperAmount to string | undefined instead of
forcing .required(). yup's inferred schema type is structurally
asymmetric between Input and Output for non-required fields, so no
single FormValues shape satisfies Resolver<F, any, F> here; cast the
resolver to Resolver<BuyCSPRFormValues> to bridge that gap.
* fix(forms): DEP-8 — yup 1 type reconciliation for transfer amount union schema (WALLET-1335)
useTransferAmountForm picks between two differently-shaped yup schemas
(erc20AmountFormSchema has paymentAmount, csprAmountFormSchema doesn't),
making amountFormSchema's type a TS union. keyof of a union is the
intersection of keys, so the resolver's inferred `names` type silently
dropped paymentAmount, breaking assignability against
Resolver<TransferAmountFormValues, ...>.
Add an unvalidated paymentAmount field to csprAmountFormSchema so both
union branches share the same key set (paymentAmount stays ERC-20-only
in practice — this is purely to align the inferred type, not a
validation change for CSPR transfers). That alone doesn't fully close
the gap because of the same Input/Output asymmetry yup produces for
unvalidated fields (as in buy-cspr.ts), so cast the resolver to
Resolver<TransferAmountFormValues> as well.
* fix(forms): DEP-8 — yup 1 type reconciliation for file import + StringSchema cleanup (WALLET-1335)
Yup.mixed() with no generic now infers its .test() callback argument
as yup 1's narrow AnyPresentValue type, breaking .length/index access
on secretKeyFile's file-type validators. Give it an explicit
Yup.mixed<FileList>() — the field is bound to a native
<input type="file"> and was always a FileList at runtime, so also fix
ImportAccountFormValues.secretKeyFile from the pre-existing (wrong)
string | undefined to FileList | undefined. Same Input/Output
asymmetry as buy-cspr.ts/transfer.ts requires the same
yupResolver(...) as Resolver<FormValues> cast.
Also fix an unrelated pre-existing type bug surfaced during review:
unlock-vault/index.tsx and password-protection-page/index.tsx typed
their Worker message payload's isPasswordCorrect as
Yup.StringSchema<...> instead of boolean, which is what
verify-password-worker.ts actually posts back
(verifyPasswordAgainstHash returns Promise<boolean>). The wrong type
never caused a runtime issue (TS can't check cross-Worker message
shapes, and both call sites only did truthy/falsy checks) but was
worth correcting while touching yup types in this area.
This closes out the type-reconciliation phase of the yup 1 /
resolvers 5 / react-hook-form 7.80 bump — npm run tsc is now clean
project-wide.
* test(e2e): DEP-8 — fix router-v7-exposed rename-account flake + review-flow missing awaits (WALLET-1335)
rename-account.spec.ts: react-router 7 no longer unmounts the outgoing
route synchronously with the incoming one (v6 did), so after
navigate() there can be a brief window (confirmed via reproduction:
under ~10ms) where the account-settings page's stale heading and the
Home header banner both render the same account name. The
unscoped getByText(name) assertion hit a Playwright strict-mode
violation deterministically. Scope both assertions to the header
banner, which is what the test actually intends to verify post-close.
review-flow.spec.ts: 8 popupExpect(...).toBeVisible() calls across all
three tests were missing await (pre-existing since #1151, unrelated
to this bump), so the test function could return before the assertion
resolved. Add the missing awaits.
* build(deps): DEP-9 — i18n + formatting stack (i18next 26, react-i18next 17, @formatjs/intl 4) (WALLET-1334)
Bumps i18next-http-backend 3.0.5 -> 4.0.0 (finishes the DEP-2 security
fix, drops the bundled cross-fetch since MV3 service workers have
native fetch), i18next 23 -> 26, react-i18next 14 -> 17,
i18next-browser-languagedetector 7 -> 8, @formatjs/intl 2 -> 4
(pure ESM), and the i18next-conv dev tool 15 -> 17.
i18next-parser stays on hold as an independent extractor.
Extends jest.config.js transformIgnorePatterns to transpile
@formatjs/intl v4's ESM dependency tree, including the unscoped
intl-messageformat transitive that isn't covered by the @formatjs
scope alone.
Converts the two locale dev scripts to ESM to fix a latent
ERR_REQUIRE_ESM from i18next-conv already being ESM-only.
No changes needed in src/libs/i18n/i18n.ts or language-detector.ts —
the runtime config and custom detector shape are forward-compatible.
* build(deps): bump styled-components to v6, add @emotion/is-prop-valid
* feat(ui): add shared StyleSheetManager with global prop filtering
* fix(ui): update styled-components v6 API/type usages across UI library
* feat(security): replace unsafe-inline with per-build nonce in style-src CSP
* feat(ui): wrap app trees in CspStyleSheetManager
* fix(ui): compose isPropValid into local shouldForwardProp overrides
styled-components v6 resolves shouldForwardProp as componentLevel ||
contextLevel: a component's own .withConfig({shouldForwardProp}) fully
replaces the StyleSheetManager-provided filter rather than composing with
it. typography.tsx (StyledTypography, StyledHeader) and svg-icon.tsx
(Container) each define a local shouldForwardProp that only excludes their
one component-specific prop, so every other custom prop (color, active,
wordBreak, ellipsis, isDarkMode, displayContext, ...) was forwarded
straight to the DOM, unfiltered by the global CspStyleSheetManager filter.
Confirmed via manual browser QA (React "does not recognize the X prop"
warnings + invalid DOM attributes) and by reading styled-components
6.4.3's compiled resolution logic directly.
* revert: defer CSP style-src nonce hardening (P1.5a) out of DEP-10
Reverts commit 5aa885c. Manual QA surfaced two libraries that inject
inline <style> tags with no nonce awareness under the new nonce-only
style-src: style-loader's runtime (used for the mac-scrollbar and
react-loading-skeleton CSS imports — fixable later via __webpack_nonce__,
which style-loader does support) and @lottiefiles/react-lottie-player's
vendored style-inject utility (no nonce support at all, would need either
a CSP hash for its static injected CSS or a library swap).
The StyleSheetManager wiring this ticket already built (CspStyleSheetManager
mounted in all 5 apps) stays as-is and needs no rework when the nonce
work resumes — it already passes process.env.CSP_NONCE through as a
no-op until that env var is defined again. style-src reverts to
'unsafe-inline' for now; P1.5(a) tracked as a separate follow-up once
the lottie-player situation is resolved.
* docs(ui): clarify CSP_NONCE prop is a no-op until follow-up ticket
* fix(ui): add missing & to Button pseudo-selectors
':hover'/':active'/':focus' object keys (with or without a leading space)
compile to a descendant-combinator selector (`.btn :hover`, matching any
hovered descendant) rather than the button's own state (`.btn:hover`) —
CSS object-key syntax requires an explicit '&' prefix to target the host
element itself. Pre-existing since 2022 (commit a831936), unrelated to
the styled-components v6 bump (button.tsx had zero diff before this fix),
but found and fixed during this ticket's manual QA: hovering the Send/More
icons (descendants of the button) was applying the button's intended
hover/active background to the icon itself instead of the button, and
the button's focus outline was never actually suppressed.
---------
Co-authored-by: Vynnyk Dmytro <simbiatoff@gmail.com>1 parent 68525e3 commit 7dd5a44
16 files changed
Lines changed: 187 additions & 198 deletions
File tree
- src
- apps
- connect-to-app
- import-account-with-file
- onboarding
- popup
- signature-request
- libs
- layout
- ui
- components
- avatar
- button
- list
- svg-icon
- typography
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | 56 | | |
60 | 57 | | |
61 | 58 | | |
| 59 | + | |
62 | 60 | | |
63 | 61 | | |
64 | 62 | | |
| |||
106 | 104 | | |
107 | 105 | | |
108 | 106 | | |
109 | | - | |
| 107 | + | |
110 | 108 | | |
111 | 109 | | |
112 | 110 | | |
| |||
145 | 143 | | |
146 | 144 | | |
147 | 145 | | |
148 | | - | |
149 | 146 | | |
150 | 147 | | |
151 | 148 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
26 | 31 | | |
27 | 32 | | |
28 | 33 | | |
| |||
58 | 63 | | |
59 | 64 | | |
60 | 65 | | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
71 | 78 | | |
72 | 79 | | |
73 | 80 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
24 | 29 | | |
25 | 30 | | |
26 | 31 | | |
| |||
56 | 61 | | |
57 | 62 | | |
58 | 63 | | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
69 | 76 | | |
70 | 77 | | |
71 | 78 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
49 | 51 | | |
50 | 52 | | |
51 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
25 | 30 | | |
26 | 31 | | |
27 | 32 | | |
| |||
59 | 64 | | |
60 | 65 | | |
61 | 66 | | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
72 | 79 | | |
73 | 80 | | |
74 | 81 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
26 | 31 | | |
27 | 32 | | |
28 | 33 | | |
| |||
60 | 65 | | |
61 | 66 | | |
62 | 67 | | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
73 | 80 | | |
74 | 81 | | |
75 | 82 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
274 | | - | |
| 274 | + | |
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
| 27 | + | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
| 105 | + | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
| 108 | + | |
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
| 124 | + | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
| 127 | + | |
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
| 143 | + | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
| 146 | + | |
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| |||
0 commit comments