-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
chore: migrate BridgeController to BaseController v2 #26109
Conversation
f155cae
to
d035314
Compare
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.
PR Summary
The migration of BridgeController
to BaseController v2
introduces significant architectural updates to improve maintainability and scalability.
-
File Deletions and Additions:
- Removed
app/scripts/controllers/bridge.ts
andbridge.test.ts
. - Added
app/scripts/controllers/bridge/bridge-controller.ts
andbridge-controller.test.ts
.
- Removed
-
State Management:
- Introduced
app/scripts/controllers/bridge/constants.ts
andtypes.ts
for defining constants and types. - Updated
app/scripts/lib/setupSentry.js
andmetamask-controller.js
to integrate new state properties.
- Introduced
-
Testing Enhancements:
- Modified
test/e2e/default-fixture.js
andmock-e2e.js
to include new properties for network allowlists. - Added comprehensive unit tests in
ui/ducks/bridge/selectors.test.ts
.
- Modified
-
Utility and Selector Updates:
- Enhanced
ui/pages/bridge/bridge.util.ts
andbridge.util.test.ts
for new feature flags. - Introduced new selectors in
ui/ducks/bridge/selectors.ts
.
- Enhanced
-
Redux and Mock Store:
- Updated
ui/ducks/bridge/actions.ts
,bridge.ts
, andbridge.test.ts
for new state management. - Enhanced
test/jest/mock-store.js
for flexible state customization.
- Updated
24 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings
Builds ready [d035314]
Page Load Metrics (75 ± 11 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
}, | ||
}; | ||
|
||
export default class BridgeController extends BaseController< |
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 want to keep this controller on the extension or should we move it to the core
monorepo?
dda7956
to
b4bf964
Compare
cfece3b
to
23d035d
Compare
Builds ready [23d035d]
Page Load Metrics (260 ± 234 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
f467c34
to
2c2b366
Compare
23d035d
to
bdf1bc2
Compare
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** This change adds a placeholder route for the cross-chain swaps experience (roughly based on swaps page). Clicking on the Bridge button should link to the route when the feature flag is turned on. Otherwise, the portfolio bridge experience is loaded (current behavior) New e2e tests: #25812 Migration to BaseController v2: #26109 <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/25481?quickstart=1) ## **Related issues** Fixes: [METABRIDGE-867](https://consensyssoftware.atlassian.net/browse/METABRIDGE-867) ## **Manual testing steps** 1. Build locally and set `BRIDGE_USE_DEV_APIS=1` 2. Check that bridge-api getAllFeatureFlags is fetched 3. Verify that bridgeState FF is set to true in state logs 3. Click on Bridge button and verify Bridge page is visible 5. Build locally and set `BRIDGE_USE_DEV_APIS=0` 6. Wait ~10 minutes 7. Reload and Check that bridge-api getAllFeatureFlags is fetched 3. Verify that bridgeState FF is set to false in state logs 8. Click on Bridge button and verify Portfolio URL is opened in a new tab ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** N/A <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ![Screenshot 2024-07-12 at 3 44 34 PM](https://github.com/user-attachments/assets/9490eb40-8239-4aad-9a28-ed5624e2b51e) ## **Pre-merge author checklist** - [X] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [X] I've completed the PR template to the best of my ability - [X] I’ve included tests if applicable - [X] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ X] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. [METABRIDGE-867]: https://consensyssoftware.atlassian.net/browse/METABRIDGE-867?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
2c2b366
to
eff057b
Compare
bdf1bc2
to
e118e91
Compare
The base branch was changed.
Builds ready [e118e91]
Page Load Metrics (77 ± 15 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #26109 +/- ##
========================================
Coverage 70.02% 70.03%
========================================
Files 1425 1426 +1
Lines 50029 50036 +7
Branches 13883 13883
========================================
+ Hits 35032 35039 +7
Misses 14997 14997 ☔ View full report in Codecov by Sentry. |
eff057b
to
54a78d0
Compare
e118e91
to
65c14a6
Compare
65c14a6
to
7d62780
Compare
Builds ready [65c14a6]
Page Load Metrics (76 ± 12 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
7d62780
to
bc0be06
Compare
Quality Gate passedIssues Measures |
Builds ready [bc0be06]
Page Load Metrics (241 ± 228 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [bc0be06]
Page Load Metrics (158 ± 158 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Description
Changes
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/METABRIDGE-866
Manual testing steps
Screenshots/Recordings
Before
N/A
After
N/A
Pre-merge author checklist
Pre-merge reviewer checklist