feat(perps): update perps controller to latest on extension#43356
feat(perps): update perps controller to latest on extension#43356abretonc7s wants to merge 12 commits into
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
✨ Files requiring CODEOWNER review ✨👨🔧 @MetaMask/perps (12 files, +183 -165)
📜 @MetaMask/policy-reviewers (4 files, +20 -0)
Tip Follow the policy review process outlined in the LavaMoat Policy Review Process doc before expecting an approval from Policy Reviewers. 🧪 @MetaMask/qa (1 files, +1 -1)
|
Worker reportTAT-3307 ReportTicket: TAT-3307 SummaryUpdated MetaMask Extension to Changes
Test Plan
Evidence Fit
Screenshots and video were intentionally omitted because the acceptance proof is dependency/state contract validation, not visible UI layout. Evidence Artifacts
Self-Review Fixes
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Builds ready [3b56954]
⚡ Performance Benchmarks (Total: 🟢 16 pass · 🟡 9 warn · 🔴 0 fail)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
farmslot run summary
Changed files:
Worker report
No live inline review comments or requested-changes reviews were returned for PR #43356. GitHub replies: none sent — live fetch returned no inline review comments or requested-changes review threads to reply to or resolve. Summary:
|
Worker reportPR #43356 — Review Comments ReportPR: feat(perps): update perps controller to latest on extension ContextUpdates Extension to Triage
Bot/conversation comments (CLA, codeowners, socket-security, metamaskbot builds, farmslot run summaries) are informational/automated — no action. Validation
Summary
Recipe re-validationPASS — inherited recipe Merge-main statusClean — merged |
Worker reportPR #43356 — Review Comments ReportPR: feat(perps): update perps controller to latest on extension State on entryAll 8 inline review comments were already addressed in code (commit
No conversation comment was actionable. No This run added no new comment-driven code changes. It committed one outstanding CI-greenness fix. Comment triage
This run's actual change
This fixes import-time test failure from spreading Commit: Validation results
Summary
|
Builds ready [b92d63e] [reused from c92b738]
⚡ Performance Benchmarks (Total: 🟢 16 pass · 🟡 9 warn · 🔴 0 fail)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
The perps-market-detail-page test mock was missing MARKET_CATEGORIES, causing TypeError. Integration tests lacked the moduleNameMapper for @metamask/perps-controller, failing on ESM parse of @noble/hashes.
Builds ready [2789fc1]
⚡ Performance Benchmarks (Total: 🟢 17 pass · 🟡 8 warn · 🔴 0 fail)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
There was a problem hiding this comment.
Please, make sure the unit tests that could be component view test, such ui/pages/perps/market-list/index.test.tsx are "converted" into CV test. Obviously the test coverage target should the the same and if there is something not possible under cv test framework, then relay on simple, more focus unit test
FYI, there is a cv test skill you can leverage and just focus on detailing the expected coverage to the AI
MajorLift
left a comment
There was a problem hiding this comment.
Extension changes (jest config change) look good
| moduleNameMapper: { | ||
| // Stub @metamask/perps-controller so integration suites can resolve it | ||
| // without transforming its ESM-only transitive deps (@nktkas/hyperliquid → | ||
| // @noble/hashes). Mirrors the unit jest config mapping. | ||
| '^@metamask/perps-controller$': | ||
| '<rootDir>/test/mocks/metamask-perps-controller.js', | ||
| }, |
There was a problem hiding this comment.
Just a heads-up that this will soon become unnecessary, as core and extension jest have plans to migrate to ESM-only.
There was a problem hiding this comment.
Attributions can be updated in RC branches. Removing this huge diff can be useful for reducing pr size and focusing reviewer effort.
Description
Updates Extension to
@metamask/perps-controller@^8.0.0and aligns Perps market filters with the v8 category contract.Key changes
VALID_MARKET_FILTERSnow derives from the controller'sMARKET_CATEGORIESinstead of a hardcoded list — adding a new category in core requires no UI code change (only an i18n label key).switchcases in market-list are collapsed into a genericdefaultusinggetMarketTypeFilter(m) === filter.normalizeMarketFiltermaps old plural forms (stocks→stock,commodities→commodity) so previously-shared URLs still resolve. Aligned with mobile (feat(perps): update perps controller to latest on mobile metamask-mobile#31248). Can be removed once no legacy deeplinks are in circulation.jest.integration.config.jsnow maps@metamask/perps-controllerto the existing CJS mock (same pattern asjest.config.js). Needed becauseshared/constants/perps.tsnow importsMARKET_CATEGORIESfrom the controller, which transitively pulls in@nktkas/hyperliquid→@noble/hashes(ESM-only). Jest cannot transform ESM innode_modulesby default.Changelog
CHANGELOG entry: null
Related issues
Fixes: TAT-3307
Related: MetaMask/metamask-mobile#31248 (same v8 upgrade on mobile)
Manual testing steps
yarn jest shared/lib/deep-links/routes/perps.test.ts ui/pages/perps/market-list/index.test.tsx ui/pages/perps/perps-market-detail-page.test.tsx ui/__mocks__/perps/perps-controller/index.test.ts --no-coverageScreenshots/Recordings
Not applicable: dependency/state contract update.
Pre-merge author checklist
Pre-merge reviewer checklist