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

fix(schematics): add comma before devtools for empty imports #2542

Merged
merged 1 commit into from
Jun 11, 2020

Conversation

timdeschryver
Copy link
Member

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

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

What is the current behavior?

@LayZeeDK encountered this issue while using the schematics to scaffold a new project.
There's an missing , between the the StoreModule and StoreDevToolsModule.

@NgModule({
  imports: [
  StoreModule.forRoot(reducers, {
      metaReducers, 
      runtimeChecks: {
        strictStateImmutability: true,
        strictActionImmutability: true,
      },
    })!environment.production ? StoreDevtoolsModule.instrument() : []]
})
export class SharedDataAccessModule {}

What is the new behavior?

@NgModule({
  imports: [
  StoreModule.forRoot(reducers, { metaReducers }),
   !environment.production ? StoreDevtoolsModule.instrument() : []]
})
export class SharedDataAccessModule {}

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

While I was in the file, I also noticed the runtime checks.
These could also be removed because they're enabled by default.

@@ -63,25 +64,14 @@ function addImportToNgModule(options: StoreOptions): Rule {
`${options.path}/environments/environment`
);

const runtimeChecks = `
Copy link
Member Author

Choose a reason for hiding this comment

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

I also removed the runtime checks as these are enabled now.

@ngrxbot
Copy link
Collaborator

ngrxbot commented May 28, 2020

Preview docs changes for a385a78 at https://previews.ngrx.io/pr2542-a385a786/

@brandonroberts
Copy link
Member

@timdeschryver if you'll rebase on master for the latest CI changes, we can go ahead and land it.

@timdeschryver
Copy link
Member Author

@brandonroberts done!

@brandonroberts brandonroberts merged commit f2d4ebc into master Jun 11, 2020
@brandonroberts brandonroberts deleted the pr/store-schematics-imports branch June 11, 2020 21:39
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.

4 participants