Skip to content
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

refactor(store-devtools): resolve import cycle to improve tool compatibility #4662

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

raphinesse
Copy link

@raphinesse raphinesse commented Jan 7, 2025

This change resolves the cyclical import dependency store-devtools/src/{provide-store-devtools <-> instrument}.ts by moving createStateObservable to provide-store-devtools.ts, its only user.

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[x] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

The import cycle breaks TS language tools/environments (e.g. Google's TS build) that don't support cyclical imports.

What is the new behavior?

Support TS language tools/environments that don't support cyclical imports.

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

This change resolves the cyclical import dependency
`store-devtools/src/{provide-store-devtools <-> instrument}.ts` by
moving `createStateObservable` to `provide-store-devtools.ts`, its only
user.
Copy link

netlify bot commented Jan 7, 2025

Deploy Preview for ngrx-io canceled.

Built without sensitive environment variables

Name Link
🔨 Latest commit c8181fb
🔍 Latest deploy log https://app.netlify.com/sites/ngrx-io/deploys/677d6b07f46dd3000850b08c

@raphinesse raphinesse changed the title Resolve import cycle to improve tool compatibility refactor(store-devtools): resolve import cycle to improve tool compatibility Jan 7, 2025
@raphinesse raphinesse marked this pull request as ready for review January 7, 2025 18:07
import { StoreDevtools } from './devtools';

export function createStateObservable(
Copy link
Author

@raphinesse raphinesse Jan 8, 2025

Choose a reason for hiding this comment

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

Arguably the export here is not required anymore. WDYT?

Suggested change
export function createStateObservable(
function createStateObservable(

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.

1 participant