-
-
Notifications
You must be signed in to change notification settings - Fork 241
[composable-controller] perf: Optimize expensive reduce operations, fix metadata instantiation #4968
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
Merged
MajorLift
merged 25 commits into
main
from
jongsun/perf/composable-controller/241124-remove-expensive-reduce
Dec 5, 2024
Merged
[composable-controller] perf: Optimize expensive reduce operations, fix metadata instantiation #4968
Changes from 20 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
2a4a115
perf: Convert reduce operations to re-use output object instead of cr…
MajorLift 2612d4a
fix: incorrect logic for assigning fall-back metadata properties for …
MajorLift 87fc3f6
fix: type issue with assigning property to generic type
MajorLift 2a18840
feat: **BREAKING:** Re-define `controllers` constructor option from a…
MajorLift 7b0be9f
fix: Check that input is V1/V2 controller when instantiating Composab…
MajorLift 871486a
test: Update tests
MajorLift c103016
Update changelogs
MajorLift c570e26
Update comments
MajorLift 901e8b4
perf: Replace` Object.assign` with property assignments
MajorLift 55af3a6
Assign metadata to each child controller instead of to individual nes…
MajorLift c533f7c
Remove non-controller properties from state, metadata fields
MajorLift c1a4670
test: fix missing `stateChange` events in test composable-controller …
MajorLift 5b94171
Update jsdoc comments
MajorLift 571a483
Fix undefined property deletion behavior
MajorLift 77fb0e8
Apply `eslint-disable` to entire test file to allow PascalCase contro…
MajorLift a7e7296
Fix types
MajorLift b23ef8e
Update changelog
MajorLift c420da0
Wrap delete operations for non-controllers in try-catch block
MajorLift 518eaa7
Add tests for `stateChange` events that are not defined or omitted fr…
MajorLift 244f6c8
Update packages/composable-controller/CHANGELOG.md
MajorLift 0b52f5f
Add links to changelog entries
MajorLift 61c9697
Add comments explaining reduce implementation and type assertions
MajorLift 74e45f4
Rename `QuxController` to `ControllerWithoutStateChangeEvent`
MajorLift db8147a
Rename `ChildControllers` type parameter to `ChildControllersMap`
MajorLift 4583266
Merge branch 'main' into jongsun/perf/composable-controller/241124-re…
MajorLift File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |
|
||
## [Unreleased] | ||
|
||
### Changed | ||
|
||
- **BREAKING:** `ComposableController` constructor option `controllers` and generic type argument `ChildControllers` are re-defined from an array of controller instances to an object that maps controller names to controller instances. | ||
MajorLift marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- **BREAKING:** `ComposableController` class field objects `state` and `metadata` exclude child controllers that do not extend from `BaseController` or `BaseControllerV1`. Any non-controller entries that are passed into the constructor will be removed automatically. | ||
MajorLift marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
### Fixed | ||
|
||
- **BREAKING:** `ComposableController` class field object `metadata` now assigns the `StateMetadataProperty`-type object `{ persist: true, anonymous: true }` to each child controller name. | ||
mcmire marked this conversation as resolved.
Show resolved
Hide resolved
MajorLift marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- Previously, V2 child controllers were erroneously assigned their own metadata object. This issue was introduced in `@metamask/[email protected]`. | ||
|
||
## [9.0.1] | ||
|
||
### Fixed | ||
|
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.