@metamask-previews/base-controller 4.1.1-preview.8cdddaf → 4.1.1-preview.cbe2fbb7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/CHANGELOG.md +38 -2
  2. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,4 +1,5 @@
1
1
  # Changelog
2
+
2
3
  All notable changes to this project will be documented in this file.
3
4
 
4
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
@@ -7,15 +8,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
8
  ## [Unreleased]
8
9
 
9
10
  ## [4.1.1]
11
+
10
12
  ### Changed
13
+
11
14
  - Bump `@metamask/utils` to `^8.3.0` ([#3769](https://github.com/MetaMask/core/pull/3769))
12
15
 
13
16
  ## [4.1.0]
17
+
14
18
  ### Added
19
+
15
20
  - Add `registerInitialEventPayload` to `ControllerMessenger` and `RestrictedControllerMessenger` ([#3697](https://github.com/MetaMask/core/pull/3697))
16
21
  - This allows registering an event payload function for an event, which has the benefit of ensuring the "subscription selector" feature works correctly the first time the event is fired after subscribing.
17
22
 
18
23
  ### Fixed
24
+
19
25
  - Fix `subscribe` method selector support on first publish ([#3697](https://github.com/MetaMask/core/pull/3697))
20
26
  - An event with a registered initial event payload function will work better with selectors, in that it will correctly compare with the initial selected state and return the previous value the first time it's published. Without this, the initial published event will always return `undefined` as the previous value.
21
27
  - Subscribers to the `stateChange` event of any `BaseControllerV2`-based controllers will now correctly handle the initial state change event ([#3702](https://github.com/MetaMask/core/pull/3702))
@@ -23,18 +29,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
23
29
  - `BaseControllerV2` has been updated to correctly compare with the previous value even for the first state change. The returned `previousValue` is also now guaranteed to be correct even for the initial state change.
24
30
 
25
31
  ## [4.0.1]
32
+
26
33
  ### Changed
34
+
27
35
  - Deprecate `subscribe` property from `BaseControllerV2` ([#3590](https://github.com/MetaMask/core/pull/3590), [#3698](https://github.com/MetaMask/core/pull/3698))
28
36
  - This property was used to differentiate between `BaseControllerV1` and `BaseControllerV2` controllers. It is no longer used, so it has been marked as deprecated.
29
37
 
30
38
  ## [4.0.0]
39
+
31
40
  ### Added
41
+
32
42
  - Add `ControllerGetStateAction` and `ControllerStateChangeEvent` types ([#1890](https://github.com/MetaMask/core/pull/1890), [#2029](https://github.com/MetaMask/core/pull/2029))
33
43
  - Add `NamespacedName` type ([#1890](https://github.com/MetaMask/core/pull/1890))
34
44
  - This is the narrowest supertype of all names defined within a given namespace.
35
45
  - Add `NotNamespacedBy` type, which matches an action/event name if and only if it is not prefixed by a given namespace ([#2051](https://github.com/MetaMask/core/pull/2051))
36
46
 
37
47
  ### Changed
48
+
38
49
  - **BREAKING:** Alter controller messenger `ActionHandler` type so `Action` type parameter must satisfy (updated) `ActionConstraint` ([#1890](https://github.com/MetaMask/core/pull/1890))
39
50
  - **BREAKING:** Alter controller messenger `ExtractActionParameters` utility type so `Action` type parameter must satisfy (updated) `ActionConstraint` ([#1890](https://github.com/MetaMask/core/pull/1890))
40
51
  - **BREAKING:** Alter controller messenger `ExtractEventHandler` utility type so `Event` type parameter must satisfy `EventConstraint` ([#1890](https://github.com/MetaMask/core/pull/1890))
@@ -53,61 +64,86 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
53
64
  - Bump `@metamask/utils` to ^8.2.0 ([#1957](https://github.com/MetaMask/core/pull/1957))
54
65
 
55
66
  ## [3.2.3]
67
+
56
68
  ### Changed
69
+
57
70
  - Bump dependency on `@metamask/utils` to ^8.1.0 ([#1639](https://github.com/MetaMask/core/pull/1639))
58
71
 
59
72
  ## [3.2.2]
73
+
60
74
  ### Changed
75
+
61
76
  - Update TypeScript to v4.8.x ([#1718](https://github.com/MetaMask/core/pull/1718))
62
77
 
63
78
  ## [3.2.1]
79
+
64
80
  ### Changed
81
+
65
82
  - There are no consumer-facing changes to this package. This version is a part of a synchronized release across all packages in our monorepo.
66
83
 
67
84
  ## [3.2.0]
85
+
68
86
  ### Changed
69
- - When deriving state, skip properties with invalid metadata ([#1529](https://github.com/MetaMask/core/pull/1529))
87
+
88
+ - When deriving state, skip properties with invalid metadata ([#1529](https://github.com/MetaMask/core/pull/1529))
70
89
  - The previous behavior was to throw an error
71
90
  - An error is thrown in a timeout handler so that it can still be captured in the console, and by global unhandled error handlers.
72
91
  - Update `@metamask/utils` to `^6.2.0` ([#1514](https://github.com/MetaMask/core/pull/1514))
73
92
 
74
93
  ## [3.1.0]
94
+
75
95
  ### Changed
96
+
76
97
  - Prevent event publish from throwing error ([#1475](https://github.com/MetaMask/core/pull/1475))
77
98
  - The controller messenger will no longer throw when an event subscriber throws an error. Calls to `publish` (either within controllers or on a messenger instance directly) will no longer throw errors.
78
99
  - Errors are thrown in a timeout handler so that they can still be logged and captured.
79
100
 
80
101
  ## [3.0.0]
102
+
81
103
  ### Changed
104
+
82
105
  - **BREAKING:** Bump to Node 16 ([#1262](https://github.com/MetaMask/core/pull/1262))
83
106
  - Replace `@metamask/controller-utils` dependency with `@metamask/utils` ([#1370](https://github.com/MetaMask/core/pull/1370))
84
107
 
85
108
  ## [2.0.0]
109
+
86
110
  ### Removed
111
+
87
112
  - **BREAKING:** Remove `isomorphic-fetch` ([#1106](https://github.com/MetaMask/controllers/pull/1106))
88
113
  - Consumers must now import `isomorphic-fetch` or another polyfill themselves if they are running in an environment without `fetch`
89
114
 
90
115
  ## [1.1.2]
116
+
91
117
  ### Changed
118
+
92
119
  - Rename this repository to `core` ([#1031](https://github.com/MetaMask/controllers/pull/1031))
93
- - Update `@metamask/controller-utils` package ([#1041](https://github.com/MetaMask/controllers/pull/1041))
120
+ - Update `@metamask/controller-utils` package ([#1041](https://github.com/MetaMask/controllers/pull/1041))
94
121
 
95
122
  ## [1.1.1]
123
+
96
124
  ### Changed
125
+
97
126
  - Relax dependency on `@metamask/controller-utils` (use `^` instead of `~`) ([#998](https://github.com/MetaMask/core/pull/998))
98
127
 
99
128
  ## [1.1.0]
129
+
100
130
  ### Added
131
+
101
132
  - Add `applyPatches` function to BaseControllerV2 ([#980](https://github.com/MetaMask/core/pull/980))
102
133
 
103
134
  ### Changed
135
+
104
136
  - Action and event handler types are now exported ([#987](https://github.com/MetaMask/core/pull/987))
105
137
  - Update `update` function to expose patches ([#980](https://github.com/MetaMask/core/pull/980))
106
138
 
107
139
  ## [1.0.0]
140
+
108
141
  ### Added
142
+
109
143
  - Initial release
144
+
110
145
  - As a result of converting our shared controllers repo into a monorepo ([#831](https://github.com/MetaMask/core/pull/831)), we've created this package from select parts of [`@metamask/controllers` v33.0.0](https://github.com/MetaMask/core/tree/v33.0.0), namely:
146
+
111
147
  - `src/BaseController.ts`
112
148
  - `src/BaseController.test.ts`
113
149
  - `src/BaseControllerV2.ts`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask-previews/base-controller",
3
- "version": "4.1.1-preview.8cdddaf",
3
+ "version": "4.1.1-preview.cbe2fbb7",
4
4
  "description": "Provides scaffolding for controllers as well a communication system for all controllers",
5
5
  "keywords": [
6
6
  "MetaMask",