-
Notifications
You must be signed in to change notification settings - Fork 406
chore: migrate executionStrategy #2317
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 10eb7fb.
☁️ Nx Cloud last updated this comment at |
ded816a to
a20520d
Compare
b3bd6d9 to
301fe58
Compare
|
The schematics-utils could be a separate package so that it can be re-used by store, storage-plugin or any other package |
@ngxs/devtools-plugin
@ngxs/form-plugin
@ngxs/hmr-plugin
@ngxs/router-plugin
@ngxs/storage-plugin
@ngxs/store
@ngxs/websocket-plugin
commit: |
484baf5 to
b7ccd05
Compare
e91a91a to
a4201d7
Compare
| `Migrating provideStore with states and existing properties in ${path}` | ||
| ); | ||
| migrateForRootWithExistingOptions(provideStoreImport.arguments, path, changes); | ||
| } |
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.
Would it also migrate provideStore with plugins after state?
provideStore([], withNgxsRouterPlugin(), withNgxsStoragePlugin(), ....)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.
hmm I don't think this will work.
Is this how the migrated code should look like?
Before
provideStore([], withNgxsRouterPlugin(), withNgxsStoragePlugin())After
provideStore([], withNgxsRouterPlugin(), withNgxsStoragePlugin(), {executionStrategy:DispatchOutsideZoneNgxsExecutionStrategy})Before
provideStore([], withNgxsRouterPlugin(), withNgxsStoragePlugin(), {foo:'bar'})After
provideStore([], withNgxsRouterPlugin(), withNgxsStoragePlugin(), {foo:'bar', executionStrategy:DispatchOutsideZoneNgxsExecutionStrategy})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.
It should be:
proideStore([], OPTIONS, ....plugins)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.
Would it be easier if we had a function called withNgxsOptions({ ... })?
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.
provideStore(states, ...plugins)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 did some changes to take under consideration the plugins.
I am not sure if having a function to provide the options would make the migration easier, but for sure it would be better in terms of API.
If we want to go that route, we should also migrate the existing options to this function. This could be a separate migration which could run after the executionStrategy migration
66b8847 to
e16bd36
Compare
e16bd36 to
10eb7fb
Compare
|
Code Climate has analyzed commit 10eb7fb and detected 11 issues on this pull request. Here's the issue category breakdown:
The test coverage on the diff in this pull request is 96.3% (50% is the threshold). This pull request will bring the total coverage in the repository to 94.1% (0.0% change). View more on Code Climate. |
In this PR I introduced the migration scripts and moved some schematics utils to a separate directory