-
Notifications
You must be signed in to change notification settings - Fork 405
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
feat(store): warn on unhandled actions #1870
Conversation
434bcd8
to
d42966e
Compare
BundleMonFiles updated (2)
Unchanged files (4)
Total files change +9.48KB +3.29% Groups updated (6)
Final result: ❌ View report in BundleMon website ➡️ |
BundleMon (NGXS Plugins)Unchanged files (28)
No change in files bundle size Unchanged groups (6)
Final result: ✅ View report in BundleMon website ➡️ |
BundleMon (Integration Projects)Files updated (4)
Total files change +208B +0.07% Final result: ✅ View report in BundleMon website ➡️ |
d42966e
to
3aa3031
Compare
@arturovt Could you add a description for this PR and the motivation for the feature? |
3aa3031
to
4b44381
Compare
4b44381
to
4ff52bd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that the API for this needs to be revised.
See the last comment.
TestBed.configureTestingModule({ | ||
imports: [NgxsModule.forRoot([], { warnOnUnhandledActions })] | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I propose a bit of a different API for this.
No config option, or ignoreActions
utility, but rather a module that is provided:
TestBed.configureTestingModule({ | |
imports: [NgxsModule.forRoot([], { warnOnUnhandledActions })] | |
}); | |
TestBed.configureTestingModule({ | |
imports: [ | |
NgxsModule.forRoot([]), | |
ngDevMode && NgxsDevelopmentModule.forRoot({ | |
warnOnUnhandledActions: true | |
/* or supply an object: | |
warnOnUnhandledActions: { | |
ignore: [ 'SomeActionType', FooActionClass ] | |
} | |
*/ | |
}) | |
] | |
}); |
This keeps the API consolidated and clear, and follows the existing conventions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love it.
4ff52bd
to
ce41941
Compare
ce41941
to
15a402a
Compare
Code Climate has analyzed commit 63de3f6 and detected 1 issue on this pull request. Here's the issue category breakdown:
The test coverage on the diff in this pull request is 97.3% (50% is the threshold). This pull request will bring the total coverage in the repository to 96.9% (0.0% change). View more on Code Climate. |
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@ngxs/form-plugin](https://github.com/ngxs/store) | dependencies | minor | [`3.7.6` -> `3.8.0`](https://renovatebot.com/diffs/npm/@ngxs%2fform-plugin/3.7.6/3.8.0) | | [@ngxs/storage-plugin](https://github.com/ngxs/store) | dependencies | minor | [`3.7.6` -> `3.8.0`](https://renovatebot.com/diffs/npm/@ngxs%2fstorage-plugin/3.7.6/3.8.0) | | [@ngxs/store](https://github.com/ngxs/store) | dependencies | minor | [`3.7.6` -> `3.8.0`](https://renovatebot.com/diffs/npm/@ngxs%2fstore/3.7.6/3.8.0) | --- ### Release Notes <details> <summary>ngxs/store</summary> ### [`v3.8.0`](https://github.com/ngxs/store/blob/HEAD/CHANGELOG.md#​380-2023-03-29) [Compare Source](ngxs/store@v3.7.6...v3.8.0) - Feature: Build packages in Ivy format [#​1945](ngxs/store#1945) - Feature: Add advanced selector utilities [#​1824](ngxs/store#1824) - Feature: Expose `ActionContext` and `ActionStatus` [#​1766](ngxs/store#1766) - Feature: `ofAction*` methods should have strong types [#​1808](ngxs/store#1808) - Feature: Improve contextual type inference for state operators [#​1806](ngxs/store#1806) [#​1947](ngxs/store#1947) - Feature: Enable warning on unhandled actions [#​1870](ngxs/store#1870) [#​1951](ngxs/store#1951) - Feature: Router Plugin - Provide more actions and navigation timing option [#​1932](ngxs/store#1932) - Feature: Storage Plugin - Allow providing namespace for keys [#​1841](ngxs/store#1841) - Feature: Storage Plugin - Enable providing storage engine individually [#​1935](ngxs/store#1935) - Feature: Devtools Plugin - Add new options to the `NgxsDevtoolsOptions` interface [#​1879](ngxs/store#1879) - Feature: Devtools Plugin - Add trace options to `NgxsDevtoolsOptions` [#​1968](ngxs/store#1968) - Feature: Form Plugin - Allow `ngxsFormDebounce` to be string [#​1972](ngxs/store#1972) - Performance: Tree-shake patch errors [#​1955](ngxs/store#1955) - Fix: Get descriptor explicitly when it's considered as a class property [#​1961](ngxs/store#1961) - Fix: Avoid delayed updates from state stream [#​1981](ngxs/store#1981) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4yNC41IiwidXBkYXRlZEluVmVyIjoiMzUuMjQuNSJ9--> Co-authored-by: cabr2-bot <cabr2.help@gmail.com> Reviewed-on: https://codeberg.org/Calciumdibromid/CaBr2/pulls/1837 Reviewed-by: Epsilon_02 <epsilon_02@noreply.codeberg.org> Co-authored-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org> Co-committed-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org>
No description provided.