Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@profanis
Copy link
Contributor

@profanis profanis commented Apr 9, 2025

In this PR I introduced the migration scripts and moved some schematics utils to a separate directory

@nx-cloud
Copy link

nx-cloud bot commented Apr 9, 2025

View your CI Pipeline Execution ↗ for commit 10eb7fb.

Command Status Duration Result
nx run-many --target=test --all --configuration... ✅ Succeeded 2m 25s View ↗
nx lint-types store ✅ Succeeded <1s View ↗
nx run-many --target=lint --all --exclude=creat... ✅ Succeeded 6s View ↗
nx run-many --target=build --all ✅ Succeeded 1m 30s View ↗

☁️ Nx Cloud last updated this comment at 2025-04-18 10:30:20 UTC

@profanis profanis force-pushed the fp/migrate-execution-strategy branch 2 times, most recently from ded816a to a20520d Compare April 9, 2025 05:34
@profanis profanis marked this pull request as ready for review April 9, 2025 08:59
@profanis profanis force-pushed the fp/migrate-execution-strategy branch 2 times, most recently from b3bd6d9 to 301fe58 Compare April 9, 2025 15:16
@profanis
Copy link
Contributor Author

profanis commented Apr 9, 2025

The schematics-utils could be a separate package so that it can be re-used by store, storage-plugin or any other package

@pkg-pr-new
Copy link

pkg-pr-new bot commented Apr 9, 2025

Open in StackBlitz

@ngxs/devtools-plugin

npm i https://pkg.pr.new/@ngxs/devtools-plugin@2317

@ngxs/form-plugin

npm i https://pkg.pr.new/@ngxs/form-plugin@2317

@ngxs/hmr-plugin

npm i https://pkg.pr.new/@ngxs/hmr-plugin@2317

@ngxs/router-plugin

npm i https://pkg.pr.new/@ngxs/router-plugin@2317

@ngxs/storage-plugin

npm i https://pkg.pr.new/@ngxs/storage-plugin@2317

@ngxs/store

npm i https://pkg.pr.new/@ngxs/store@2317

@ngxs/websocket-plugin

npm i https://pkg.pr.new/@ngxs/websocket-plugin@2317

commit: 10eb7fb

@profanis profanis force-pushed the fp/migrate-execution-strategy branch from 484baf5 to b7ccd05 Compare April 10, 2025 05:09
@profanis profanis requested a review from arturovt April 16, 2025 05:16
@profanis profanis force-pushed the fp/migrate-execution-strategy branch from e91a91a to a4201d7 Compare April 16, 2025 05:19
`Migrating provideStore with states and existing properties in ${path}`
);
migrateForRootWithExistingOptions(provideStoreImport.arguments, path, changes);
}
Copy link
Member

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(), ....)

Copy link
Contributor Author

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})

Copy link
Member

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)

Copy link
Member

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({ ... })?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

provideStore(states, ...plugins)

Copy link
Contributor Author

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

@profanis profanis requested a review from arturovt April 16, 2025 20:04
@profanis profanis force-pushed the fp/migrate-execution-strategy branch 2 times, most recently from 66b8847 to e16bd36 Compare April 16, 2025 20:07
@profanis profanis force-pushed the fp/migrate-execution-strategy branch from e16bd36 to 10eb7fb Compare April 18, 2025 10:23
@qlty-cloud-legacy
Copy link

Code Climate has analyzed commit 10eb7fb and detected 11 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 1
Duplication 10

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.

@arturovt arturovt merged commit 2b2355c into master May 1, 2025
9 of 10 checks passed
@arturovt arturovt deleted the fp/migrate-execution-strategy branch May 1, 2025 14:43
arturovt added a commit that referenced this pull request May 9, 2025
arturovt added a commit that referenced this pull request May 9, 2025
* Revert "chore: migrate executionStrategy (#2317)"

This reverts commit 2b2355c.

* Revert "refactor(store): inline `NGXS_EXECUTION_STRATEGY` factory"

This reverts commit 5bb8fb6.

* Revert "refactor(store): make execution stategies tree-shakable (#2316)"

This reverts commit 81c7a7c.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants