<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Victor Savkin</title>
    <description>The latest articles on Forem by Victor Savkin (@vsavkin).</description>
    <link>https://forem.com/vsavkin</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F245755%2F04c95b89-fae3-43a4-8e63-4556edb1c8ea.jpg</url>
      <title>Forem: Victor Savkin</title>
      <link>https://forem.com/vsavkin</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/vsavkin"/>
    <language>en</language>
    <item>
      <title>Lerna/Yarn -&gt; Nx: Faster Build Times + Better Dev Ergonomics</title>
      <dc:creator>Victor Savkin</dc:creator>
      <pubDate>Tue, 13 Jul 2021 14:53:17 +0000</pubDate>
      <link>https://forem.com/nx/lerna-yarn-nx-faster-build-times-better-dev-ergonomics-32a6</link>
      <guid>https://forem.com/nx/lerna-yarn-nx-faster-build-times-better-dev-ergonomics-32a6</guid>
      <description>&lt;p&gt;In this video I'll compare monorepo tools such as Lerna/Yarn workspaces/PNPM workspaces with Nx. The video walks you through the steps of adding Nx to a Lerna repo and showing many affordances Nx offers. Although the video uses Lerna, everything said applies to Yarn or PNPM. Basically, any time I say "Lerna" you can substitute it for Yarn or PNPM.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/BO1rwynFBLM"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Clarifying Misconceptions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Misconception: You have to choose between Nx and Lerna.
&lt;/h3&gt;

&lt;p&gt;Lerna, Yarn workspaces, pnpm workspaces offer the following affordances for developing multiple projects in the same repo:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Deduping node_modules. If I use the same version of say Next.js in all the projects, the package is installed once.&lt;/li&gt;
&lt;li&gt;Task orchestration. If I want to test all the projects, I can use a single command to do it.&lt;/li&gt;
&lt;li&gt;Publishing (Lerna only). I can run one command to publish packages to NPM.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is what Nx offers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Smart rebuilds of affected projects&lt;/li&gt;
&lt;li&gt;Distributed task execution &amp;amp; computation caching&lt;/li&gt;
&lt;li&gt;Code sharing and ownership management&lt;/li&gt;
&lt;li&gt;High-quality editor plugins &amp;amp; GitHub apps&lt;/li&gt;
&lt;li&gt;Powerful code generators&lt;/li&gt;
&lt;li&gt;Workspace visualizations&lt;/li&gt;
&lt;li&gt;Rich plugin ecosystem&lt;/li&gt;
&lt;li&gt;Consistent dev experience for any framework&lt;/li&gt;
&lt;li&gt;Automatic upgrade to latest versions of all frameworks and tools&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As you can see, there is basically no overlap. Nx isn't a package manager (it's not a JS-only tool), so deduping &lt;code&gt;node_modules&lt;/code&gt; isn't in that list. Nx doesn't care whether your repo has multiple node_modules folders or not, and whether you choose to dedup them or not. If you want to use Lerna to dedup &lt;code&gt;node_modules&lt;/code&gt; in your Nx workspace, you can do it. Many companies do.&lt;/p&gt;

&lt;p&gt;What often happens though is when folks adopt Nx, they have better affordances for implementing a single-version policy (why this is a good idea is beyond the scope of this post, but you can read more about why Google does here). But it's important to stress that this isn't required by Nx. It's simply something that Nx can enable you to do at scale.&lt;/p&gt;

&lt;h3&gt;
  
  
  Misconception: Nx is for apps, Lerna is for libs.
&lt;/h3&gt;

&lt;p&gt;Although it's true to say that the Nx core doesn't care whether you publish your packages or not, there are Nx plugins (e.g., &lt;code&gt;@nrwl/node&lt;/code&gt;) that help you bundle and package your modules.&lt;/p&gt;

&lt;p&gt;For instance, the Nx repo itself is built with Nx. It has 2 applications and a few dozen libraries. Those libraries are published to NPM. Many larger organizations using Nx publish a subset of their libraries to their registry.&lt;/p&gt;

&lt;h3&gt;
  
  
  Misconception: Nx is configuration over convention
&lt;/h3&gt;

&lt;p&gt;As you saw in the video, the amount of the generated configuration is small. The &lt;code&gt;add-nx-to-monorepo&lt;/code&gt; script generates the following per project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"header": { "type": "library", "root": "packages/header" }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is it. If you have 200 projects in your workspace, you will see 200 lines specifying projects' roots. Practically everything else you see is optional. You can choose to configure your executors instead of using npm scripts, or configure generator defaults, and so forth. When you configure the @nrwl/web:dev-server executor, though, you aren't just adding a chunk of json config into workspace.json, you are also removing the configuration files you used to implement the same functionality (start scripts, Webpack config files etc.) So the total amount of configuration is decreasing, and, often, by a lot.&lt;/p&gt;

&lt;p&gt;We came from Google, so we take the toolability very seriously. Nx plugins provide metadata to be understood by the Nx CLI and editors. The configuration of your workspace is also statically analyzable (in opposite to say the Webpack config files). In addition to enabling good VSCode and WebStorm support, it allows us to update your configuration automatically as you upgrade your version of Nx. Other than the toolability aspect we try to keep the config as short as possible and rely on conventions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Summary
&lt;/h3&gt;

&lt;p&gt;Nx has more in common with the build tools used at Google or Facebook (just made a lot more easily accessible for other companies) than with Lerna. When using the word "monorepo" in the context of say Google, we imagine a much richer dev experience, not simply collocating a few projects side by side (read more here). Lerna/Yarn/PNPM are package managers. When it comes to monorepos, they mainly perform node_modules deduping. So the choice isn't between Nx or Lerna. It's between whether you want to have multiple node_modules folders (in this case use Nx with Lerna) or not (use Nx without Lerna).&lt;/p&gt;




&lt;h2&gt;
  
  
  canonical_url: &lt;a href="https://blog.nrwl.io/lerna-yarn-nx-faster-build-times-better-dev-ergonomics-2ec28463d3a5"&gt;https://blog.nrwl.io/lerna-yarn-nx-faster-build-times-better-dev-ergonomics-2ec28463d3a5&lt;/a&gt;
&lt;/h2&gt;

</description>
      <category>react</category>
      <category>node</category>
      <category>monorepos</category>
      <category>nx</category>
    </item>
    <item>
      <title>Smart, Extensible Build Framework Explained in 12 Solarized-Themed Diagrams</title>
      <dc:creator>Victor Savkin</dc:creator>
      <pubDate>Thu, 20 May 2021 14:04:42 +0000</pubDate>
      <link>https://forem.com/nx/smart-extensible-build-framework-explained-in-12-solarized-themed-diagrams-144m</link>
      <guid>https://forem.com/nx/smart-extensible-build-framework-explained-in-12-solarized-themed-diagrams-144m</guid>
      <description>&lt;p&gt;Nx is a smart, extensible, toolable, and easy-to-use build framework. In this post, I'll show you how it works using 12 diagrams.&lt;/p&gt;

&lt;h2&gt;
  
  
  Plugins &amp;amp; Code Generation
&lt;/h2&gt;

&lt;p&gt;Let's create a new Nx workspace.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; npx create-nx-workspace &lt;span class="nt"&gt;--preset&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;empty
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This creates the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apps/
libs/
tools/
workspace.json
nx.json
tsconfig.base.json
package.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Nx is a VSCode of build tools: it has a powerful core that you can build plugins for. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyvff81ethgwsthfgp7rv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyvff81ethgwsthfgp7rv.png" alt="Nx Plugins"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's run &lt;code&gt;nx list&lt;/code&gt; to see the list of available plugins:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;  NX  Also available:

  @nrwl/cypress &lt;span class="o"&gt;(&lt;/span&gt;builders,generators&lt;span class="o"&gt;)&lt;/span&gt;
  @nrwl/jest &lt;span class="o"&gt;(&lt;/span&gt;builders,generators&lt;span class="o"&gt;)&lt;/span&gt;
  @nrwl/linter &lt;span class="o"&gt;(&lt;/span&gt;builders&lt;span class="o"&gt;)&lt;/span&gt;
  @nrwl/node &lt;span class="o"&gt;(&lt;/span&gt;builders,generators&lt;span class="o"&gt;)&lt;/span&gt;
  @nrwl/workspace &lt;span class="o"&gt;(&lt;/span&gt;builders,generators&lt;span class="o"&gt;)&lt;/span&gt;
  @nrwl/express &lt;span class="o"&gt;(&lt;/span&gt;executors,generators&lt;span class="o"&gt;)&lt;/span&gt;
  @nrwl/next &lt;span class="o"&gt;(&lt;/span&gt;executors,generators&lt;span class="o"&gt;)&lt;/span&gt;
  @nrwl/react &lt;span class="o"&gt;(&lt;/span&gt;executors,generators&lt;span class="o"&gt;)&lt;/span&gt;
  @nrwl/storybook &lt;span class="o"&gt;(&lt;/span&gt;executors,generators&lt;span class="o"&gt;)&lt;/span&gt;
  @nrwl/web &lt;span class="o"&gt;(&lt;/span&gt;executors,generators&lt;span class="o"&gt;)&lt;/span&gt;
  ...


&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;  NX  Community plugins:

  nx-electron - An Nx plugin &lt;span class="k"&gt;for &lt;/span&gt;developing Electron applications
  nx-stylelint - Nx plugin to use stylelint &lt;span class="k"&gt;in &lt;/span&gt;a nx workspace
  @nxtend/ionic-react - An Nx plugin &lt;span class="k"&gt;for &lt;/span&gt;developing Ionic React applications and libraries
  @nxtend/ionic-angular - An Nx plugin &lt;span class="k"&gt;for &lt;/span&gt;developing Ionic Angular applications and libraries
  @nxtend/capacitor - An Nx plugin &lt;span class="k"&gt;for &lt;/span&gt;developing cross-platform applications using Capacitor
  @nxtend/firebase - An Nx plugin &lt;span class="k"&gt;for &lt;/span&gt;developing applications using Firebase
  ...

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's add Next.js plugin, which will also add the React, Jest, and Cypress plugins.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; yarn add @nrwl/next
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's use the Next.js and React generators to create new projects (applications and libraries) in the workspace.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Nx uses a virtual file system to run its generator, so you can compose them, run them in the dry-run mode etc.&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; nx g @nrwl/next:app app1
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; nx g @nrwl/react:app app2
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; nx g @nrwl/react:lib lib
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Everything is Metadata-Driven
&lt;/h2&gt;

&lt;p&gt;Everything in Nx comes with metadata to enable toolability. For instance, you can run the generator from within VSCode. Default values, validations, autocompletion will work.&lt;/p&gt;

&lt;p&gt;Even though I won't show it in this post. It's important to note that this works for any plugin, and also works for any other command. This metadata is used by Nx itself, by VSCode and WebStorm integrations, by GitHub integration, and by third-party tools implementing richer experiences with Nx.&lt;/p&gt;

&lt;h2&gt;
  
  
  Project Graph
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffp9r5tis593xukkyg6k3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffp9r5tis593xukkyg6k3.png" alt="Project Graph"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is a project graph. It reflects the source code in the repo and all the external dependencies that aren't authored in the repo (e.g., webpack, react).&lt;/p&gt;

&lt;p&gt;Nodes in the project graph are defined in &lt;code&gt;workspace.json&lt;/code&gt;. You can manually define dependencies between the nodes, but you don't have to do it very often. Instead, Nx will analyze the source code (e.g., package.json, ts files, etc) and figure out dependencies for you. Will see this in action below. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Starting with Nx 12.1, this functionality is pluggable, so Nx can analyze other source files (e.g., Go, Kotlin).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhaihiyvbznud76sd7wez.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhaihiyvbznud76sd7wez.png" alt="Showing Incremental Graph Recomputation"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We put a lot of work into making this process very fast, but even then it can take a few seconds for a large repo. That's why Nx stores the cached project graph, so it only reanalyzes the files you have changed. &lt;/p&gt;

&lt;p&gt;Why not simply use package.json, like Lerna?&lt;/p&gt;

&lt;p&gt;Similar to Lerna, Nx analyzes package.json files, but doing that alone is insufficient for many projects. For instance, Nx allows you to have lightweight nodes with less config, it works across languages and platforms, and supports scenarios where dependencies are implicit (e.g., e2e tests depending on the app).&lt;/p&gt;

&lt;p&gt;Let's add this import to both apps:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@happyorg/mylib&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This changes the project graph to:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fycjxk5vn2lqrpusnmkwj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fycjxk5vn2lqrpusnmkwj.png" alt="Updated Project Graph"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Task Graph
&lt;/h2&gt;

&lt;p&gt;Any time you run anything, Nx will create a task graph from the project graph, and then will execute the tasks in that graph.&lt;/p&gt;

&lt;p&gt;For instance &lt;code&gt;&amp;gt; nx test lib&lt;/code&gt; will create a task graph with a single node:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F237qpkg5qg2ozigvsfpa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F237qpkg5qg2ozigvsfpa.png" alt="Task Graph with a single node"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Projects/Targets/Tasks/Executors
&lt;/h2&gt;

&lt;p&gt;Projects are the source code in the repo. A target is something that you can do with a project (e.g., build/serve/test). Every project can have many targets.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
      "root": "apps/app1",
      "sourceRoot": "apps/app1",
      "projectType": "application",
      "targets": {
        "build": {
          "executor": "@nrwl/next:build",
          "outputs": ["{options.outputPath}"],
          "options": {
            "root": "apps/app1",
            "outputPath": "dist/apps/app1"
          }
        },
        "serve": {
          "executor": "@nrwl/next:server",
          "options": {
            "buildTarget": "app1:build",
            "dev": true
          }
        },
        "export": {
          "executor": "@nrwl/next:export",
          "options": {
            "buildTarget": "app1:build:production"
          }
        },
        "test": {
          "executor": "@nrwl/jest:jest",
          "outputs": ["coverage/apps/app1"],
          "options": {
            "jestConfig": "apps/app1/jest.config.js",
            "passWithNoTests": true
          }
        }
      }
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;To make adding Nx to an existing repo easier, if you don’t define any targets in workspace.json, Nx will treat npm scripts you have defined as targets.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;An executor is a function (with some metadata) that tells Nx what to do when you run say &lt;code&gt;nx test lib&lt;/code&gt;. The metadata piece is crucial. This is what tells Nx how to validate params and set defaults, what to cache etc.&lt;/p&gt;

&lt;p&gt;Task is an invocation of target. If you invoke the same target twice, you will create two tasks.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating a Task Graph
&lt;/h2&gt;

&lt;p&gt;Nx uses the project graph (information about how projects relate to each other), but the two graphs aren't directly connected (e.g., they are not isomorphic). In the case above, &lt;code&gt;app1&lt;/code&gt; and &lt;code&gt;app2&lt;/code&gt; depend on &lt;code&gt;lib&lt;/code&gt;, but if you run &lt;code&gt;nx run-many --target=test --projects=app1,app2,lib&lt;/code&gt;, the created task graph will look like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Froqbfppbymbxq46g2vb3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Froqbfppbymbxq46g2vb3.png" alt="Task graph with 3 tasks running in parallel"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Even though the apps depend on &lt;code&gt;lib&lt;/code&gt;, testing &lt;code&gt;app1&lt;/code&gt; doesn't depend on testing &lt;code&gt;lib&lt;/code&gt;. This means that the two tasks can run in parallel.&lt;/p&gt;

&lt;p&gt;Let's change this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"dependsOn"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"target"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"test"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"projects"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"dependencies"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With this, running the same test command will create the following task graph:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftxut3z9htf1xzg93i4nz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftxut3z9htf1xzg93i4nz.png" alt="Task graph with 2 apps depending on the lib"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This doesn't make much sense for tests, but it often makes sense for builds, where to build &lt;code&gt;app1&lt;/code&gt;, you want to build &lt;code&gt;lib&lt;/code&gt; first. You can also define similar relationships between targets of the same project (e.g., test depends on build).&lt;/p&gt;

&lt;p&gt;It's important to stress that a task graph can contain different targets (e.g., builds and test), and those can run in parallel. For instance, as Nx is building &lt;code&gt;app2&lt;/code&gt;, it can be testing &lt;code&gt;app1&lt;/code&gt; at the same time.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0jy6amii4glek04tzefi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0jy6amii4glek04tzefi.png" alt="Command Execution"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Affected
&lt;/h2&gt;

&lt;p&gt;When you run &lt;code&gt;nx test app1&lt;/code&gt;, you are telling Nx to run the &lt;code&gt;app1:test&lt;/code&gt; task plus all the tasks it depends on.&lt;/p&gt;

&lt;p&gt;When you run &lt;code&gt;nx run-many --target=test --projects=app1,lib&lt;/code&gt;, you are telling Nx to do the same for two tasks &lt;code&gt;app1:test&lt;/code&gt; and &lt;code&gt;lib:test&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;When you run &lt;code&gt;nx run-many --target=test --all&lt;/code&gt;, you are telling Nx to do this for all the projects.&lt;/p&gt;

&lt;p&gt;As your workspace grows, retesting all projects becomes too slow. To address this Nx implements code change analysis (i.e., it analyzes your PRs) to get the min set of projects that need to be retested. How does it work? &lt;/p&gt;

&lt;p&gt;When you run &lt;code&gt;nx affected --target=test&lt;/code&gt;, Nx will look at the files you changed in your PR, it will look at the nature of change (what exactly did you update in those files), and it will use this to figure the list of projects in the workspace that can be affected by this change. It will then run the &lt;code&gt;run-many&lt;/code&gt; command with that list.&lt;/p&gt;

&lt;p&gt;For instance, if my PR changes &lt;code&gt;lib&lt;/code&gt;, and I then run &lt;code&gt;nx affected --target=test&lt;/code&gt;, Nx will figure out that &lt;code&gt;app1&lt;/code&gt; and &lt;code&gt;app2&lt;/code&gt; depend on &lt;code&gt;lib&lt;/code&gt;, so it will invoke &lt;code&gt;nx run-many --target=test --projects=app1,app2,lib&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frc8fo5aypzklvwyfe946.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frc8fo5aypzklvwyfe946.png" alt="Affected"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Nx is able to analyze the nature of the change. E.g., if you change the version of Next.js in package.json, Nx will know that &lt;code&gt;app2&lt;/code&gt; cannot be affected by it, so it will only retest &lt;code&gt;app1&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Running Tasks
&lt;/h2&gt;

&lt;p&gt;Nx will run the tasks in the task graph in the right order. Before running the task, Nx will compute its computation hash. As long as the computation hash is the same, the output of running the task will be the same. &lt;/p&gt;

&lt;p&gt;How does Nx do it?&lt;/p&gt;

&lt;p&gt;By default, the computation hash for say &lt;code&gt;nx test app1&lt;/code&gt; will include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;all the source files of &lt;code&gt;app1&lt;/code&gt; and &lt;code&gt;lib&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;relevant global configuration&lt;/li&gt;
&lt;li&gt;versions of externals dependencies&lt;/li&gt;
&lt;li&gt;runtime values provisioned by the user (e.g., version of Node)&lt;/li&gt;
&lt;li&gt;command flags&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Favgd42m7mkeomv08nfva.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Favgd42m7mkeomv08nfva.png" alt="Hashing"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This behavior is customizable. For instance, lint checks may only depend on the source code of the project and global configs. Builds can depend on the dts files of the compiled libs instead of their source.&lt;/p&gt;

&lt;p&gt;Once Nx computes the hash for a task, it then checks if it ran this exact computation before. First it checks locally, and then if it is missing, and if a remote cache is configured, it checks remotely. &lt;/p&gt;

&lt;p&gt;If Nx finds the computation, Nx will retrieve it and replay it. Nx will place the right files in the right folders and will print the terminal output. So from the user's point of view the command ran the same, just a lot faster.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuwz2bulgk4s8kre8aoc7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuwz2bulgk4s8kre8aoc7.png" alt="Local cache and remote cache"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If Nx doesn't find this computation, Nx will run the task, and after it completes, it will take the outputs and the terminal output and will store it locally (and if configured remotely). All of this happens transparently, so you don't have to worry about it.&lt;/p&gt;

&lt;p&gt;Although conceptually this is fairly straightforward, we do a lot of clever things to make this experience good for the user. For instance:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We use an interesting technique of capturing stdout and stderr to make sure the replayed output looks exactly the same, including on Windows.&lt;/li&gt;
&lt;li&gt;We minimize the IO by remembering what files are replayed where. &lt;/li&gt;
&lt;li&gt;We only show relevant output when processing a large task graph.&lt;/li&gt;
&lt;li&gt;We provide affordances for troubleshooting cache misses.&lt;/li&gt;
&lt;li&gt;And many other things like that.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All of these are crucial for making Nx usable for any non-trivial workspace. For instance, if you run &lt;code&gt;nx build app1 --parallel&lt;/code&gt;, and it depends on say 1000 libs, Nx will create a task graph like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9vrxa9mngzgjf8xe6hrl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9vrxa9mngzgjf8xe6hrl.png" alt="Complex task graph"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It will then process the task graph from the leaves, running everything it can in parallel. If ParentLib depends on ChildLib1 and ChildLib2, it will build the child libs first. Before running every task it will check if it already has the needed files in the dist folder? Found them? Then don't do anything. No? Check local cache and, if needed, remote cache. Cache hit? Restore the files. Cache miss, run the command, capture stdout and cache it together the file outputs for future use. The min amount of work that has to happen will happen. The rest will be either left as is or restored from cache.&lt;/p&gt;

&lt;h2&gt;
  
  
  Distributed Task Execution
&lt;/h2&gt;

&lt;p&gt;Nx Cloud is a cloud companion for the Nx build framework. Many features of Nx Cloud are free, but some are paid. One of them is the distributed computation cache, which allows you to share cache with your team members and CI agents. If you pull the main branch in the morning, everything will be cache because the CI just did it.&lt;/p&gt;

&lt;p&gt;But an even more exciting feature Nx Cloud provides is config-free distributed task execution (DTE). When using the distributed task execution, Nx is able to run any task graph on a many agents instead of locally.&lt;/p&gt;

&lt;p&gt;When using this, &lt;code&gt;nx affected --build&lt;/code&gt;, won't run the build locally (which for large workspace can take hours). Instead, it will send the Task Graph to Nx Cloud. Nx Cloud Agents will then pick up the task they can run and execute them.&lt;/p&gt;

&lt;p&gt;Note this happens transparently. If an agent builds &lt;code&gt;app1&lt;/code&gt;, it will fetch the outputs for &lt;code&gt;lib&lt;/code&gt; if it doesn't have it already.&lt;/p&gt;

&lt;p&gt;As agents complete tasks, the main job where you invoked &lt;code&gt;nx affected --build&lt;/code&gt; will start receiving created files and terminal outputs.&lt;/p&gt;

&lt;p&gt;After &lt;code&gt;nx affected --build&lt;/code&gt; completes, the machine will have the build files and all the terminal outputs as if it ran it locally.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F45q5b9qy43wifei0suof.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F45q5b9qy43wifei0suof.png" alt="Distributed task execution"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Nx is a smart, extensible, toolable and easy to use build framework.&lt;/li&gt;
&lt;li&gt;You can install plugins that will bring executors, generators, and dep graph processors.&lt;/li&gt;
&lt;li&gt;Nx uses a virtual file system to enable powerful code generation and code augmentation workflows with previews and VSCode and WebStorm support.&lt;/li&gt;
&lt;li&gt;You can very easily create apps, components, libs etc.&lt;/li&gt;
&lt;li&gt;Everything in Nx is metadata-driven and toolable.&lt;/li&gt;
&lt;li&gt;Nx is able to analyze your source code to create a Project Graph.&lt;/li&gt;
&lt;li&gt;Nx can use the project graph and information about projects' targets to create a Task Graph. &lt;/li&gt;
&lt;li&gt;Nx is able to perform code-change analysis to create the smallest task graph for your PR.&lt;/li&gt;
&lt;li&gt;Nx supports computation caching to never execute the same computation twice. This computation cache is pluggable and is distributed.&lt;/li&gt;
&lt;li&gt;Nx supports distributed task execution where a single command can run on multiple agents with zero-config.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Learn More
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Check out &lt;a href="https://nx.dev" rel="noopener noreferrer"&gt;nx.dev&lt;/a&gt; to learn more about the Nx Build Framework.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>react</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Nx is Modern Angular</title>
      <dc:creator>Victor Savkin</dc:creator>
      <pubDate>Tue, 30 Mar 2021 13:43:23 +0000</pubDate>
      <link>https://forem.com/nx/nx-is-modern-angular-4af5</link>
      <guid>https://forem.com/nx/nx-is-modern-angular-4af5</guid>
      <description>&lt;p&gt;In order for the Angular community to thrive, it has to remain up-to-date with the broader JavaScript community. The Angular community has to consider what else is going on, and adopt the best tools and ideas.&lt;/p&gt;

&lt;p&gt;Regardless of how good the Angular core is, if developers have to use Karma, Protractor, and TSLint (no one’s first choices at this point), Angular will feel outdated.&lt;/p&gt;

&lt;p&gt;As I mentioned in my blog post&lt;a href="https://blog.nrwl.io/angular-is-an-onion-63f4cd1ece6"&gt; “Angular is an Onion”&lt;/a&gt; the team at Google is well-positioned to design core APIs and capabilities and is at a disadvantage compared to the Angular community when it comes to higher-level API and integrating tools into the CLI.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5Q1ckrk3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/0%2AkjkW17TPFrtkH8qZ" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5Q1ckrk3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/0%2AkjkW17TPFrtkH8qZ" alt=""&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Angular CLI Dropping Support For Legacy Tools
&lt;/h2&gt;

&lt;p&gt;The Angular team has made the decision to drop Angular CLI support for legacy tools and will no longer be shipping the Angular CLI with TSLint, &lt;a href="https://palantir.github.io/tslint/"&gt;which has been deprecated in 2019&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I strongly support the Angular team no longer shipping TSLint with Angular CLI. At this point, it’s better to have no linter built-in than to have TSLint. Having a deprecated tool as part of the CLI made Angular look outdated and not well maintained. It also made it harder for the community to provide a good alternative: removing the built-in linter and installing a better one is extra work most folks don’t want to do. &lt;strong&gt;It’s a right decision.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I think the Angular team should go further and remove or replace Protractor and Karma as well.&lt;/p&gt;




&lt;h2&gt;
  
  
  Modernizing Angular Development with Nx
&lt;/h2&gt;

&lt;p&gt;At Nrwl, we help companies build very large Angular applications, and seeing them struggle with Protractor or seeing them trying and failing to generate a file using the Schematics API is disheartening.&lt;/p&gt;

&lt;p&gt;As a former Angular core team member and NgRx core team member, I still feel a strong affinity with the Angular community. I want to see the folks enjoying the framework and the tools around it. I want to see the community excited.&lt;/p&gt;

&lt;p&gt;Nx was created to provide a better developer experience for the Angular community and developers in other communities who are trying to navigate increasingly large and complex development environments. As the Angular landscape has evolved, we have worked hard to ensure that Nx stays one step ahead.&lt;/p&gt;

&lt;h2&gt;
  
  
  Modern Tools
&lt;/h2&gt;

&lt;p&gt;Developers should use modern tools that help them work more effectively and efficiently. Among our clients and the broader Angular ecosystem, we’ve observed that there are some pretty clear front-runners when it comes to testing and linting tools. We’ve therefore built out-of-the-box support for those tools into Nx. They include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;&lt;a href="https://jestjs.io/"&gt;Jest&lt;/a&gt; &lt;em&gt;(replaces Karma)&lt;/em&gt;&lt;/strong&gt; Jest is a zero-config JavaScript testing framework that prioritizes simplicity. With robust documentation and a feature-rich API, Jest is a great solution for JS developers looking for a powerful, modern testing toolkit.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;&lt;a href="https://cypress.io/"&gt;Cypress&lt;/a&gt; &lt;em&gt;(replaces Protractor)&lt;/em&gt;&lt;/strong&gt; Cypress supplies fast, reliable E2E testing for anything that runs in the browser. Cypress includes time travel debugging, readable errors and stack traces, real-time reloads, and more.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;&lt;a href="https://eslint.org/"&gt;ESLint&lt;/a&gt; &lt;em&gt;(replaces TSLint)&lt;/em&gt;&lt;/strong&gt; ESLint uses static analysis to identify problems in your code, many of which are fixed automatically in a syntax-aware manner. ESLint is highly configurable; customize your linting to preprocess code, use custom parsers, or write your own rules.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;&lt;a href="https://storybook.js.org/"&gt;Storybook&lt;/a&gt;&lt;/strong&gt; Storybook is an open source tool for building UI components in isolation, making it an excellent platform for design systems that can be shared across an entire brand, including apps built with a variety of frameworks and libraries.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These tools were not selected simply because they’re new and popular; Jest/Cypress/ESLint are more stable and robust than Karma/Protractor/TSLint, and their popularity puts them in a good position for long-term growth and development. &lt;/p&gt;

&lt;p&gt;The Nx team has worked hard to ensure that the integration between Nx and these tools is seamless. For example, Nx can generate Cypress tests for your Storybook stories, etc.&lt;/p&gt;




&lt;h2&gt;
  
  
  Modern CLI
&lt;/h2&gt;

&lt;p&gt;In addition to using modern tools, developers want to work with a CLI that reflects how their needs and expectations have evolved.   &lt;/p&gt;

&lt;p&gt;Angular CLI is an impressive piece of technology. It has robust code-generation and execution capabilities that facilitate onboarding and developer mobility, but it has a few issues: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  In 2021, we aren’t comparing the Angular CLI with an ad-hoc folder with 5 npm scripts in it. Other frameworks offer code generation, editor integration, etc. The delta between the Angular CLI and other CLIs isn’t as big as it used to be.&lt;/li&gt;
&lt;li&gt;  The Angular CLI got many things right in principle (e.g. atomic code generation aka dry-run, ng update) but, in practice, the API were not very ergonomic and didn’t account for many real-world scenarios.&lt;/li&gt;
&lt;li&gt;  Several tools now are trying to offer computation caching and other ways of scaling. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;When using Nx, you can either let Nx decorate theAngular CLI to improve the developer experience or use the Nx CLI instead. All the points below will apply in the same way.&lt;/em&gt; &lt;/p&gt;

&lt;p&gt;Let’s look at a few examples.&lt;/p&gt;

&lt;h3&gt;
  
  
  Computation Caching &amp;amp; Scaling
&lt;/h3&gt;

&lt;p&gt;Computation caching is a great way to improve performance. With it, you never have to build or test the same code more than once.&lt;/p&gt;

&lt;p&gt;The Angular team attempted to integrate &lt;a href="https://bazel.build/"&gt;Bazel&lt;/a&gt; into the Angular CLI, but that effort has been canceled. Nx builds on inspiration from Bazel and similar tools, and implements computation caching in a way that &lt;strong&gt;works with any tool and requires &lt;em&gt;no configuration&lt;/em&gt;&lt;/strong&gt;. The result is much faster builds and continuous integration.&lt;/p&gt;

&lt;p&gt;These are the types of savings we are talking about:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5HsX2Hv3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/0%2AdUHVEPGNrhi2b-Tx" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5HsX2Hv3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/0%2AdUHVEPGNrhi2b-Tx" alt="A chart showing savings by using distributed computation cache"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This enables a lot of new ways of developing. For instance, if your “ng serve” takes a long time, you can make it faster by using incremental builds.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KqqzFPt9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/0%2AyUQIEY5BleBZXHMp" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KqqzFPt9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/0%2AyUQIEY5BleBZXHMp" alt="A chart showing ng serve improvements when using incremental builds"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Editor Support &amp;amp; GitHub Support
&lt;/h3&gt;

&lt;p&gt;Nx provides a modern, integrated dev experience. &lt;a href="https://nx.dev/latest/angular/getting-started/console"&gt;VS Code and WebStorm plugins&lt;/a&gt; help you use the build tool effectively, generate components in folders, and much more.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yWy3Bo9K--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/0%2Aiu2J6YxoHaODgoWM" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yWy3Bo9K--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/0%2Aiu2J6YxoHaODgoWM" alt="VSCode screenshot"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Nx also supports optional &lt;a href="https://nx.app/"&gt;free cloud support with Nx Cloud&lt;/a&gt;, as well as &lt;a href="https://github.com/apps/nx-cloud"&gt;GitHub integration&lt;/a&gt;. &lt;/p&gt;

&lt;h3&gt;
  
  
  Simpler APIs with Nx and Nx Devkit
&lt;/h3&gt;

&lt;p&gt;Regardless of how you use Nx (with Angular CLI or standalone), you can always use the Angular Devkit. You can generate code using schematics and invoke builders. But there is a alternative: you can use Nx Devkit.&lt;/p&gt;

&lt;p&gt;Nx Devkit &lt;strong&gt;uses only language features&lt;/strong&gt; (e.g., it doesn’t use observables unless you choose to use them yourself) and it doesn’t use any advanced patterns like partial application. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You can step through your code with a debugger. When an exception is thrown, the stack trace is short and every line points to your code.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The Nx Devkit API is small and is optimized for most common scenarios. See the comparison of the Nx and Agular devkits &lt;a href="https://nx.dev/latest/angular/guides/nx-devkit-angular-devkit#nx-devkit-and-angular-devkit"&gt;here&lt;/a&gt;&lt;strong&gt;. Also, Nx Devkit is &lt;a href="https://nx.dev/latest/angular/core-concepts/nx-devkit#nx-devkit"&gt;well documented&lt;/a&gt;.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;**Important: **Nx allows you to mix and match Nx Devkit and Angular Devkit seamlessly. Every Nx Generator can be used in an Angular Schematic and vice versa. The user invokes schematics and builders in the same way regardless of which devkit they are written in. &lt;/p&gt;

&lt;h3&gt;
  
  
  Staying Up to Date &amp;amp; Ng Update
&lt;/h3&gt;

&lt;p&gt;Ng Update is the best thing about the Angular CLI. It is a robust solution for one of the hardest problems in software engineering. But it has a few problems when upgrading larger workspaces: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  It often takes many days or even weeks to perform an upgrade, so doing upgrade in small pieces is necessary.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Some but not all&lt;/strong&gt; migrations have to be rerun after each rebase.&lt;/li&gt;
&lt;li&gt;  Migrations have to be reordered.&lt;/li&gt;
&lt;li&gt;  Migrations have to be patched in node_modules (or copied over and replaced).&lt;/li&gt;
&lt;li&gt;  Different versions of packages have to be used cause of org firewalls etc..&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Nx comes with its command that takes the best parts of ng update does but addresses all of the issues above.&lt;a href="https://nx.dev/latest/angular/core-concepts/updating-nx"&gt; See here on how it does it.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There is a second aspect of staying up to date: giving people a way to move forward to the new tech. &lt;/p&gt;

&lt;p&gt;Some of it is more natural in an Nx repo because of how Nx works. In contrast to a standard Angular CLI setup, folks using Nx split their applications into many packages, each of which can have its own testing tool, linter etc. So you could use say both Cypress and Protractor and slowly move to Cypress one package at a time.&lt;/p&gt;

&lt;p&gt;But we at Nrwl also try to do our best to automate this process when possible. For instance, Nx 11.6 has a generator that allows you to move from TSLint to ESLint. So if you have a large Nx workspace, you can move to ESLint in one go.&lt;/p&gt;




&lt;h2&gt;
  
  
  “Modern Angular” also means working together with other frameworks.
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--D4hOvO2V--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/0%2A6sGaTAiC-QiXa51K" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--D4hOvO2V--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/0%2A6sGaTAiC-QiXa51K" alt="Angular and React"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Most large companies use multiple frameworks to build their applications. One org can use Angular, another one can use React, and this is OK.&lt;/p&gt;

&lt;p&gt;Nx provides the same dev experience for many frameworks including Angular and React. You can build Angular apps, Next.js apps, share code between them. You can build portals out of Angular and React microfrontends. You can share org-specific code generators, lint checks, CI/CD setup.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Where your code lives and how it is divided should be based on your organizational structure, not on what frameworks you use.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Learn More
&lt;/h2&gt;

&lt;p&gt;Check out&lt;a href="https://nx.dev/modern-angular"&gt; Modern Angular on nx.dev&lt;/a&gt; and give it a try!&lt;/p&gt;

</description>
      <category>angular</category>
      <category>nx</category>
      <category>webdev</category>
      <category>web</category>
    </item>
    <item>
      <title>On Bazel Support</title>
      <dc:creator>Victor Savkin</dc:creator>
      <pubDate>Mon, 02 Nov 2020 13:53:53 +0000</pubDate>
      <link>https://forem.com/nx/on-bazel-support-5c6e</link>
      <guid>https://forem.com/nx/on-bazel-support-5c6e</guid>
      <description>&lt;p&gt;A year and a half ago we announced our second attempt to add a &lt;a href="https://blog.nrwl.io/nx-%EF%B8%8F-bazel-release-plans-eaed5bbaa3ba"&gt;Bazel backend to Nx&lt;/a&gt;. Unfortunately this is not going to happen in the near future. I'd like to provide some context about why we wanted to do it and why we decided that this isn't the time.&lt;/p&gt;

&lt;p&gt;We started the Bazel effort for the following two reasons.&lt;/p&gt;

&lt;h2&gt;
  
  
  Computation Caching
&lt;/h2&gt;

&lt;p&gt;We really wanted to add computation caching to Nx and Bazel had good support for it. So one way to add computation caching to Nx was to run Nx on top of Bazel. &lt;/p&gt;

&lt;p&gt;We then realized, however, that to really integrate caching in the dev workflow it will have to be a first-class concept in the build tool itself. That's why we've added &lt;a href="https://nx.dev/latest/angular/workspace/computation-caching"&gt;distributed computation to Nx&lt;/a&gt;. At this point adding Bazel would not give us much on top of what we already have.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bazel and Angular
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://nx.dev"&gt;Nx&lt;/a&gt; is widely used in the Angular community. The Angular team at Google had plans to add Bazel support to the Angular CLI for many years, but &lt;a href="https://dev.to/bazel/angular-bazel-leaving-angular-labs-51ja"&gt;the plans didn't materialize&lt;/a&gt;. The key folks (e.g., Alex Eagle) working on the effort left Google. Google employees no longer maintain &lt;a href="https://github.com/bazelbuild/rules_nodejs"&gt;rules_nodejs&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This, of course, doesn't mean that rules_nodejs isn't maintained well. It simply means that the vast majority of Angular developers won't use Bazel, so there is less motivation for us to support them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bazel or Nx
&lt;/h2&gt;

&lt;p&gt;When using Nx you can swap its default task runner with one using Bazel. You could make it work, but  most people should not do it.&lt;/p&gt;

&lt;p&gt;The core of Nx is technology-agnostic. You can use it to build anything, and folks do (there are &lt;a href="https://nx.dev/nx-community"&gt;third-party plugins&lt;/a&gt; for Go, Java, Python, etc.). A lot of the value Nx provides is in its plugins. These plugins use existing tools, many of which either don't work with Bazel at all or require significant workarounds.&lt;/p&gt;

&lt;p&gt;This is the issue we faced. We built a Bazel-based runner for Nx. Some plugins (e.g., tslint) worked with it, but the majority didn't.&lt;/p&gt;

&lt;p&gt;In many ways, Bazel is akin to something like &lt;a href="https://dart.dev"&gt;Dart&lt;/a&gt;. It's a great piece of technology, but it doesn't play nicely with existing systems. Existing JS libraries didn't work well with Dart. Similarly, existing tools don't work well with Bazel.&lt;/p&gt;

&lt;p&gt;Nx is more like &lt;a href="https://www.typescriptlang.org/"&gt;TypeScript&lt;/a&gt;. Sometimes it results in suboptimal choices (Dart has &lt;code&gt;int&lt;/code&gt; and &lt;code&gt;float&lt;/code&gt;s, and TypeScript has only &lt;code&gt;number&lt;/code&gt;s), but most of the time it doesn't matter. It is straightforward to add to an existing project. Learning resources are plentiful. It integrates well with the rest of the stack. &lt;/p&gt;

&lt;p&gt;Discovered a new tool, say [Snowpack](&lt;a href="https://snowpack.dev_"&gt;https://snowpack.dev_&lt;/a&gt;? Adding it to an Nx workspace is trivial. Any tool you want either "just works," or can be made to work with minimal effort. We value this and I believe a lot of folks do as well. Building a custom stack for your organization is not just a technical challenge. It's also a recruiting one.&lt;/p&gt;

&lt;p&gt;You can also see some benefits after introducing Nx almost right away, which means it is a lot less risky for the business.&lt;/p&gt;

&lt;p&gt;Of course, I think Nx is a better choice for most companies, otherwise I would not be working on it, but I know that for some Bazel might be the right tool. I recommend you to try out both. Go to &lt;a href="https://nx.dev"&gt;nx.dev&lt;/a&gt; and try it out. Try out Bazel as well. And then make your own mind.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Fear of Being Ordinary</title>
      <dc:creator>Victor Savkin</dc:creator>
      <pubDate>Wed, 28 Oct 2020 18:26:46 +0000</pubDate>
      <link>https://forem.com/nrwl/fear-of-being-ordinary-16mi</link>
      <guid>https://forem.com/nrwl/fear-of-being-ordinary-16mi</guid>
      <description>&lt;p&gt;Reading &lt;a href="https://www.amazon.com/Zen-Art-Motorcycle-Maintenance-Inquiry/dp/0060589469"&gt;"Zen and the Art of Motorcycle Maintenance"&lt;/a&gt; made me want to understand the tools I use, to tinker with them, to truly make them my own.&lt;/p&gt;

&lt;p&gt;I already had an &lt;a href="https://ergodox-ez.com"&gt;ErgoDox&lt;/a&gt;, a highly-customized editor, high income, and a lot of free time — a good foundation for a multi-year obsession with customization.&lt;/p&gt;

&lt;p&gt;This post is the reflection of why I — and I believe many other programmers — get into this, how unproductive it can be, and how to snap out of it.&lt;/p&gt;

&lt;h1&gt;
  
  
  Reasons
&lt;/h1&gt;

&lt;p&gt;Why do we get obsessed about the exactly right keyboard setup, color schemes, fonts, task management systems? &lt;/p&gt;

&lt;h2&gt;
  
  
  Better for Productivity
&lt;/h2&gt;

&lt;p&gt;We programmers like to feel productive. It shouldn't be surprising that I told myself that having 7 layers on my keyboard is simply necessary for productivity. I'll get more PRs merged! &lt;/p&gt;

&lt;p&gt;This is how you imagine yourself when you type on a split keyboard:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--HmyaQskQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ul3dch29vzpnnzhm8njr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HmyaQskQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ul3dch29vzpnnzhm8njr.png" alt="Jimmy Page Playing Guitar"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Of course not right away. It takes weeks to develop muscle memory (this is assuming you don't change the setup, and of course you do change it). No, these gains are realized in the long run. This is an investment! &lt;/p&gt;

&lt;p&gt;I applied this across the board. A todo app? Tried all of them, and even built my own. Productivity systems? Tried every variation of every system.&lt;/p&gt;

&lt;p&gt;But any time I actually tried to measure it, the result was always the same. I'm faster on my ThinkPad using the default settings, and I'm just as organized when I use a plain notebook. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mTmol6iV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ca9an89ge1twzcl8mhro.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mTmol6iV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ca9an89ge1twzcl8mhro.jpg" alt="Notebook"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Better for Health
&lt;/h2&gt;

&lt;p&gt;No one in the right mind would spend $500 bucks on a keyboard. But what about a keyboard that is good for your health? Sign me in.&lt;/p&gt;

&lt;p&gt;I tried a dozen ergonomic keyboards over the years. Most of them have pictures like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--doMX8pTr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/5edruurs9glz50grnx31.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--doMX8pTr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/5edruurs9glz50grnx31.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Why? I have carpal tunnel syndrome. At some point it was so bad I had to switch to using my left hand when brushing my teeth. I just could not hold a toothbrush in my right hand. Tried every keyboard and mouse under the sun. Nothing helped. &lt;/p&gt;

&lt;p&gt;One day I started using a boring low-profile keyboard and paid a lot more attention to the position of my wrists. It didn't fix the problem completely, but it helped a lot. &lt;/p&gt;

&lt;p&gt;That's actually what I was told when I had an assessment done at Google. But being a techy, it’s hard to believe that the solution is that simple. &lt;/p&gt;

&lt;h1&gt;
  
  
  What is Customization Actually Good For?
&lt;/h1&gt;

&lt;p&gt;If we don't actually do it for productivity or health reasons, why do we do it?&lt;/p&gt;

&lt;h2&gt;
  
  
  Fear of Being Ordinary
&lt;/h2&gt;

&lt;p&gt;Desire to be unique — not like others — is a deep psychological need for many, myself included. I grew up in a small Russian village. Half of the students in my school could barely read. So when I started moving from city to city and from country to country, I always carried with me the feeling of being "not quite as"; not being interesting enough.&lt;/p&gt;

&lt;p&gt;But being ordinary is not bad. &lt;a href="https://en.wikipedia.org/wiki/Cogito,_ergo_sum"&gt;"Cogito, ergo sum"&lt;/a&gt; makes each of us irreplaceable and not comparable to each other, by construction. Nothing else is needed, folks. This is, of course, a challenging sell to many, especially in North America where the culture is obsessed with superheroes and outcasts.&lt;/p&gt;

&lt;h2&gt;
  
  
  Desire for Control
&lt;/h2&gt;

&lt;p&gt;Country is on fire? Marriage is falling apart? We can’t fix that, but we can spend hours choosing the best font and color scheme for our editors.&lt;/p&gt;

&lt;h2&gt;
  
  
  Desire to Escape
&lt;/h2&gt;

&lt;p&gt;Need to make a difficult decision? Make a risky bet in business? I could do that, but I could also switch my todo list cause my tasks are getting out of hand and it stresses me out.&lt;/p&gt;

&lt;h1&gt;
  
  
  What I Mean and What I Don’t Mean
&lt;/h1&gt;

&lt;h3&gt;
  
  
  Are you saying I don’t need to be productive?
&lt;/h3&gt;

&lt;p&gt;I believe being overly obsessed with productivity is unhealthy. But putting that aside, in general you do want to be good at what you do. So, yes, learn the tools you use, but most of the gains are in understanding the tools themselves. Learn Bash instead of crafting a perfect &lt;code&gt;.bashrc&lt;/code&gt;. Learn how to touch type fast, instead of rearranging keys on the keyboard. &lt;/p&gt;

&lt;p&gt;And don’t forget: we are knowledge workers. So things that affect our productivity the most are high-quality sleep, good air, good diet, etc. Invest into that.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is wrong with self-expression?
&lt;/h3&gt;

&lt;p&gt;In general, there is nothing wrong with it. If you want to assemble and program your keyboard because that’s who you are, go ahead. That’s a great hobby. If it gives you joy, that’s fantastic. But it’s important to know that is what it is: a hobby, a means of self-expression. Choosing to use a 60% keyboard is like choosing to wear skinny jeans. It won’t give you the productivity boost you are looking for.&lt;/p&gt;

&lt;p&gt;The problem is when it becomes an unhealthy coping mechanism. There are better ways to deal with the anxiety created by the lack of control (e.g., meditation, CBT/Stoicism, therapy).&lt;/p&gt;

&lt;h1&gt;
  
  
  Summary
&lt;/h1&gt;

&lt;p&gt;Many great engineers enjoy customizing their dev setup, often obsessively. The given reasons are productivity and health. I think it doesn’t really help with either. Instead, the excessive customization is a way (often not the best one) to fulfil basic psychological needs.  &lt;/p&gt;

</description>
      <category>productivity</category>
      <category>reflection</category>
    </item>
    <item>
      <title>Modern Angular</title>
      <dc:creator>Victor Savkin</dc:creator>
      <pubDate>Wed, 28 Oct 2020 16:27:54 +0000</pubDate>
      <link>https://forem.com/nx/modern-angular-1960</link>
      <guid>https://forem.com/nx/modern-angular-1960</guid>
      <description>&lt;h1&gt;
  
  
  Angular Is Many Things
&lt;/h1&gt;

&lt;p&gt;In my blog post &lt;a href="https://blog.nrwl.io/angular-is-an-onion-63f4cd1ece6"&gt;"Angular is an Onion"&lt;/a&gt; I showed that Angular is many things.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--R9XLCkzl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/cf2p9tyq1cdjevwzhyw8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--R9XLCkzl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/cf2p9tyq1cdjevwzhyw8.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the middle there are the core capabilities and APIs of the framework. The team at Google is well positioned to build them: the team has the right expertise and feedback mechanisms. As we move away from the core, however, and go into state management, testing support, linting support, editor support, and GitHub integration, the Angular community becomes a more appropriate owner. We, the community, have the right expertise and feedback mechanisms.&lt;/p&gt;

&lt;p&gt;I ended the post saying that if something in the Angular stack feels outdated, the community should modernize it. And today &lt;strong&gt;I want to show what a more modern Angular looks like&lt;/strong&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Seeing is Believing
&lt;/h1&gt;

&lt;p&gt;When it comes to dev tools, seeing is believing. No matter how conceptually beautiful your stuff is, if it is clunky in practice, no one will use it. Please watch this video, and you will see that you can use modern tools and techniques with Angular without losing its integrated development experience.&lt;/p&gt;

&lt;p&gt;Nx is an advanced, pluggable build tool with first-class Angular support. Although Nx has its own CLI, it also works with the Angular CLI. You still have the ng command, the angular.json file, and the rest of it. But you also get modern testing and linting tools, modern state management libraries, enhanced Angular CLI, VSCode support, GitHub support, and more.&lt;/p&gt;

&lt;h1&gt;
  
  
  Modern Testing and Linting Tools
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Jest&lt;/strong&gt; (&lt;em&gt;replaces Karma&lt;/em&gt;) Jest is a zero-config JavaScript testing framework that prioritizes simplicity. With robust documentation and a feature-rich API, Jest is a great solution for JS developers looking for a powerful, modern testing toolkit.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Cypress&lt;/strong&gt; (&lt;em&gt;replaces Protractor&lt;/em&gt;) Cypress supplies fast, reliable E2E testing for anything that runs in the browser. Cypress includes time travel debugging, readable errors and stack traces, real-time reloads, and more.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;ESLint&lt;/strong&gt; (&lt;em&gt;replaces TSLint&lt;/em&gt;) ESLint uses static analysis to identify problems in your code, many of which are fixed automatically in a syntax-aware manner. ESLint is highly configurable; customize your linting to preprocess code, use custom parsers, or write your own rules.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Modern Component Design Tools
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Design systems&lt;/strong&gt; are collections of repeatable components and standards. For many companies, they are a keystone for high quality, consistent, and standardized development and branding.&lt;/p&gt;

&lt;p&gt;And let’s face it: writing Karma tests for presentational components does not work well. For instance, we often use animations in design to engage and delight users — and animations are important to test. When testing details like animations, we want to make sure the necessary UI components are visible before clicking. Cypress does that. Karma does not. Neither Karma nor Jest are suitable for this job.&lt;/p&gt;

&lt;p&gt;With Nx, you get &lt;a href="https://nx.dev/latest/angular/plugins/cypress/overview"&gt;Cypress for end-to-end testing of browser-based interactions&lt;/a&gt;, as well as built-in, &lt;a href="https://nx.dev/latest/angular/plugins/storybook/overview"&gt;seamless Storybook integration&lt;/a&gt;. Storybook is an open source tool for building UI components in isolation, making it an excellent platform for design systems that can be shared across an entire brand, including apps built with different frameworks and libraries.&lt;/p&gt;

&lt;h1&gt;
  
  
  Modern State Management Frameworks
&lt;/h1&gt;

&lt;p&gt;Nx gives developers built-in support for NgRx to take advantage of reactive state management. Inspired by Redux, NgRx unifies events in your application and derives state using RxJS.&lt;/p&gt;

&lt;h1&gt;
  
  
  Modern CLI
&lt;/h1&gt;

&lt;p&gt;The Angular CLI is one of the main reasons developers use Angular today. However, modern tooling for web development continues to advance rapidly. That’s why Nx &lt;a href="https://nx.dev/latest/angular/getting-started/nx-and-cli"&gt;seamlessly wraps the Angular CLI&lt;/a&gt; to add computation caching and build coordination.&lt;/p&gt;

&lt;h1&gt;
  
  
  Nx Uses Computation Caching
&lt;/h1&gt;

&lt;p&gt;Computation caching is a valuable way to improve performance. Computing (tests, arguments, operations, etc.) is expensive and time-consuming, but computation caching means you never have to build the same code more than once.&lt;/p&gt;

&lt;p&gt;WebPack, Jest, and TypeScript all perform computation caching. The Angular team attempted to integrate Bazel into the Angular CLI, but that effort has been canceled. Nx builds on inspiration from Bazel and similar tools, and implements computation caching in a way that works with any tool and requires no configuration. The result is much faster builds and continuous integration.&lt;/p&gt;

&lt;p&gt;In addition, when connected to &lt;a href="https://nx.app"&gt;Nx Cloud&lt;/a&gt;, you can share the computation cache with everyone working on the same project.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rcTuXfCx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/340txwuta3swea7sqrdh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rcTuXfCx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/340txwuta3swea7sqrdh.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Nx Integrated Development Experience
&lt;/h1&gt;

&lt;p&gt;Nx provides a modern dev experience that is more integrated. Nx adds a high-quality &lt;a href="https://marketplace.visualstudio.com/items?itemName=nrwl.angular-console"&gt;VS Code plugin&lt;/a&gt; which helps you use the build tool effectively, generate components in folders, and much more.&lt;/p&gt;

&lt;p&gt;Nx also supports optional free cloud support with Nx Cloud, as well as &lt;a href="https://github.com/apps/nx-cloud"&gt;GitHub integration&lt;/a&gt;. Share links with your teammates where everyone working on a project can examine detailed build logs and get insights about how to improve your apps and your builds.&lt;/p&gt;

&lt;h1&gt;
  
  
  Clearing Potential Misunderstandings
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;To prevent erroneous analogies, this is nothing like Preact. The Angular framework and the Angular CLI are still here. All your builders / schematics / libraries will work the same way. This is an upgrade, not a replacement. The goal is to give Angular developers access to the tools other JavaScript developers use without losing the toolability and stability that Angular provides. It’s akin to what Spring did to Java. It showed that Java can be fast, lightweight, and fun.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It’s not a new project. Nx has been around for many years, and it’s used to build small and large applications.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Learn More
&lt;/h1&gt;

&lt;p&gt;Check out Modern Angular on &lt;a href="https://nx.dev"&gt;nx.dev&lt;/a&gt; and give it a try!&lt;/p&gt;

</description>
      <category>angular</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>nx</category>
    </item>
  </channel>
</rss>
