Angular support for Nx Project Crystal #21994
Replies: 3 comments 11 replies
-
Project Angular CrystalThese are my ideas for Angular support in Nx, following the Nx Project Crystal guiding principles. ObjectivesKeep
|
Beta Was this translation helpful? Give feedback.
-
Hey @LayZeeDK, thanks for getting the discussion going. Here are a few thoughts from our end.
|
Beta Was this translation helpful? Give feedback.
-
@LayZeeDK thanks for kicking this off, and everyone else for the feedback provided! I want to provide an update on our plan regarding an Angular Crystal plugin. This has been put together after checking the feedback here, collecting some more feedback at NgConf, and discussing things internally, taking into account some upcoming work to improve onboarding external repositories into an existing Nx workspace. TL;DR
The above is what we plan to implement soon. It would allow using the Angular CLI tooling and configuration while benefiting from the Nx core functionalities. For now, it leaves out of scope making any changes to the current generators and executors to support the Extending the support for Main FeedbackFirst, a summary of the main feedback points:
Overall, there's a strong sentiment about continuing to use There's also a sentiment that it could be useful in some cases to infer tasks from Angular Crystal PluginOne of the main objectives of Project Crystal is to ease onboarding. The main idea is to rely on the configuration files of third-party tools to infer the tasks to run for any given project. This reduces the Nx-specific configuration and leads to an easier adoption of Nx. Angular it's a bit special. The Nx configuration and the Angular CLI configuration are pretty similar. This means that using the Nx configuration style for Angular is not too far off the Angular CLI configuration, and users learn it pretty quickly. The main differences are small and easy to learn. Our automated conversion ( The following are some pros and cons when it comes to supporting Pros:
Cons:
Having said that, while supporting
|
Beta Was this translation helpful? Give feedback.
-
This thread is a brainstorm for how Angular support could be integrated in the age of Nx Project Crystal. Feel free to contribute your ideas and feedback.
Nx 18 introduces Project Crystal but doesn't change Angular support to be Crystalized. Instead, this is left for a future Nx version and work hasn't begun at the time of writing as far as I'm aware, making this a great time to collect feedback from the Nx and Angular communities.
Project Crystal guiding principles
The guiding principles of Nx Project Crystal are:
Based on these principles, we notice that integrating Nx in a repo should be unobtrusive.
Nx <=18.0 Angular support
In early versions, Nx supported
angular.json
as-is. In later versions, Nx supported bothangular.json
andworkspace.json
with a similar JSON schema. A major change was the introduction of standaloneproject.json
configurations with metadata for each project instead of a workspace-wideangular.json
orworkspace.json
configuration. Migrating from an Angular CLI workspace to an Nx workspace became a major and potentially breaking change. However, this change reduced the merge conflict pains of having a large workspace-wide configuration that changes as more projects are added, Nx tasks are changed, and Nx migrations are run.Nx Console support for Angular CLI workspaces
For a while, Nx Console supported various features for Angular CLI workspaces with
angular.json
and no Nx metadata. Later, Nx Console removed Angular CLI workspace support, making Nx migration mandatory. It would be great to add Angular CLI workspace support to Nx Console again.Beta Was this translation helpful? Give feedback.
All reactions