Nx: can we make ngrx optional?

Created on 7 Jun 2018  路  6Comments  路  Source: nrwl/nx

Some users may usengxs for state management. wonder if we can make ngrx optional via create-nx-workspace command.

create-nx-workspace srika --prefix=ngx --style=scss --routing  --service-worker
cd srika
ng update @angular/core

We also see version out of sync errors

Package "@ngrx/store" has an incompatible peer dependency to "rxjs" (requires "^5.5.0", would install "6.2.0").
Incompatible peer dependencies found. See above.
feature

Most helpful comment

If possible it would be awesome to have NGXS as a supported state management library 馃槃

All 6 comments

If possible it would be awesome to have NGXS as a supported state management library 馃槃

We are considering it.

This is a workaround for now:

  1. Remove the NxModule.forRoot call from app.module.ts.
  2. Remove ngrx from package.json
  3. Obviously do not call ng g ngrx :)

Everytime I update it brings itself back and installs ngrx + all dependencies again. Can't seem to kill the beast

We are considering it.

This is a workaround for now:

  1. Remove the NxModule.forRoot call from app.module.ts.
  2. Remove ngrx from package.json
  3. Obviously do not call ng g ngrx :)

@vsavkin are there any news about supporting ngxs ? :)

Sorry for the late reply.

Ngrx is optional now. We add the dependencies only when you invoke the ngrx schematic.

@dtomaszewski we aren't planning to add ngxs schematic at the moment, but you can create your own schematic (can be a package, can be a workspace schematic).

@vsavkin from which version it is available ? Is it neccassary to upgrade to nx8?

Was this page helpful?
0 / 5 - 0 ratings