-
Notifications
You must be signed in to change notification settings - Fork 406
refactor(store): make execution stategies tree-shakable #2316
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
Conversation
View your CI Pipeline Execution ↗ for commit 22814a9.
☁️ Nx Cloud last updated this comment at |
View your CI Pipeline Execution ↗ for commit 7036d7f.
☁️ Nx Cloud last updated this comment at |
@ngxs/devtools-plugin
@ngxs/form-plugin
@ngxs/hmr-plugin
@ngxs/router-plugin
@ngxs/storage-plugin
@ngxs/store
@ngxs/websocket-plugin
commit: |
7036d7f
to
f9c4d73
Compare
Code Climate has analyzed commit f9c4d73 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 100.0% (50% is the threshold). This pull request will bring the total coverage in the repository to 95.3% (0.0% change). View more on Code Climate. |
NGXS has moved towards reducing bundle size by removing unnecessary code in production. Currently, execution strategies are not tree-shakable because they are explicitly referenced in the code. We should invert control and require developers to explicitly provide an execution strategy. When zoneless change detection is enabled and `NoopNgxsExecutionStrategy` is used, `DispatchOutsideZoneNgxsExecutionStrategy` remains in the initial bundle, increasing the final size even though it is never used — and vice versa. With this commit, we make `options` a required parameter and `options.executionStrategy` a required property, ensuring that developers always specify an execution strategy. **BREAKING CHANGE**: The `options` parameter is now required when calling `forRoot()` or `provideStore()`, as developers must provide an execution strategy. This should be a straightforward change, as developers only need to specify `{ executionStrategy: DispatchOutsideZoneNgxsExecutionStrategy }`.
f9c4d73
to
22814a9
Compare
NGXS has moved towards reducing bundle size by removing unnecessary code in production.
Currently, execution strategies are not tree-shakable because they are explicitly
referenced in the code. We should invert control and require developers to explicitly
provide an execution strategy.
When zoneless change detection is enabled and
NoopNgxsExecutionStrategy
is used,DispatchOutsideZoneNgxsExecutionStrategy
remains in the initial bundle, increasingthe final size even though it is never used — and vice versa.
With this commit, we make
options
a required parameter andoptions.executionStrategy
arequired property, ensuring that developers always specify an execution strategy.
BREAKING CHANGE: The
options
parameter is now required when callingforRoot()
orprovideStore()
, as developers must provide an execution strategy. This should be astraightforward change, as developers only need to specify
{ executionStrategy: DispatchOutsideZoneNgxsExecutionStrategy }
.