Skip to content

RFC: Replace controllers with Redux slices - #311

Closed
Gudahtt wants to merge 1 commit into
developfrom
background-refactor-redux
Closed

Gudahtt wants to merge 1 commit into
developfrom
background-refactor-redux

Conversation

@Gudahtt

@Gudahtt Gudahtt commented Nov 18, 2020 •

Copy link
Copy Markdown
Member

This represents a prototype implementation of a new controller API design. The motivations for this are written about in this document: https://docs.google.com/document/d/1DjtFfNB0JuziijGqs4h3vW8PL8zCI6zuaovqvSHbJ2o/edit#heading=h.mtvpfhpuzjof

The CurrencyRateController has been updated to use Redux.

Note that the CurrencyRateController no longer works correctly with the ComposableController - I didn't think that was worth the effort to get working.

@Gudahtt Gudahtt changed the title Implement redesigned controller API Replace controllers with Redux slices Nov 18, 2020
@Gudahtt
Gudahtt force-pushed the background-refactor-redux branch from 4dbcb58 to cf4451d Compare November 18, 2020 20:31
@Gudahtt Gudahtt changed the title Replace controllers with Redux slices RFC: Replace controllers with Redux slices Nov 18, 2020
This represents a prototype implementation of a new controller API
design. The motivations for this are written about in this document:
https://docs.google.com/document/d/1DjtFfNB0JuziijGqs4h3vW8PL8zCI6zuaovqvSHbJ2o/edit#heading=h.mtvpfhpuzjof

The `CurrencyRateController` has been updated to use Redux.

Note that the `CurrencyRateController` no longer works correctly with
the `ComposableController` - I didn't think that was worth the effort
to get working.
@Gudahtt
Gudahtt force-pushed the background-refactor-redux branch from cf4451d to ace8eac Compare November 19, 2020 16:48
@Gudahtt

Gudahtt commented Feb 2, 2021

Copy link
Copy Markdown
Member Author

We've decided to go with the other prototype for now.

@Gudahtt Gudahtt closed this Feb 2, 2021
@Gudahtt
Gudahtt deleted the background-refactor-redux branch February 27, 2021 17:32
Naz-Ovh pushed a commit to 0x-fork/metamask-core that referenced this pull request Sep 13, 2026
Part of
[PR#2](https://github.com/MetaMask/core/blob/main/docs/processes/package-migration-process-guide.md)
of the migration guide, following the same split used for
[smart-transactions-controller#590](MetaMask/smart-transactions-controller#590).

## Dependencies

Bumped to the ranges core already resolves:

| Dep | From | To |
| --- | --- | --- |
| `@metamask/scure-bip39` | `^2.0.3` | `^2.1.1` |
| `@metamask/superstruct` | `^3.1.0` | `^3.4.1` |
| `@noble/hashes` | `^1.3.1` | `^1.8.0` |
| `@scure/base` | `^1.1.3` | `^1.2.6` |
| `semver` | `^7.5.4` | `^7.6.3` |

All minor or patch. `@ethereumjs/tx` is **not** included: core is on
`^5.4.0` against our `^4.2.0`, and a major bump deserves its own PR.

Where we sit ahead of core (`uuid` 9 vs 8, `@types/node` 18 vs 16,
`@types/lodash`), nothing is decremented here. The guide handles that
later in PR#10.

## tsconfig

Aligned with `tsconfig.base.json` in core: adds `isolatedModules`,
switches `module`/`moduleResolution` from `nodenext` to `Node16`,
normalises `lib`/`target` casing.

Kept the four strict flags core does not set, per the guide's "preserve
any TypeScript compiler flags that are enabled in the source repo but
not in core": `exactOptionalPropertyTypes`,
`forceConsistentCasingInFileNames`, `noErrorTruncation`,
`noUncheckedIndexedAccess`.

`composite` is deliberately not added yet. That belongs in Phase B PR#9
when the tsconfig starts extending the monorepo root.


<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Bumps touch validation (`@metamask/superstruct`) and crypto/mnemonic
paths (`@noble/hashes`, `@scure/base`, BIP-39) with no code changes, so
regressions would show up only via tests or downstream consumers.
> 
> **Overview**
> Aligns **@metamask/utils** with the MetaMask core monorepo as part of
the package migration guide: dependency ranges and TypeScript settings
are updated without touching application source.
> 
> **Dependencies** (plus `yarn.lock` and **CHANGELOG** entries): bumps
`@metamask/scure-bip39`, `@metamask/superstruct`, `@noble/hashes`,
`@scure/base`, and `semver` to the versions core already resolves. Dev
**TypeScript** moves from `~5.0.4` to `~5.3.3`. `@ethereumjs/tx` is
intentionally unchanged.
> 
> **tsconfig.json** matches core’s base setup: enables
`isolatedModules`, switches `module` / `moduleResolution` from
`nodenext` to `Node16`, and normalizes `lib` / `target` casing. Existing
stricter compiler flags in this repo are left in place; `composite` is
not added yet.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
5aef52616ea6af8ea24da40b43fd0a239b3fd295. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Naz-Ovh pushed a commit to 0x-fork/metamask-core that referenced this pull request Sep 13, 2026
…k#318)

Top of stack MetaMask#315, on MetaMask#317.

| Dep | From | To |
| --- | --- | --- |
| `typedoc` | `^0.23.15` | `^0.25.13` |
| `@lavamoat/preinstall-always-fail` | `^1.0.0` | `^2.1.0` |
| `jest-when` | `^3.6.0` | `^3.7.0` |

The typedoc bump fixes a live break. typedoc 0.23 caps at TypeScript
5.0, so once MetaMask#311 moved us to `~5.3.3`, `yarn build:docs` crashed with
`Cannot read properties of undefined (reading 'name')`. Nothing caught
it because PR CI never runs `build:docs`, only the docs publish workflow
does.

Also `.nvmrc` `v18` to `lts/*`, and `@ts-bridge/*` added to
`npmPreapprovedPackages`. Both match core.

Left alone on purpose:

- `oxfmt` stays at `^0.44.0` even though
`@metamask/auto-changelog@6.2.1` peer requests `^0.45.0`. Core pins the
same pair, so bumping would diverge from it.


<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Dev-only dependency and Node version pin changes; no runtime library
or security-sensitive application logic is modified.
> 
> **Overview**
> Aligns **dev tooling** with MetaMask core: bumps **`typedoc`** to
`^0.25.13` (and lockfile transitive deps like `marked`, `shiki`,
`minimatch`) so **`yarn build:docs`** works with **`typescript
~5.3.3`**—older typedoc only supported TS ≤5.0 and was failing at doc
generation.
> 
> Also updates **`@lavamoat/preinstall-always-fail`** to `^2.1.0` and
**`jest-when`** to `^3.7.0`, and switches **`.nvmrc`** from `v18` to
**`lts/*`** so local Node tracks current LTS like core.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
654f1e29169b87c50b78f916d2ae5cef30bca178. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant