Nrwl Extensions for Angular (Nx)
What is Nx?
Nx is an extension for the the Angular CLI implementing the monorepo-style development. It is also a collection of runtime libraries, linters, and code generators helping large teams build better with Angular.
Features
Because Nx is built on top of the Angular CLI, you get all the conventional and loved features plus:
- Nx Workspace
- Workspace-Specific Schematics
- Intelligent Builds and Unit Testing
- State Management
- NgRx
- Data Persistence
- Linters
- Code Formatter
- UpgradeModule and downgradeModule helpers
- Jest unit tests integration
- Node build tooling
Why Nx?
On the surface, large and small organizations care about the same things: consistency, writing robust, maintainable code, making changes with confidence, being able to understand how the system works.
What’s different about large organizations is that they have hundreds of Angular engineers building dozens of apps. So they have a lot of code, which changes everything.
- While ten (10) developers can reach a consensus on best practices by chatting over lunch, five hundred (500) developers cannot. You have to establish best practices, team standards, and use tools to promote them.
- With three (3) projects developers will know what needs to be retested after making a change, with thirty (30) projects, however, this is no longer a simple process. Informal team rules to manage change will no longer work with large teams and multi-team, multi-project efforts. You have to rely on the automated CI process instead. …
In other words, small organizations can often get by with informal ad-hoc processes, whereas large organizations cannot. Large organizations must rely on tooling to enable that. Nx is this tooling.
Getting Started
An Nx workspace is an Angular CLI project that has been enhanced to be enterprise ready. Being an Angular CLI project means it will be handy to have the Angular CLI installed globally, which can be done via npm or yarn as well.
npm install -g @angular/cli
Note: If you do not have the Angular CLI installed globally you may not be able to use ng from the terminal to run CLI commands within the project. But the package.json file comes with npm scripts to run ng commands, so you can run npm start to ng serve and you can run npm run ng to run any of the ng commands.
After you have installed the Angular CLI, install @nrwl/schematics
.
npm install -g @nrwl/schematics
After installing it you can create a new Nx workspace by running:
create-nx-workspace myworkspacename
You can also add Nx capabilities to an existing CLI project by running:
ng add @nrwl/schematics
You are good to go!
Quick Start & Documentation
Documentation
Videos
Talks
- Angular at Large Organizations
- Nx: The New Way to Build Enterprise Angular Apps
- Supercharging the Angular CLI
- Hands on Full Stack development with Nx and Bazel
Podcasts and Shows
Misc
- nx-examples repo has branches for different nx comments to display expected behavior and example app and libraries. Check out the branch (workspace, ngrx...) to see what gets created for you. More info on readme.
- xplat - Cross-platform tools for Nx workspaces
Want to help?
If you want to file a bug or submit a PR, read up on our guidelines for contributing.
Core Team
Victor Savkin | Jason Jean | Benjamin Cabanes |
---|---|---|
vsavkin | FrozenPandaz | bcabanes |