@metamask-previews/composable-controller
Advanced tools
Comparing version 3.0.3-preview.eb58a59 to 4.0.0-preview.3fbb6b41
@@ -9,2 +9,7 @@ # Changelog | ||
## [4.0.0] | ||
### Changed | ||
- **BREAKING:** Bump `@metamask/base-controller` to ^4.0.0 ([#2063](https://github.com/MetaMask/core/pull/2063)) | ||
- This is breaking because the type of the `messenger` has backward-incompatible changes. See the changelog for this package for more. | ||
## [3.0.3] | ||
@@ -49,3 +54,4 @@ ### Changed | ||
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/composable-controller@3.0.3...HEAD | ||
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/composable-controller@4.0.0...HEAD | ||
[4.0.0]: https://github.com/MetaMask/core/compare/@metamask/composable-controller@3.0.3...@metamask/composable-controller@4.0.0 | ||
[3.0.3]: https://github.com/MetaMask/core/compare/@metamask/composable-controller@3.0.2...@metamask/composable-controller@3.0.3 | ||
@@ -52,0 +58,0 @@ [3.0.2]: https://github.com/MetaMask/core/compare/@metamask/composable-controller@3.0.1...@metamask/composable-controller@3.0.2 |
import type { RestrictedControllerMessenger } from '@metamask/base-controller'; | ||
import { BaseController } from '@metamask/base-controller'; | ||
import { BaseControllerV1 } from '@metamask/base-controller'; | ||
/** | ||
* List of child controller instances | ||
* | ||
* This type encompasses controllers based up either BaseController or | ||
* BaseControllerV2. The BaseControllerV2 type can't be included directly | ||
* This type encompasses controllers based up either BaseControllerV1 or | ||
* BaseController. The BaseController type can't be included directly | ||
* because the generic parameters it expects require knowing the exact state | ||
* shape, so instead we look for an object with the BaseControllerV2 properties | ||
* shape, so instead we look for an object with the BaseController properties | ||
* that we use in the ComposableController (name and state). | ||
*/ | ||
export declare type ControllerList = (BaseController<any, any> | { | ||
export declare type ControllerList = (BaseControllerV1<any, any> | { | ||
name: string; | ||
@@ -20,3 +20,3 @@ state: Record<string, unknown>; | ||
*/ | ||
export declare class ComposableController extends BaseController<never, any> { | ||
export declare class ComposableController extends BaseControllerV1<never, any> { | ||
private readonly controllers; | ||
@@ -32,3 +32,3 @@ private readonly messagingSystem?; | ||
* @param controllers - Map of names to controller instances. | ||
* @param messenger - The controller messaging system, used for communicating with BaseControllerV2 controllers. | ||
* @param messenger - The controller messaging system, used for communicating with BaseController controllers. | ||
*/ | ||
@@ -35,0 +35,0 @@ constructor(controllers: ControllerList, messenger?: ComposableControllerRestrictedMessenger); |
@@ -8,3 +8,3 @@ "use strict"; | ||
*/ | ||
class ComposableController extends base_controller_1.BaseController { | ||
class ComposableController extends base_controller_1.BaseControllerV1 { | ||
/** | ||
@@ -14,3 +14,3 @@ * Creates a ComposableController instance. | ||
* @param controllers - Map of names to controller instances. | ||
* @param messenger - The controller messaging system, used for communicating with BaseControllerV2 controllers. | ||
* @param messenger - The controller messaging system, used for communicating with BaseController controllers. | ||
*/ | ||
@@ -43,3 +43,3 @@ constructor(controllers, messenger) { | ||
else { | ||
throw new Error(`Messaging system required if any BaseControllerV2 controllers are used`); | ||
throw new Error(`Messaging system required if any BaseController controllers are used`); | ||
} | ||
@@ -46,0 +46,0 @@ }); |
{ | ||
"name": "@metamask-previews/composable-controller", | ||
"version": "3.0.3-preview.eb58a59", | ||
"version": "4.0.0-preview.3fbb6b41", | ||
"description": "Consolidates the state from multiple controllers into one", | ||
@@ -33,3 +33,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@metamask/base-controller": "^3.2.3" | ||
"@metamask/base-controller": "^4.0.0" | ||
}, | ||
@@ -36,0 +36,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17002
+ Added@metamask/base-controller@4.1.1(transitive)
- Removed@metamask/base-controller@3.2.3(transitive)