[Feature] Extract Angular Schematics Support into a Dedicated Package Other Than @nx/angular
#22936
Char2sGu
started this conversation in
Feature Requests
Replies: 1 comment
-
Thanks for sharing your perspective. I'll discuss this with the team, as we want to provide a good experience for folks coming from Angular CLI.… |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently, Nx's support for Angular Schematics is kind of wierd. Nx itself has only partial support for Angular Schematics, which has led to confusing behaviors as described in #22625.
I was told that the Nx team is planning to completely extract the support for Angular Schematics from the Nx core into a new package. Angular Schematics will be supported only when the new package is present in
node_modules
, and Nx will use the new package to execute Angular Schematics.Currently, the "new package" is
@nx/angular
, and I believe it is inappropriate:@nx/angular
generators.@nx/angular
, they will likely not need Angular Schematics support.@nx/angular
provides generators that use the same aliases as Angular Schematics, forcing the developer to specify the collection of a generator such asnx g @schematics/angular:c
instead ofnx g c
, even if the developer only needs the generators from one collection (Angular Schematics or@nx/angular
plugins).@nx/angular
is an Nx plugin, which should be responsible for only providing generators and executors. Support for Angular Schematics is not something a plugin should do.Therefore, I propose that the support for Angular Schematics should be extracted into a package that is dedicated to provide the support. The package could be
@nx/schematics
.When migrating from Angular CLI, Nx should install only the
@nx/schematics
package (please do not install@nx/angular
), and continue to use Angular Schematics.My personal experience of migrating from Angular CLI to Nx has been somewhat disappointing:
@nx/angular
generators.@nx/angular
generators are too opinionated and changes too much of my workspace configs and settings, destroying my own patterns for managing my workspace.@nx/angular
plugin and specify the collect namenx g @schematics/angular:c
instead ofnx g c
, as mentioned above.If one wants to migrate from Angular CLI to Nx, the workspace can be scaled, and they would likely have their own pattern for managing the workspace. Nx should introduce minimal changes to allow the progressive transition to the Nx ecosystem.
Alternatively, explicitly ask whether to use
@nx/angular
or keep using schematics when migrating from Angular CLI.Beta Was this translation helpful? Give feedback.
All reactions