-
Notifications
You must be signed in to change notification settings - Fork 5k
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
refactor: Unflatten metamask
Redux slice and convert to TypeScript
#28929
Draft
MajorLift
wants to merge
13
commits into
jongsun/perf/redux/241008-unflatten-MetamaskController-stores
Choose a base branch
from
jongsun/perf/redux/241204-unflatten-metamask-slice
base: jongsun/perf/redux/241008-unflatten-MetamaskController-stores
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MajorLift
added
the
team-tiger
Tiger team (for tech debt reduction + performance improvements)
label
Dec 4, 2024
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. |
MajorLift
force-pushed
the
jongsun/perf/redux/241204-unflatten-metamask-slice
branch
from
December 4, 2024 16:19
236e650
to
ebbef43
Compare
MajorLift
added
DO-NOT-MERGE
Pull requests that should not be merged
and removed
team-wallet-framework
labels
Dec 4, 2024
MajorLift
changed the title
perf: Unflatten
perf: Unflatten Dec 4, 2024
metamask
Redux slicemetamask
Redux slice (2/3)
7 tasks
MajorLift
force-pushed
the
jongsun/perf/redux/241204-unflatten-metamask-slice
branch
2 times, most recently
from
December 4, 2024 17:12
4ecfafa
to
865b649
Compare
MajorLift
changed the title
perf: Unflatten
perf: Unflatten Dec 4, 2024
metamask
Redux slice (2/3)metamask
Redux slice and convert to TypeScript (2/3)
MajorLift
force-pushed
the
jongsun/perf/redux/241204-unflatten-metamask-slice
branch
from
December 5, 2024 03:06
865b649
to
0ce95c9
Compare
MajorLift
force-pushed
the
jongsun/perf/redux/241008-unflatten-MetamaskController-stores
branch
2 times, most recently
from
December 5, 2024 06:20
4c9f32c
to
286bcab
Compare
MajorLift
force-pushed
the
jongsun/perf/redux/241204-unflatten-metamask-slice
branch
2 times, most recently
from
December 5, 2024 13:10
59c3d27
to
860d590
Compare
MajorLift
force-pushed
the
jongsun/perf/redux/241008-unflatten-MetamaskController-stores
branch
from
December 6, 2024 16:48
c22768b
to
ee9c45e
Compare
MajorLift
force-pushed
the
jongsun/perf/redux/241204-unflatten-metamask-slice
branch
from
December 6, 2024 16:54
860d590
to
431ba66
Compare
MajorLift
force-pushed
the
jongsun/perf/redux/241008-unflatten-MetamaskController-stores
branch
from
December 6, 2024 18:05
ee9c45e
to
5de8ba9
Compare
MajorLift
force-pushed
the
jongsun/perf/redux/241204-unflatten-metamask-slice
branch
from
December 6, 2024 18:06
431ba66
to
a0dea86
Compare
MajorLift
force-pushed
the
jongsun/perf/redux/241008-unflatten-MetamaskController-stores
branch
from
December 6, 2024 18:34
5de8ba9
to
9f7195b
Compare
MajorLift
force-pushed
the
jongsun/perf/redux/241204-unflatten-metamask-slice
branch
3 times, most recently
from
December 8, 2024 18:25
b4e3d7a
to
c4c5dc0
Compare
MajorLift
force-pushed
the
jongsun/perf/redux/241204-unflatten-metamask-slice
branch
from
December 12, 2024 20:14
af56482
to
b5ddb61
Compare
MajorLift
force-pushed
the
jongsun/perf/redux/241008-unflatten-MetamaskController-stores
branch
from
December 18, 2024 03:29
c0736de
to
996b126
Compare
MajorLift
force-pushed
the
jongsun/perf/redux/241204-unflatten-metamask-slice
branch
from
December 18, 2024 03:30
b5ddb61
to
62d01dd
Compare
MajorLift
force-pushed
the
jongsun/perf/redux/241008-unflatten-MetamaskController-stores
branch
from
January 6, 2025 16:11
996b126
to
f4ef2f1
Compare
MajorLift
force-pushed
the
jongsun/perf/redux/241204-unflatten-metamask-slice
branch
2 times, most recently
from
January 6, 2025 18:15
b1ce481
to
1add77c
Compare
MajorLift
force-pushed
the
jongsun/perf/redux/241008-unflatten-MetamaskController-stores
branch
from
January 6, 2025 19:38
da73439
to
cd636c5
Compare
MajorLift
force-pushed
the
jongsun/perf/redux/241204-unflatten-metamask-slice
branch
from
January 6, 2025 19:39
1add77c
to
c47ed91
Compare
MajorLift
changed the title
refactor: Unflatten
refactor: Unflatten Jan 7, 2025
metamask
Redux slice and convert to TypeScript (2/5)metamask
Redux slice and convert to TypeScript (2/6)
27 tasks
MajorLift
changed the title
refactor: Unflatten
refactor: Unflatten Jan 9, 2025
metamask
Redux slice and convert to TypeScript (2/6)metamask
Redux slice and convert to TypeScript
MajorLift
requested review from
HowardBraham
and removed request for
HowardBraham
January 9, 2025 15:57
github-merge-queue bot
pushed a commit
that referenced
this pull request
Jan 13, 2025
…ate` slice (#28703) ## **Description** 1. Moves properties in the `metamask` Redux slice that are not part of background (i.e. controller-derived) state into the `appState` slice. The affected state properties are as follows: ``` customNonceValue: string; isAccountMenuOpen: boolean; isNetworkMenuOpen: boolean; nextNonce: string | null; pendingTokens: { [address: string]: Token & { isCustom?: boolean; unlisted?: boolean }; }; welcomeScreenSeen: boolean; confirmationExchangeRates: ContractExchangeRates; ``` - Foreground properties that are a part of `AppStateController` state have not been moved into the `appState` slice, and will remain in the unflattened `metamask` slice. - It's not immediately clear why the properties listed above were excluded from `AppStateController` state, but since all of them appear to neither require persistence beyond a given session, nor anonymization of PII, I'm opting to maintain the status quo and keep them out of controller state. - The `isInitialized` property is not included, because it's derived from background state before the Redux store is instantiated, and is updated by the `PatchStore` which supplies it directly to the `metamask` slice. 2. Groups `appState` slice selectors in `ui/selectors/selectors.js` together. [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/28703?quickstart=1) ## **Related issues** - Closes #29601 - Closes MetaMask/MetaMask-planning#2895 - 0 of 7 PRs that will close #29600 - Blocking MetaMask/MetaMask-planning#2894 - #28723 - #28929 - #28776 ## **Manual testing steps** ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **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.
MajorLift
force-pushed
the
jongsun/perf/redux/241008-unflatten-MetamaskController-stores
branch
from
January 14, 2025 11:04
cd636c5
to
83316a5
Compare
…kState` for inference of `metamask` slice type
…alMetamaskState`
…_BACKGROUND_STATE`
MajorLift
force-pushed
the
jongsun/perf/redux/241204-unflatten-metamask-slice
branch
from
January 14, 2025 11:36
c47ed91
to
7af2f6a
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
DO-NOT-MERGE
Pull requests that should not be merged
team-extension-platform
team-tiger
Tiger team (for tech debt reduction + performance improvements)
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Important
CI fails will be addressed in subsequent PRs. Review on high-level approach needed first.
Description
Unflattens the Redux store
metamask
slice with a new source of truth: theBackgroundStateProxy
-type object that is now supplied by theMetamaskController
to Redux (#28723).Replaces
CombinedBackgroundAndReduxState
,TemporaryBackgroundState
.The key changes in this PR are contained in the following two files, with the remaining files being downstream updates:
ui/store/store.ts
ui/ducks/metamask/metamask.js -> ui/ducks/metamask/metamask.ts
The
initialState
for themetamask
slice has been consolidated and moved toui/ducks/metamask/constants.ts
. We should be able to remove this eventually, but the existing initial values are preserved for now.Related issues
metamask
slice. #29603metamask
Redux slice #29600MetamaskController
stores #28723Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist