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: consistent naming of injection tokens #2737

Merged

Conversation

markostanimirovic
Copy link
Member

@markostanimirovic markostanimirovic commented Oct 13, 2020

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?

Name/description of injection tokens is inconsistent.

@ngrx/component-store

export const initialStateToken = new InjectionToken('ComponentStore InitState');

@ngrx/data

export const ENTITY_EFFECTS_SCHEDULER = new InjectionToken<SchedulerLike>(
  'EntityEffects Scheduler'
);

export const ENTITY_METADATA_TOKEN = new InjectionToken<EntityMetadataMap>(
  '@ngrx/data/entity-metadata'
);

@ngrx/effects

export const EFFECTS_ERROR_HANDLER = new InjectionToken<EffectsErrorHandler>(
  'ngrx/effects: Effects Error Handler'
);

etc.

What is the new behavior?

Name/description of injection tokens is consistent.

Format: @ngrx/module-name Title Cased Description

Does this PR introduce a breaking change?

[x] Yes
[ ] No

Other information

@ngrxbot
Copy link
Collaborator

ngrxbot commented Oct 13, 2020

Preview docs changes for f4a6353 at https://previews.ngrx.io/pr2737-f4a6353c/

Copy link
Member

@alex-okrushko alex-okrushko left a comment

Choose a reason for hiding this comment

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

Thanks 👍

@alex-okrushko
Copy link
Member

@brandonroberts
I see the failure of

> ng run data:test 
Nx could not find process's output. Run the command without --parallel.

I restarted the workflow, hope it will fix it.

@alex-okrushko alex-okrushko added the hacktoberfest-accepted PR qualifies for Hacktoberfest label Oct 21, 2020
@@ -32,7 +32,9 @@ export interface SelectConfig {
debounce?: boolean;
}

export const initialStateToken = new InjectionToken('ComponentStore InitState');
export const INITIAL_STATE_TOKEN = new InjectionToken(
Copy link
Member

@timdeschryver timdeschryver Oct 21, 2020

Choose a reason for hiding this comment

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

I forgot this PR.
I was thinking if this could be seen as a breaking change 🤔

Copy link
Member

Choose a reason for hiding this comment

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

That token is part of the public API, so I would say yes

Copy link
Member

Choose a reason for hiding this comment

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

I'll tag it for v11 :)

Copy link
Member

Choose a reason for hiding this comment

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

ComponentStore's token was not supposed to be exposed 😐 It's necessary for ViewEngine backwards-compatibility.
I'm fine with leaving it for v11, at the same time I'm suspecting that our next release would be v11 🙂

@brandonroberts brandonroberts merged commit e02d0d4 into ngrx:master Oct 30, 2020
alex-okrushko pushed a commit that referenced this pull request Nov 3, 2020
…2737)

BREAKING CHANGE:

The initial state Injection Token for `@ngrx/component-store` has been renamed

BEFORE:

Injection Token is `initialStateToken`

AFTER:

Injection Token is `INITIAL_STATE_TOKEN`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
11.x hacktoberfest-accepted PR qualifies for Hacktoberfest
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants