<?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>DEV Community: Devin Shoemaker</title>
    <description>The latest articles on DEV Community by Devin Shoemaker (@devinshoemaker).</description>
    <link>https://dev.to/devinshoemaker</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%2F194379%2F683ef3e4-8cd1-460c-af34-bcbb00743b1a.jpg</url>
      <title>DEV Community: Devin Shoemaker</title>
      <link>https://dev.to/devinshoemaker</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/devinshoemaker"/>
    <language>en</language>
    <item>
      <title>Configure ESLint for Next.js</title>
      <dc:creator>Devin Shoemaker</dc:creator>
      <pubDate>Fri, 19 Feb 2021 02:17:31 +0000</pubDate>
      <link>https://dev.to/devinshoemaker/configure-eslint-for-next-js-59j7</link>
      <guid>https://dev.to/devinshoemaker/configure-eslint-for-next-js-59j7</guid>
      <description>&lt;p&gt;By default, Next.js does not come with any linting solution. &lt;a href="https://eslint.org/"&gt;ESLint&lt;/a&gt; is commonly used for linting modern web applications, and is a good companion to Next.js.&lt;/p&gt;

&lt;h2&gt;
  
  
  Install ESLint Dependencies
&lt;/h2&gt;

&lt;p&gt;First, we need to install these ESLint dependencies:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install --save-dev eslint eslint-plugin-react

# or

yarn add --dev eslint eslint-plugin-react
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;eslint&lt;/code&gt; is the CLI and main package responsible for linting your project.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;eslint-plugin-react&lt;/code&gt; is a plugin for ESLint with rules specific to React.&lt;/p&gt;

&lt;h2&gt;
  
  
  Generate ESLint Config
&lt;/h2&gt;

&lt;p&gt;ESLint requires a config in the root of the project, which can be easily generated with the CLI.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx eslint --init

# or

yarn run eslint --init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command will prompt you for a series of questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Select &lt;code&gt;To check syntax and find problems&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Select &lt;code&gt;JavaScript modules&lt;/code&gt; as the type of module your project uses&lt;/li&gt;
&lt;li&gt;Select &lt;code&gt;React&lt;/code&gt; as the type of framework your project uses&lt;/li&gt;
&lt;li&gt;Select whether your project uses TypeScript. Note: if you do not already have TypeScript configured then your linter will fail. However, you can easily set this up later with this guide: [[eslint-typescript]].&lt;/li&gt;
&lt;li&gt;Select &lt;code&gt;Browser&lt;/code&gt; as the environment where your code will run in&lt;/li&gt;
&lt;li&gt;Select what format you want the ESLint config to be in. I personally prefer JSON.&lt;/li&gt;
&lt;li&gt;If prompted to install dependencies, click &lt;code&gt;Yes&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You should now have an &lt;code&gt;.eslintrc.*&lt;/code&gt; file generated at the root of your project.&lt;/p&gt;

&lt;p&gt;ESLint can now be used with the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx eslint pages/*

# or

yarn run pages/*
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The commands above will only lint the files inside &lt;code&gt;pages/&lt;/code&gt;, but you can customize this however you see fit. You can also specify multiple directories: &lt;code&gt;pages/* components/*&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;For more information on using the CLI, visit the &lt;a href="https://eslint.org/docs/user-guide/command-line-interface"&gt;official documentation&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Update ESLint Config for Next.js
&lt;/h2&gt;

&lt;p&gt;If you run ESLint as-is then you'll likely have some linting errors. To fix this, we need to update the ESLint config rules to fit Next.js.&lt;/p&gt;

&lt;p&gt;The first thing we need to fix is the warning: &lt;code&gt;Warning: React version not specified in eslint-plugin-react settings&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;To get rid of this, we can add &lt;code&gt;settings&lt;/code&gt; property at the root of our config:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    "settings": {
        "react": {
            "version": "detect"
        }
    },
    "env": {
        "browser": true,
        "es2021": true
    },
    "extends": [
        "eslint:recommended",
        "plugin:react/recommended"
    ],
    "parserOptions": {
        "ecmaFeatures": {
            "jsx": true
        },
        "ecmaVersion": 12,
        "sourceType": "module"
    },
    "plugins": [
        "react"
    ],
    "rules": {
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open the ESLint config that was generated and edit the &lt;code&gt;rules&lt;/code&gt; object:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    "settings": {
        "react": {
            "version": "detect"
        }
    },
    "env": {
        "browser": true,
        "es2021": true
    },
    "extends": [
        "eslint:recommended",
        "plugin:react/recommended"
    ],
    "parserOptions": {
        "ecmaFeatures": {
            "jsx": true
        },
        "ecmaVersion": 12,
        "sourceType": "module"
    },
    "plugins": [
        "react"
    ],
    "rules": {
        "react/prop-types": "off",
        "react/react-in-jsx-scope": "off"
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;react/prop-types&lt;/code&gt; rule enforces that all components have &lt;a href="https://reactjs.org/docs/typechecking-with-proptypes.html"&gt;&lt;code&gt;prop-types&lt;/code&gt;&lt;/a&gt; defined. While we can use &lt;code&gt;prop-types&lt;/code&gt; with Next.js, TypeScript is typically preferred.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;react/react-in-jsx-scope&lt;/code&gt; rule will throw an error if a component files not import React. With React 17, which Next.js now ships with, it is no longer necessary to import React and thus this rule can be disabled.&lt;/p&gt;

&lt;p&gt;Finally, we need to update the &lt;code&gt;env&lt;/code&gt; property to include &lt;code&gt;node&lt;/code&gt; since Next.js supports Server Side Rendering in Node.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    "settings": {
        "react": {
            "version": "detect"
        }
    },
    "env": {
        "browser": true,
        "es2021": true,
        "node": true
    },
    "extends": [
        "eslint:recommended",
        "plugin:react/recommended"
    ],
    "parserOptions": {
        "ecmaFeatures": {
            "jsx": true
        },
        "ecmaVersion": 12,
        "sourceType": "module"
    },
    "plugins": [
        "react"
    ],
    "rules": {
        "react/prop-types": "off",
        "react/react-in-jsx-scope": "off"
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Ignore Unnecessary Files
&lt;/h2&gt;

&lt;p&gt;Now that we have ESLint working properly with Next.js, we need to add a file to tell ESLint to ignore certain files that we do not want linted.&lt;/p&gt;

&lt;p&gt;Create a file called &lt;code&gt;.eslintignore&lt;/code&gt; at the root of your project with these contents:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;**/node_modules/*
**/out/*
**/.next/*
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Add Lint Script to package.json
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;scripts&lt;/code&gt; property in your &lt;code&gt;package.json&lt;/code&gt; can be updated to add a &lt;code&gt;lint&lt;/code&gt; script to make linting easier:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "name": "my-site",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "eslint ./ --ext js,jsx,ts,tsx"
  },
  "dependencies": {
    "next": "10.0.5",
    "react": "17.0.1",
    "react-dom": "17.0.1"
  },
  "devDependencies": {
    "eslint": "^7.18.0",
    "eslint-plugin-react": "^7.22.0"
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this &lt;code&gt;lint&lt;/code&gt; script we are calling the ESLint CLI, telling it to lint files under the current folder (&lt;code&gt;./&lt;/code&gt;), and looking for files with the extensions &lt;code&gt;js&lt;/code&gt;, &lt;code&gt;jsx&lt;/code&gt;, &lt;code&gt;ts&lt;/code&gt;, or &lt;code&gt;tsx&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://eslint.org/docs/user-guide/getting-started"&gt;ESLint Getting started&lt;/a&gt;&lt;br&gt;
&lt;a href="https://paulintrognon.fr/blog/typescript-prettier-eslint-next-js"&gt;Start a clean Next.js project with TypeScript, ESLint and Prettier from scratch&lt;/a&gt;&lt;/p&gt;

</description>
      <category>eslint</category>
      <category>nextjs</category>
      <category>react</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Use Tailwind CSS with React Apps in Nx</title>
      <dc:creator>Devin Shoemaker</dc:creator>
      <pubDate>Sun, 07 Feb 2021 01:23:06 +0000</pubDate>
      <link>https://dev.to/devinshoemaker/use-tailwind-css-with-react-apps-in-nx-1c7l</link>
      <guid>https://dev.to/devinshoemaker/use-tailwind-css-with-react-apps-in-nx-1c7l</guid>
      <description>&lt;p&gt;&lt;a href="https://tailwindcss.com"&gt;Tailwind&lt;/a&gt; is a popular utility-based CSS framework that enables developers to rapidly implement and iterate on design. Responsive design and dark mode are easier than ever to implement, and so far I have been very happy with Tailwind and even use it on my site.&lt;/p&gt;

&lt;h2&gt;
  
  
  Install Tailwind Dependencies
&lt;/h2&gt;

&lt;p&gt;Nx 11 still uses PostCSS 7, so we have to install Tailwind dependencies in PostCSS 7 compatibility mode.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install tailwindcss@npm:@tailwindcss/postcss7-compat @tailwindcss/postcss7-compat postcss@^7 autoprefixer@^9

# or

yarn add tailwindcss@npm:@tailwindcss/postcss7-compat @tailwindcss/postcss7-compat postcss@^7 autoprefixer@^9
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Initialize Tailwind
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx tailwindcss init -p
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Purge CSS
&lt;/h2&gt;

&lt;p&gt;Tailwind requires us to specify the files that we should purge the CSS from. Without purging CSS, all of the Tailwind styles are loaded into the application which is quite large. When we purge the CSS, we can remove all the unused styles.&lt;/p&gt;

&lt;p&gt;Update &lt;code&gt;tailwind.config.js&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;module.exports = {
  purge: ['./apps/my-app/**/*.{js,ts,jsx,tsx}'],
  darkMode: false, // or 'media' or 'class'
  theme: {
    extend: {},
  },
  variants: {
    extend: {},
  },
  plugins: [],
}

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

&lt;/div&gt;



&lt;p&gt;Make sure to replace &lt;code&gt;my-app&lt;/code&gt; with the name of your application. If additional applications are added to your workspace that will use Tailwind then you will need to add another string to the &lt;code&gt;purge&lt;/code&gt; property accordingly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Extend Webpack Config
&lt;/h2&gt;

&lt;p&gt;The default &lt;code&gt;@nrwl/react&lt;/code&gt; Webpack config does not include the PostCSS loader, so we need to override it.&lt;/p&gt;

&lt;p&gt;Create a file called &lt;code&gt;react-tailwind.webpack.config.js&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const nrwlConfig = require('@nrwl/react/plugins/webpack.js');

module.exports = (config) =&amp;gt; {
  nrwlConfig(config);
  return {
    ...config,
    module: {
      rules: [
        ...config.module.rules,
        {
          test: /\.css$|\.scss$|\.sass$|\.less$|\.styl$/,
          use: [
            {
              loader: 'postcss-loader',
            },
          ],
        },
      ],
    },
  };
};

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

&lt;/div&gt;



&lt;p&gt;Next, update your &lt;code&gt;workspace.json&lt;/code&gt; and replace the &lt;code&gt;webpackConfig&lt;/code&gt; for your app:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"webpackConfig": "react-tailwind.webpack.config.js"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Import Tailwind Styles
&lt;/h2&gt;

&lt;p&gt;Next, in order to use the Tailwind styles, you must import them in your root component:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import 'tailwindcss/tailwind.css';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you should be able to use Tailwind CSS classes within your Nx React application.&lt;/p&gt;

</description>
      <category>nx</category>
      <category>monorepo</category>
      <category>react</category>
      <category>tailwindcss</category>
    </item>
    <item>
      <title>Nxtend Nx 11 Support and Plugin Updates</title>
      <dc:creator>Devin Shoemaker</dc:creator>
      <pubDate>Tue, 05 Jan 2021 13:58:08 +0000</pubDate>
      <link>https://dev.to/devinshoemaker/nxtend-11-1g1a</link>
      <guid>https://dev.to/devinshoemaker/nxtend-11-1g1a</guid>
      <description>&lt;p&gt;The Nxtend plugins have been updated to support Nx 11, and with that are coming some changes. Nxtend plugin versions will now be more closely aligned with Nx, and the Ionic and Capacitor plugins will be more closely aligned with their respective projects. A lot of work have gone into the updates of each of these plugins. Features have been added, bugs have been fixed, and there were even some breaking changes. However, I think that Nxtend is the most sustainable and maintanable than ever.&lt;/p&gt;

&lt;p&gt;Read more for details on updates and upgrades...&lt;/p&gt;

&lt;h2&gt;
  
  
  Ionic React
&lt;/h2&gt;

&lt;p&gt;This plugin has some more dramatic changes compared to the rest. I have determined that some changes needed to be made to ensure the longevity of this project, and that resulted in the removal of some functionality. This is a breaking change in terms of interfacing with the plugin schematics, but it should not break existing applications. In this case, a number of options have been removed from the &lt;code&gt;application&lt;/code&gt; schematic.&lt;/p&gt;

&lt;p&gt;This includes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;--classComponent
--style
--pascalCaseComponent
--skipFromat
--linter
--js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In exchange, this plugin now supports generating several of the official starter templates, such as tabs and sidemenu. These changes more closely align this plugin with the Ionic CLI and will make the project vastly more maintainable. In the future I want to support more schematics such as libraries, pages, and more, and I want to be able add these enhancements in a scalable manner.&lt;/p&gt;

&lt;p&gt;I hope the users of this plugin will understand this decision. Removing functionality is never a good user experience, but I believe that this change will pay dividends in the future.&lt;/p&gt;

&lt;h3&gt;
  
  
  Features
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;add additional Ionic starter templates to application schematic&lt;/li&gt;
&lt;li&gt;support custom Nx layouts&lt;/li&gt;
&lt;li&gt;update Ionic to 5.5.2&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Bug Fixes
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;fix generating an application in a sub-directory with Capacitor enabled&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  BREAKING CHANGES
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;remove &lt;code&gt;classComponent&lt;/code&gt; option from &lt;code&gt;application&lt;/code&gt; schematic (now defaults to functional components)&lt;/li&gt;
&lt;li&gt;remove &lt;code&gt;style&lt;/code&gt; option from the &lt;code&gt;application&lt;/code&gt; schematic (now defaults to CSS)&lt;/li&gt;
&lt;li&gt;remove &lt;code&gt;pascalCaseComponent&lt;/code&gt; option from the &lt;code&gt;application&lt;/code&gt; schematic (now defaults to true)&lt;/li&gt;
&lt;li&gt;remove &lt;code&gt;skipFormat&lt;/code&gt; option from the &lt;code&gt;application&lt;/code&gt; schematic (now defaults to false)&lt;/li&gt;
&lt;li&gt;remove &lt;code&gt;linter&lt;/code&gt; option from the &lt;code&gt;application&lt;/code&gt; schematic (now defaults to ESLint)&lt;/li&gt;
&lt;li&gt;remove &lt;code&gt;js&lt;/code&gt; option from the &lt;code&gt;application&lt;/code&gt; schematic (now defaults to true)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Ionic Angular
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Features
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Nx 11 support (Nx 11 now required)&lt;/li&gt;
&lt;li&gt;update Ionic to 5.5.2&lt;/li&gt;
&lt;li&gt;add additional Ionic starter templates to application schematic&lt;/li&gt;
&lt;li&gt;support &lt;code&gt;none&lt;/code&gt; as a unit test and e2e config for the application schematic&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Bug Fixes
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;fix generating an application in a sub-directory with Capacitor enabled&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Capacitor
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Features
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Nx 11 support (Nx 11 now required)&lt;/li&gt;
&lt;li&gt;update Capacitor to 2.4.5&lt;/li&gt;
&lt;li&gt;added &lt;code&gt;cap&lt;/code&gt; builder for a more generic interface with the Capacitor CLI&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Upgrading
&lt;/h2&gt;

&lt;p&gt;If you are utilizing the &lt;code&gt;@nxtend/capacitor&lt;/code&gt; plugin then you should upgrade this first:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nx migrate @nxtend/capacitor

yarn install
# or
npm install

nx migrate --run-migrations migrations.json

yarn install
# or
npm install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, you can upgrade the &lt;code&gt;@nxtend/ionic-react&lt;/code&gt; plugin:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nx migrate @nxtend/ionic-react

yarn install
# or
npm install

nx migrate --run-migrations migrations.json

yarn install
# or
npm install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or the &lt;code&gt;@nxtend/ionic-angular&lt;/code&gt; plugin:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nx migrate @nxtend/ionic-react

yarn install
# or
npm install

nx migrate --run-migrations migrations.json

yarn install
# or
npm install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For information on upgrading the plugin, visit the &lt;a href="https://nxtend.dev/docs/nxtend/upgrades"&gt;nxtend upgrades documentation&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ionic</category>
      <category>capacitor</category>
      <category>nx</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Release @nxtend/ionic-angular 1.0.0</title>
      <dc:creator>Devin Shoemaker</dc:creator>
      <pubDate>Fri, 13 Nov 2020 15:17:45 +0000</pubDate>
      <link>https://dev.to/devinshoemaker/release-nxtend-ionic-angular-1-0-0-2c0d</link>
      <guid>https://dev.to/devinshoemaker/release-nxtend-ionic-angular-1-0-0-2c0d</guid>
      <description>&lt;p&gt;Earlier this year I released the Nxtend Ionic React plugin for Nx. From the beginning I intended to support all of the frameworks that Ionic officially supports, and today, Ionic Angular support has been added to Nx with the Nxtend Ionic Angular plugin.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://ionicframework.com"&gt;Ionic&lt;/a&gt; combined with &lt;a href="https://capacitorjs.com/"&gt;Capacitor&lt;/a&gt; enables developers to build high quality cross platform applications with web technology. &lt;a href="https://nx.dev"&gt;Nx&lt;/a&gt; offers extensible tooling for monorepos, which can be a powerful combination with Ionic. Using Nx, large applications can be broken down into smaller libraries that are more maintainable and faster to test and build by using Nx's &lt;code&gt;affected&lt;/code&gt; commands. Large organizations may have multiple applications that could benefit from sharing code, and Nx makes that easy as well.&lt;/p&gt;

&lt;p&gt;To start developing cross platform application with Ionic Angular in an Nx workspace, visit the official &lt;a href="https://nxtend.dev/docs/ionic-angular/getting-started"&gt;Getting Started&lt;/a&gt; guide.&lt;/p&gt;

</description>
      <category>ionic</category>
      <category>angular</category>
      <category>nx</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Release @nxtend/ionic-react 4.0.0</title>
      <dc:creator>Devin Shoemaker</dc:creator>
      <pubDate>Thu, 05 Nov 2020 03:00:20 +0000</pubDate>
      <link>https://dev.to/devinshoemaker/release-nxtend-ionic-react-4-0-0-1f23</link>
      <guid>https://dev.to/devinshoemaker/release-nxtend-ionic-react-4-0-0-1f23</guid>
      <description>&lt;p&gt;Nxtend Ionic React v4 includes typical quality of life fixes with dependency updates, but has some breaking changes to the API. These changes will improve the maintainability of this project and will help prepare the plugin for future capabilities. For more details on these changes, read below.&lt;/p&gt;

&lt;h2&gt;
  
  
  Features
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;update Ionic to 5.4.1&lt;/li&gt;
&lt;li&gt;add &lt;code&gt;ionic.config.json&lt;/code&gt; to application&lt;/li&gt;
&lt;li&gt;update starter template&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  BREAKING CHANGES
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;don't install and configure Cypress Testing Library&lt;/li&gt;
&lt;li&gt;removed &lt;code&gt;disableSanitizer&lt;/code&gt; flag from &lt;code&gt;application&lt;/code&gt; schematic&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One of the major changes of this release is that &lt;code&gt;@nxtend/ionic-react&lt;/code&gt; will no longer add and configure Cypress Testing Library dependencies. We are big fans of the project, but maintaining the dependencies and breaking changes has become more effort than it's worth for this plugin. If you are generating a new project then I would highly recommend you configure this yourself. If you need help getting started, then please visit the &lt;a href="https://testing-library.com/docs/cypress-testing-library/intro"&gt;official documentation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The latest updates from the Ionic React blank starter template have also been added to the plugin.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;disableSanitizer&lt;/code&gt; flag has been removed from the &lt;code&gt;application&lt;/code&gt; schematic. This plugin supports many permutations due to the amount of configuration options when generating an application, and as many of these permutations are end-to-end testing as much as possible. Every new option that is added increases the level of maintenance required as well as the test times, and at this point, it does not seem worth it to continue supporting the &lt;code&gt;disableSanitizer&lt;/code&gt; flag. The built-in Ionic sanitizer should only be disabled unless it explicitely needs to, and this process is well documented in the official &lt;a href="https://ionicframework.com/docs/techniques/security#ejecting-from-the-built-in-sanitizer"&gt;Ionic documentation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Nxtend Capacitor has also been &lt;a href="https://nxtend.dev/blog/capacitor-2.0.2"&gt;updated&lt;/a&gt;, so it is recommended you update that plugin as well.&lt;/p&gt;

&lt;p&gt;For information on upgrading the plugin, visit the &lt;a href="https://nxtend.dev/docs/nxtend/upgrades"&gt;nxtend upgrades documentation&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ionic</category>
      <category>react</category>
      <category>nx</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Release @nxtend/capacitor 2.0.2</title>
      <dc:creator>Devin Shoemaker</dc:creator>
      <pubDate>Thu, 05 Nov 2020 02:56:22 +0000</pubDate>
      <link>https://dev.to/devinshoemaker/release-nxtend-capacitor-2-0-2-34cf</link>
      <guid>https://dev.to/devinshoemaker/release-nxtend-capacitor-2-0-2-34cf</guid>
      <description>&lt;p&gt;Nxtend Capacitor v2 is here! This release has a number of big changes that warrated a major release. Capacitor project structures have been changed, Nx Console support has been improved, and dependencies have been updated. That being said, a manual migration is needed to support upcoming capabilities. Read the full blog post for more information on updating the plugin and migrating your projects. Please note, due to an npm issue, the current release is 2.0.2.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fixes
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;fix Windows support&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Features
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;update Capacitor to 2.4.2&lt;/li&gt;
&lt;li&gt;add Capacitor configs to frontend application&lt;/li&gt;
&lt;li&gt;add or update &lt;code&gt;package.json&lt;/code&gt; in project folder when generating a Capacitor project&lt;/li&gt;
&lt;li&gt;add builder configurations for Nx Console&lt;/li&gt;
&lt;li&gt;add &lt;code&gt;add-plugin&lt;/code&gt; schematic for adding Capacitor plugins&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  BREAKING CHANGES
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Capacitor plugins must now be added to both the root and project-level &lt;code&gt;package.json&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One of the major changes in this release is that Capacitor configurations are not added to a dedicated application (e.g. &lt;code&gt;my-app-cap&lt;/code&gt;) but rather added directly to the associated frontend project. This also means that the you will need to run &lt;code&gt;@nxtend/capacitor&lt;/code&gt; builder commands from the frontend project as well (e.g. &lt;code&gt;nx run my-app:sync --project android&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;Another notable change is that the &lt;a href="https://nxtend.dev/docs/capacitor/schematics/capacitor-project"&gt;&lt;code&gt;capacitor-project&lt;/code&gt;&lt;/a&gt; schematic will now add or update the &lt;code&gt;package.json&lt;/code&gt; in the project folder. This was done to increase compatibility with the Capacitor CLI and from now on Capacitor plugins should be added both to the root and project-level &lt;code&gt;package.json&lt;/code&gt;. To help with this, an &lt;a href="https://nxtend.dev/docs/capacitor/schematics/add-plugin"&gt;&lt;code&gt;add-plugin&lt;/code&gt;&lt;/a&gt; schematic has been added.&lt;/p&gt;

&lt;p&gt;For more details on migrating your Capacitor project, visit the &lt;a href="https://github.com/nxtend-team/nxtend/blob/main/packages/capacitor/MIGRATION.md"&gt;&lt;code&gt;MIGRATION.md&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For information on upgrading the plugin, visit the &lt;a href="https://nxtend.dev/docs/nxtend/upgrades"&gt;nxtend upgrades documentation&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ionic</category>
      <category>capacitor</category>
      <category>nx</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Change Nx Default Affected Branch to Main</title>
      <dc:creator>Devin Shoemaker</dc:creator>
      <pubDate>Tue, 22 Sep 2020 02:32:25 +0000</pubDate>
      <link>https://dev.to/devinshoemaker/change-nx-default-affected-branch-to-main-1a</link>
      <guid>https://dev.to/devinshoemaker/change-nx-default-affected-branch-to-main-1a</guid>
      <description>&lt;p&gt;The Nx &lt;a href="https://nx.dev/react/guides/ci/monorepo-affected#rebuilding-and-retesting-what-is-affected"&gt;affected commands&lt;/a&gt; are a powerful way to scale monorepos by only rebuilding and retested the apps and libraries that could be affected by a particular change. This is accomplished by comparing hashes of the files modified in the current branch compared to the base branch which defaults to &lt;code&gt;master&lt;/code&gt;. It's easy to pass in a different branch as a parameter with &lt;code&gt;--base&lt;/code&gt;, however, you can also change this default in the workspace &lt;a href="https://nx.dev/react/workspace/configuration#nx-json"&gt;&lt;code&gt;nx.json&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;First, make sure that you have created the new base branch. In this example, we will be using &lt;code&gt;main&lt;/code&gt; as our base branch.&lt;/p&gt;

&lt;p&gt;Next, edit the workspace &lt;code&gt;nx.json&lt;/code&gt;. If you do not have the &lt;code&gt;affected&lt;/code&gt; property then you will need to add that first, and then you can customize the base branch.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "npmScope": "nxtend",
  "affected": {
    "defaultBase": "main"
  },
  ...
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lastly, this feature is only available in Nx 9.5 or higher. If you are currently on a version of Nx lower than this then I recommend upgrading to the latest version of Nx, or at least the latest version of Nx 9.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Upgrade to latest version:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nx migrate latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Upgrade to Nx 9.7:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nx migrate @nrwl/workspace@9.7.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>nx</category>
      <category>devops</category>
      <category>monorepo</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Release @nxtend/ionic-react 3.1.0</title>
      <dc:creator>Devin Shoemaker</dc:creator>
      <pubDate>Tue, 15 Sep 2020 02:03:11 +0000</pubDate>
      <link>https://dev.to/devinshoemaker/nxtend-ionic-react-3-1-0-300k</link>
      <guid>https://dev.to/devinshoemaker/nxtend-ionic-react-3-1-0-300k</guid>
      <description>&lt;p&gt;This is a pretty typical maintenance release with a few package updates. The most notable change is &lt;code&gt;@testing-library/cypress&lt;/code&gt; which introduces some breaking changes which you can read about below, or in the &lt;a href="https://github.com/testing-library/cypress-testing-library/releases/tag/v7.0.0"&gt;release notes&lt;/a&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Features
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;update &lt;code&gt;@nxtend/capacitor&lt;/code&gt; to 1.1.0&lt;/li&gt;
&lt;li&gt;update Ionic to 5.3.2&lt;/li&gt;
&lt;li&gt;update Ionicons to 5.1.2&lt;/li&gt;
&lt;li&gt;update &lt;code&gt;@testing-library/cypress&lt;/code&gt; to 7.0.0&lt;/li&gt;
&lt;li&gt;update &lt;code&gt;@testing-library/jest-dom&lt;/code&gt; to 5.11.4&lt;/li&gt;
&lt;li&gt;update &lt;code&gt;@testing-library/user-event&lt;/code&gt; to 12.1.5&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  BREAKING CHANGES
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;@testing-library/cypress&lt;/code&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;get&lt;/code&gt; and &lt;code&gt;query&lt;/code&gt; queries (which have been deprecated) have now been removed. Use &lt;code&gt;find&lt;/code&gt; queries only.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TS&lt;/strong&gt;: TypeScript type definitions have been brought into this module and no longer needs to be referenced from DefinitelyTyped&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For information on upgrading the plugin, visit the &lt;a href="https://nxtend.dev/docs/nxtend/upgrades"&gt;nxtend upgrades documentation&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ionic</category>
      <category>react</category>
      <category>nx</category>
      <category>webdev</category>
    </item>
    <item>
      <title>@nxtend/ionic-react 3.0.3</title>
      <dc:creator>Devin Shoemaker</dc:creator>
      <pubDate>Fri, 17 Jul 2020 03:13:08 +0000</pubDate>
      <link>https://dev.to/devinshoemaker/nxtend-ionic-react-3-0-3-10ae</link>
      <guid>https://dev.to/devinshoemaker/nxtend-ionic-react-3-0-3-10ae</guid>
      <description>&lt;p&gt;This version of the &lt;code&gt;@nxtend/ionic-react&lt;/code&gt; plugin includes a few quality of life improvements regarding dependency management.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bug Fixes
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;add &lt;code&gt;@nrwl/react&lt;/code&gt; version based on the users Nx version&lt;/li&gt;
&lt;li&gt;don't unnecessarily add &lt;code&gt;@nxtend/ionic-react&lt;/code&gt; dependency in &lt;code&gt;init&lt;/code&gt; schematic&lt;/li&gt;
&lt;li&gt;add &lt;code&gt;@nxtend/capacitor&lt;/code&gt; 1.0.0 instead of &lt;code&gt;*&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Previously, &lt;code&gt;@nxtend/ionic-react&lt;/code&gt; would add the latest version of &lt;code&gt;@nrwl/react&lt;/code&gt; to the users &lt;code&gt;package.json&lt;/code&gt; which could cause issues if the user was using an older version of Nx. Now, the plugin will look at the users local version of Nx and will install the same version of &lt;code&gt;@nrwl/react&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;An update has also been made that avoids adding &lt;code&gt;@nxtend/ionic-react&lt;/code&gt; unnecessarily when using &lt;code&gt;ng add&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Finally, the plugin will install version 1.0.0 of &lt;code&gt;@nxtend/capacitor&lt;/code&gt; instead of version &lt;code&gt;*&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;For information on upgrading the plugin, visit the &lt;a href="https://nxtend.dev/docs/nxtend/upgrades"&gt;nxtend upgrades documentation&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ionic</category>
      <category>react</category>
      <category>nx</category>
      <category>webdev</category>
    </item>
    <item>
      <title>@nxtend/ionic-react 3.0.2</title>
      <dc:creator>Devin Shoemaker</dc:creator>
      <pubDate>Sat, 11 Jul 2020 18:07:20 +0000</pubDate>
      <link>https://dev.to/devinshoemaker/nxtend-ionic-react-3-0-2-4cl8</link>
      <guid>https://dev.to/devinshoemaker/nxtend-ionic-react-3-0-2-4cl8</guid>
      <description>&lt;p&gt;This is a minor update to fix a bug where the user was forced to manually install the &lt;code&gt;@nxtend/capacitor&lt;/code&gt; plugin before generating an application with &lt;code&gt;@nxtend/ionic-react&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bug Fixes
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;properly initialize Capacitor plugin&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The &lt;code&gt;@nxtend/capacitor&lt;/code&gt; plugin was not being initialized properly with the &lt;code&gt;@nxtend/ionic-react:init&lt;/code&gt; schematic. This resulted in an error being thrown if an Ionic React application was attempted to be generated if &lt;code&gt;@nxtend/capacitor&lt;/code&gt; had not been added to the users workspace manually.&lt;/p&gt;

&lt;p&gt;This change ensures that the &lt;code&gt;@nxtend/capacitor&lt;/code&gt; plugin is added to the users &lt;code&gt;package.json&lt;/code&gt; and is initialized before generating an application with Capacitor enabled.&lt;/p&gt;

&lt;p&gt;Unit and e2e tests have also been added to ensure this functionality doesn't break in the future.&lt;/p&gt;

&lt;p&gt;For information on upgrading the plugin, visit the &lt;a href="https://nxtend.dev/docs/nxtend/upgrades"&gt;nxtend upgrades documentation&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ionic</category>
      <category>react</category>
      <category>nx</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Nx Brings High-Quality CLI Tooling to React</title>
      <dc:creator>Devin Shoemaker</dc:creator>
      <pubDate>Mon, 06 Jul 2020 20:30:33 +0000</pubDate>
      <link>https://dev.to/devinshoemaker/nx-brings-high-quality-cli-tooling-to-react-1801</link>
      <guid>https://dev.to/devinshoemaker/nx-brings-high-quality-cli-tooling-to-react-1801</guid>
      <description>&lt;p&gt;I have been a fan of both Angular and React for a while now. I think both options have their strenghths and weaknesses, but one of the things that I (and many others) like most about Angular is its CLI. If you've never used Angular, then you probably don't know what you're missing. And if you've used Angular in the past then you likely miss the power that the CLI offers. While Nx offers many benefits beyond this, one of my favorite features is that it brings the power of the Angular CLI to React and other frameworks through plugins.&lt;/p&gt;

&lt;p&gt;For those unfamiliar with the Angular CLI, it can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Generate new applications&lt;/li&gt;
&lt;li&gt;Generate new components and other pieces of code in a consistent manner with &lt;a href="https://angular.io/guide/schematics-authoring"&gt;schematics&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Unify serve, test, lint, etc., commands with &lt;a href="https://angular.io/guide/cli-builder"&gt;builders&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Update dependencies and files with migrations&lt;/li&gt;
&lt;li&gt;Be extended with third-party libraries that integrate with the CLI&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The Nx CLI uses the same technology and helps bring these features to any framework supported by first or third-party plugins. Here are a few things that you can generate with the standard &lt;a href="https://nx.dev/react/plugins/react/overview"&gt;&lt;code&gt;@nrwl/react&lt;/code&gt;&lt;/a&gt; plugin for Nx:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Application&lt;/li&gt;
&lt;li&gt;Component&lt;/li&gt;
&lt;li&gt;Library&lt;/li&gt;
&lt;li&gt;Redux slice&lt;/li&gt;
&lt;li&gt;Storybook configuration&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;While these things may seem trivial, the reduced copy and paste can go a long way, and defaults for these commands can be set in the Nx &lt;code&gt;workspace.json&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Nx was originally developed for Angular, but over time it has embraced React and other frameworks in an agnostic way and I highly recommend React developers look at this technology for their next project. If you're interested in learning more then I suggest following the official &lt;a href="https://nx.dev/react/tutorial/01-create-application"&gt;Nx React tutorial&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;An important thing to note is that Nx is not a framework and does not intend to be one. In fact, Nx currently supports both create-react-app style applications with the &lt;code&gt;@nrwl/react&lt;/code&gt; plugin, as well as Next.js and Gatsby with &lt;code&gt;@nrwl/next&lt;/code&gt; and &lt;code&gt;@nrwl/gatsby&lt;/code&gt; respectively.&lt;/p&gt;

</description>
      <category>nx</category>
      <category>react</category>
      <category>monorepo</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Build Cross-Platform Applications in a Monorepo with Nx, Ionic, and Capacitor</title>
      <dc:creator>Devin Shoemaker</dc:creator>
      <pubDate>Mon, 06 Jul 2020 00:42:55 +0000</pubDate>
      <link>https://dev.to/devinshoemaker/build-cross-platform-applications-in-a-monorepo-with-nx-ionic-and-capacitor-6f8</link>
      <guid>https://dev.to/devinshoemaker/build-cross-platform-applications-in-a-monorepo-with-nx-ionic-and-capacitor-6f8</guid>
      <description>&lt;h1&gt;
  
  
  Background and Motivation
&lt;/h1&gt;

&lt;p&gt;A few months ago I released an Ionic React plugin for Nx. While I really enjoy using Ionic for its comprehensive component library, the project is not nearly as complete without Capacitor.&lt;/p&gt;

&lt;p&gt;Capacitor is developed by the Ionic team but it does not require an Ionic project. Capacitor is framework agnostic and should work with any app in an Nx workspace. If you would like to learn more about Capacitor then I suggest you check out the &lt;a href="https://capacitor.ionicframework.com/docs/"&gt;official documentation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;@nxtend/ionic-react&lt;/code&gt; enabled developers to create web apps that &lt;em&gt;looked&lt;/em&gt; native, &lt;code&gt;@nxtend/capacitor&lt;/code&gt; enables developers to compile their web apps to a native platform such as iOS and Android.&lt;/p&gt;

&lt;h1&gt;
  
  
  Usage
&lt;/h1&gt;

&lt;p&gt;While the officially Capacitor CLI does not work well with an Nx workspace, I have tried to match the functionality with the plugin as much as possible.&lt;/p&gt;

&lt;h2&gt;
  
  
  Generate Ionic React App with Capacitor
&lt;/h2&gt;

&lt;p&gt;First, you need to initialize the &lt;code&gt;@nxtend/ionic-react&lt;/code&gt; plugin:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Angular CLI
ng add @nxtend/ionic-react
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Nx CLI

# npm
npm install --save-dev --exact @nxtend/ionic-react

# yarn
yarn add --save-dev --exact @nxtend/ionic-react

nx generate @nxtend/ionic-react:init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the plugin has been added to your Nx workspace you can generate an Ionic React application with Capacitor:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nx generate @nxtend/ionic-react:application {Ionic React application name} --capacitor true

nx generate @nxtend/ionic-react:application mobile-app --capacitor true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;@nxtend/capacitor&lt;/code&gt; plugin will be added to your workspace and a Capacitor project will be automatically generated with a new &lt;code&gt;@nxtend/ionic-react&lt;/code&gt; application if you do not specity the &lt;code&gt;--capacitor&lt;/code&gt; flag. However, you can alsoadd Capacitor to an existing project.&lt;/p&gt;

&lt;h2&gt;
  
  
  Add Capacitor to Existing Project
&lt;/h2&gt;

&lt;p&gt;First, you need to initialize the &lt;code&gt;@nxtend/capacitor&lt;/code&gt; plugin:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Angular CLI
ng add @nxtend/capacitor
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Nx CLI

# npm
npm install --save-dev --exact @nxtend/capacitor

# yarn
yarn add --save-dev --exact @nxtend/capacitor

nx generate @nxtend/capacitor:init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the plugin has been added to your Nx workspace you can generate a Capacitor project from an existing frontend project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nx generate @nxtend/capacitor:capacitor-project {Capacitor project name} --project {frontend project name}

nx generate @nxtend/capacitor:capacitor-project mobile-app-cap --project mobile-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Add Native Platforms
&lt;/h2&gt;

&lt;p&gt;Now that a Capacitor project has been added to your Nx workspace you can begin adding support for native platforms. Currently, Capacitor supports Android and iOS with Electron support being in beta.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nx run {Capacitor project name}:add --platform {native platform}

nx run mobile-app-cap:add --platform android
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Sync Native Platform
&lt;/h2&gt;

&lt;p&gt;Running the sync command will update the native platform dependencies and copy a build of your frontend project to the Capacitor project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nx run {Capacitor project name}:sync --platform {native platform}

nx run mobile-app-cap:sync --platform android
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Open Native Platform
&lt;/h2&gt;

&lt;p&gt;Finally, you can open the native platform:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nx run {Capacitor project name}:open --platform {native platform}

nx run mobile-app-cap:open --platform android
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;The &lt;code&gt;@nxtend/capacitor&lt;/code&gt; plugin enables any project in an Nx workspace to be compiled to a native platform. Combined with &lt;code&gt;@nxtend/ionic-react&lt;/code&gt; you can create high-quality cross-platform applications in an Nx monorepo.&lt;/p&gt;

&lt;p&gt;I highly recommend looking at the &lt;a href="https://capacitor.ionicframework.com/docs/"&gt;official Capacitor documentation&lt;/a&gt; for more information.&lt;/p&gt;

&lt;h1&gt;
  
  
  Resources
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://ionicframework.com/docs"&gt;Ionic Framework&lt;/a&gt;&lt;br&gt;
&lt;a href="https://capacitor.ionicframework.com/docs/"&gt;Capacitor&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/devinshoemaker/nxtend/tree/master/libs/ionic-react"&gt;@nxtend/ionic-react&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/devinshoemaker/nxtend/tree/master/libs/capacitor"&gt;@nxtend/capacitor&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ionic</category>
      <category>capacitor</category>
      <category>nx</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
