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

refactor: Unflatten MetamaskController stores (1/5) #28723

Open
wants to merge 32 commits into
base: jongsun/tmp/241211-unflattening-feature-branch
Choose a base branch
from

Conversation

MajorLift
Copy link
Contributor

@MajorLift MajorLift commented Nov 26, 2024

Important

CI fails will be addressed in subsequent PRs. Review on high-level approach needed first.

Motivation

Eliminates flattening operation performed on the background state proxy object before it's supplied to the Redux store.

  • Better debugging: Removes unnecessary obfuscation on which state property belongs to which controller, making runtime error messages easier to understand.
  • Reduces errors: By isolating each controller's state in Redux, the possibility of state pollution due to one controller overriding state properties that belong to another controller is removed.
  • Performance optimization for UI startup and state updates via patch generation.

Description

The key changes are in the following files:

Note

See PR comments below for a walkthrough of the changes.

Open in GitHub Codespaces

Related issues

Manual testing steps

Screenshots/Recordings

Before

After

Pre-merge author checklist

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 MajorLift added the team-tiger Tiger team (for tech debt reduction + performance improvements) label Nov 26, 2024
@MajorLift MajorLift self-assigned this Nov 26, 2024
Copy link
Contributor

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 MajorLift force-pushed the jongsun/perf/redux/241008-unflatten-MetamaskController-stores branch 2 times, most recently from 7be6a8e to 25a6496 Compare November 27, 2024 13:50
@MajorLift MajorLift changed the base branch from develop to jongsun/perf/redux/241122-move-metamask-slice-ui-properties-to-appstate-slice November 27, 2024 14:29
@MajorLift MajorLift force-pushed the jongsun/perf/redux/241008-unflatten-MetamaskController-stores branch from 25a6496 to 9033a25 Compare November 27, 2024 15:55
@MajorLift MajorLift changed the title perf: Unflatten MetamaskController stores perf: Unflatten MetamaskController stores, metamask Redux slice Nov 27, 2024
@MajorLift MajorLift force-pushed the jongsun/perf/redux/241122-move-metamask-slice-ui-properties-to-appstate-slice branch from a0e1a64 to 65261bb Compare December 2, 2024 08:08
@MajorLift MajorLift force-pushed the jongsun/perf/redux/241008-unflatten-MetamaskController-stores branch 2 times, most recently from 33ac103 to 1357990 Compare December 2, 2024 08:17
@MajorLift MajorLift force-pushed the jongsun/perf/redux/241122-move-metamask-slice-ui-properties-to-appstate-slice branch from 098ecc7 to 4f17dc3 Compare December 2, 2024 08:44
@MajorLift MajorLift force-pushed the jongsun/perf/redux/241008-unflatten-MetamaskController-stores branch 2 times, most recently from 4153b72 to a7fc45e Compare December 2, 2024 09:02
@MajorLift MajorLift force-pushed the jongsun/perf/redux/241122-move-metamask-slice-ui-properties-to-appstate-slice branch from 4f17dc3 to 25cce0c Compare December 2, 2024 10:11
@MajorLift MajorLift force-pushed the jongsun/perf/redux/241008-unflatten-MetamaskController-stores branch from a7fc45e to 907d672 Compare December 2, 2024 10:11
@MajorLift MajorLift force-pushed the jongsun/perf/redux/241122-move-metamask-slice-ui-properties-to-appstate-slice branch 10 times, most recently from 36eb3e6 to 039de0e Compare December 2, 2024 19:21
@MajorLift MajorLift force-pushed the jongsun/perf/redux/241008-unflatten-MetamaskController-stores branch 3 times, most recently from 99ebad8 to 24d057f Compare December 4, 2024 15:58
@MajorLift MajorLift changed the title perf: Unflatten MetamaskController stores, metamask Redux slice perf: Unflatten MetamaskController stores Dec 4, 2024
…hange` listener and avoid iterating through entire `metamask` slice for every background state update
… and exposes their composed state via `.getState()`
…d state and individual controller states as input
…pdates to the entire background state or top-level non-object properties of background state
…re it can handle the unflattened background state
@MajorLift MajorLift force-pushed the jongsun/perf/redux/241008-unflatten-MetamaskController-stores branch from c0736de to 996b126 Compare December 18, 2024 03:29
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)
Projects
Status: Review in progress
Development

Successfully merging this pull request may close these issues.

2 participants