<?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: Mirko Rapisarda</title>
    <description>The latest articles on DEV Community by Mirko Rapisarda (@mirkorap).</description>
    <link>https://dev.to/mirkorap</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%2F468367%2F0fc2be88-8bca-49c4-82fc-1d7b4c99d750.jpeg</url>
      <title>DEV Community: Mirko Rapisarda</title>
      <link>https://dev.to/mirkorap</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mirkorap"/>
    <language>en</language>
    <item>
      <title>Angular Tooling - How to equip before starting a project</title>
      <dc:creator>Mirko Rapisarda</dc:creator>
      <pubDate>Sun, 01 Aug 2021 07:49:34 +0000</pubDate>
      <link>https://dev.to/mirkorap/angular-tooling-how-to-equip-before-starting-a-project-1nj8</link>
      <guid>https://dev.to/mirkorap/angular-tooling-how-to-equip-before-starting-a-project-1nj8</guid>
      <description>&lt;p&gt;A few weeks have passed since the last article on &lt;a href="https://dev.to/mirkorap/how-to-get-the-most-out-of-angular-configuration-25p6"&gt;"How to get the most out of Angular configuration"&lt;/a&gt; and we were left with a promise: explore together the tools with which to "equip" before tackling an Angular project.&lt;br&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%2Fnwer2nbnm69gcbv1e05n.gif" 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%2Fnwer2nbnm69gcbv1e05n.gif" alt="Angular Tooling"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Angular DevTools
&lt;/h2&gt;

&lt;p&gt;Finally, as well as React and Vue, Angular also has its official DevTools, which installs as a simple Chrome extension and provides debugging and profiling capabilities for Angular applications. Once installed, the extension will appear in the "Developer Tools" and will consist of two tabs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Components:&lt;/strong&gt; allows you to view the structure of the components that make up the page and edit the status of the components.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Profiler:&lt;/strong&gt; allows you to profile the application and understand the performance bottlenecks in the change detection phase.
&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%2F4s052l48us46ggpx9s94.jpeg" alt="Angular DevTools"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Links
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://chrome.google.com/webstore/detail/angular-devtools/ienfalfjdbdpebioblfackkekamfmbnh" rel="noopener noreferrer"&gt;Angular DevTools Chrome Extension&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://angular.io/guide/devtools" rel="noopener noreferrer"&gt;Angular DevTools Documentation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Redux DevTools
&lt;/h2&gt;

&lt;p&gt;Another essential tool if you use Angular with NgRx for the application's state management is Redux DevTools. This tool is also installed as a Chrome extension and allows you to inspect changes in the application's Store while running. The screen appears divided into three sections:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Actions Inspector:&lt;/strong&gt; allows you to visualize the sequence of actions that are dispatched by the application. It is possible to filter and navigate within the list of actions, with the possibility of executing the "jump" to the state in which the application was in a given moment.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;State Inspector:&lt;/strong&gt; by clicking on the single action, through the appropriate buttons, it is possible to visualize: the detail of the dispatched action (type and payload), the current state of the store (in Tree, Chart, or Raw view), and the differences between the state of the store of the previous action and that of the selected action.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;State Recording Navigator:&lt;/strong&gt; allows you to "play", respecting the timeline of the dispatched actions, the changes made to the state of the store.
&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%2Fawv54glw7zp4l9it78uy.jpeg" alt="Redux DevTools"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Links
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://chrome.google.com/webstore/detail/redux-devtools/lmhkpmbekcpmknklioeibfkpmmfibljd" rel="noopener noreferrer"&gt;Redux DevTools Chrome Extension&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ngrx.io/guide/store-devtools" rel="noopener noreferrer"&gt;Redux DevTools Documentation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Compodoc
&lt;/h2&gt;

&lt;p&gt;Whenever developing an application or library that needs documentation, Compodoc is the right tool for you. This tool allows you to automatically generate the documentation of an Angular project through comments written. Compodoc also allows you to generate a mapping of the routes created and the creation of a navigation menu to navigate between the various components, guards, and interceptors… present within the application.&lt;br&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%2Fw5asmav3mwdudsjt17hu.gif" 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%2Fw5asmav3mwdudsjt17hu.gif" alt="Compodoc"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Installation
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Install the package via the command
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install - save-dev @compodoc/compodoc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Create the file &lt;em&gt;tsconfig.doc.json&lt;/em&gt; with the following configuration
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
 "include": ["src/**/*.ts"],
 "exclude": ["src/test.ts", "src/**/*.spec.ts", "src/app/file-to-exclude.ts"]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;In the &lt;em&gt;package.json&lt;/em&gt; add the script
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"compodoc": "npx compodoc -p tsconfig.doc.json"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Run the previous script to generate the documentation
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm run compodoc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Links
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://compodoc.app" rel="noopener noreferrer"&gt;Compodoc Documentation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Compodoc Dependency Graph (NGD)
&lt;/h2&gt;

&lt;p&gt;This tool, developed by the same authors of Compodoc, allows you to generate and view the dependencies tree of your Angular application. This helps us to have a clear idea of how modules, components, directives, pipes, etc are connected and dependent on each other.&lt;br&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%2Fpvun5bphkr8asyxibr2l.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%2Fpvun5bphkr8asyxibr2l.png" alt="Compodoc Dependency Graph (NGD)"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Installation
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Install the package via the command
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install -g @compodoc/ngd-cli
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;In the &lt;em&gt;package.json&lt;/em&gt; add the script
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"ngd": "npx ngd -p tsconfig.doc.json -o"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Run the previous script to generate the dependencies graph
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm run ngd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Links
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/compodoc/ngd" rel="noopener noreferrer"&gt;Compodoc NGD Documentation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Source Map Explorer
&lt;/h2&gt;

&lt;p&gt;As our codebase grows in size, you may begin to experience performance degradation upon initial application loading. This can be caused by several factors (and perhaps it would require a separate article), but one of the causes could be related to the installation of a large number of excessively "heavy" dependencies. Source Map Explorer allows you to view a map that indicates the size in bytes of each dependency installed within the application. In this way, we have a clear idea of which dependencies have an excessive impact on our codebase and consequently, we can evaluate to replace them with a "lighter" library.&lt;br&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%2Fjh93muupacxdrvoa6sq3.gif" 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%2Fjh93muupacxdrvoa6sq3.gif" alt="Source Map Explorer"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Installation
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Install the package via the command
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install - save-dev source-map-explorer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;In the &lt;em&gt;angular.json&lt;/em&gt; file edit the following configuration properties
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"sourceMap": true,
"namedChunks": true,
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Run the build command
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm run build
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;In the &lt;em&gt;package.json&lt;/em&gt; add the script
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"source-map-explorer": "source-map-explorer dist/your-angular-app-name/**/*.js"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Run the previous script to generate the source map graph
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm run source-map-explorer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Links
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/danvk/source-map-explorer#readme" rel="noopener noreferrer"&gt;Source Map Explorer Documentation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  VS Code Extensions
&lt;/h2&gt;

&lt;p&gt;If you are using Visual Studio Code as your code editor, installing the following extensions to improve productivity on Angular applications:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://marketplace.visualstudio.com/items?itemName=Angular.ng-template" rel="noopener noreferrer"&gt;&lt;strong&gt;Angular Language Service:&lt;/strong&gt;&lt;/a&gt; this extension provides great help when editing Angular templates through autocompletion, AOT diagnostic messages (remember to activate the strictTemplates option in the tsconfig.json file), and quick info.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://marketplace.visualstudio.com/items?itemName=johnpapa.Angular2" rel="noopener noreferrer"&gt;&lt;strong&gt;Angular Snippets:&lt;/strong&gt;&lt;/a&gt; this extension adds snippets to quickly generate: components, directives, guards, modules, pipes, etc.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://marketplace.visualstudio.com/items?itemName=DeepCode.deepcode" rel="noopener noreferrer"&gt;&lt;strong&gt;DeepCode:&lt;/strong&gt;&lt;/a&gt; DeepCode allows you to find bugs, vulnerabilities, and performance issues through a sophisticated AI-based system.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://marketplace.visualstudio.com/items?itemName=WallabyJs.quokka-vscode" rel="noopener noreferrer"&gt;&lt;strong&gt;Quokka.js:&lt;/strong&gt;&lt;/a&gt; Quokka.js is a developer productivity tool for rapid JavaScript / TypeScript prototyping. Runtime values are updated and displayed in your IDE next to your code, as you type.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusions
&lt;/h2&gt;

&lt;p&gt;Tackling an Angular project with the right tools can make a difference in the early stages of a project. In this article, we have introduced you to some of the tools that are part of the "toolbox" of each Devmy project. In the next Angular article, we will discuss one of the greatest allies of any good developer: ESLint and Prettier. We will see together how to configure them on Angular and how to migrate from TSLint to ESLint.&lt;/p&gt;

</description>
      <category>angular</category>
      <category>javascript</category>
      <category>tooling</category>
    </item>
    <item>
      <title>How to get the most out of Angular configuration</title>
      <dc:creator>Mirko Rapisarda</dc:creator>
      <pubDate>Wed, 12 May 2021 19:28:32 +0000</pubDate>
      <link>https://dev.to/mirkorap/how-to-get-the-most-out-of-angular-configuration-25p6</link>
      <guid>https://dev.to/mirkorap/how-to-get-the-most-out-of-angular-configuration-25p6</guid>
      <description>&lt;p&gt;The first time I approached front-end development in Angular I was a bit off guard, especially for those like me who come from a back-end environment (specifically PHP) and are used to using strong typing within their projects (also thanks to static analysis tools such as &lt;a href="https://github.com/vimeo/psalm"&gt;Psalm&lt;/a&gt; or &lt;a href="https://github.com/phpstan/phpstan"&gt;PHPStan&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;Working for a year now on the construction of projects in Angular, in fact, I could not help but notice that, although the framework uses TypeScript extensively, we often tend to leave it in “silent” mode, not fully exploiting the potential of the compiler.&lt;/p&gt;

&lt;p&gt;Even in the organization of the folders, I have often found a lot of confusion, with the tendency to insert too much logic in the components, when these should simply take care of taking the data and showing them by relegating the fetching of the data and the operations of manipulation of them, which do not concern necessarily the state of the components, to the services.&lt;/p&gt;

&lt;p&gt;These scenarios I witnessed led me to create a series of articles to shed light on some concepts of Angular and the best practices to be adopted to improve development on this framework. This first article will indicate some tips on getting the most out of Angular installation and TypeScript configuration.&lt;/p&gt;

&lt;h3&gt;
  
  
  Angular Strict Mode
&lt;/h3&gt;

&lt;p&gt;The first operation we can perform is to enable Angular &lt;strong&gt;strict mode&lt;/strong&gt; already during the installation phase, using the command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ng new [project-name] --strict
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This mode enables:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;strong&gt;strict mode&lt;/strong&gt; of TypeScript and other flags that we will analyze&lt;/li&gt;
&lt;li&gt;Enable the Angular flags: &lt;strong&gt;strictTemplates&lt;/strong&gt; and &lt;strong&gt;strictInjectionParameters&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Reduces the &lt;a href="https://web.dev/performance-budgets-with-the-angular-cli/"&gt;&lt;strong&gt;size of budgets&lt;/strong&gt;&lt;/a&gt; by ~75%&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  TypeScript Strict Mode
&lt;/h3&gt;

&lt;p&gt;Angular strict mode automatically enables the following TypeScript flags within the &lt;em&gt;tsconfig.json&lt;/em&gt; file. These could also be enabled by manually editing the TypeScript configuration file:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.typescriptlang.org/tsconfig/#strictPropertyInitialization"&gt;strictPropertyInitialization&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.typescriptlang.org/tsconfig#strictNullChecks"&gt;strictNullChecks&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.typescriptlang.org/tsconfig#noImplicitAny"&gt;noImplicitAny&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.typescriptlang.org/tsconfig#strictBindCallApply"&gt;strictBindCallApply&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.typescriptlang.org/tsconfig#strictFunctionTypes"&gt;strictFunctionTypes&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  strictPropertyInitialization
&lt;/h4&gt;

&lt;p&gt;This flag signals a compile error if the class properties are declared, but not initialized in the constructor. Therefore, the following code snippet would throw an error:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@Component({...})
class AppComponent {
  // Error: Property 'title' has no initializer
  @Input() title: string;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To fix it we can initialize the property in the constructor or during the declaration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@Component({...})
class AppComponent {
  @Input() title = '';
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  strictNullChecks
&lt;/h4&gt;

&lt;p&gt;This flag reports an error if we try to use &lt;em&gt;null&lt;/em&gt; or &lt;em&gt;undefined&lt;/em&gt; when we expect to receive a concrete value:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;interface Person {
    firstName: string;
    lastName: string;
    age: number;
}

// Error: Type 'null' is not assignable to type 'Person'
const developer: Person = null;

console.log(`${developer.firstName} ${developer.lastName}`);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  noImplicitAny
&lt;/h4&gt;

&lt;p&gt;This flag is my favorite because it allows an error to be reported if we leave &lt;em&gt;any&lt;/em&gt; type as an inferred implicit type. This does not mean that we can no longer use &lt;em&gt;any&lt;/em&gt; type (although I personally advise against its frequent use, because it makes the use of TypeScript useless), but that we simply have to explicitly specify the type (even if this is &lt;em&gt;any&lt;/em&gt;) in every property, parameter and variable declared.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@Component({...})
export class AppComponent {
  // Error: Parameter 'value' implicitly has an 'any' type
  onAddClick(value) {
    // Do stuff...
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To correct the error we can explicitly indicate the type any or indicate a more specific type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@Component({...})
export class AppComponent {
  onAddClick(value: Person) {
    // Do stuff...
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  strictBindCallApply
&lt;/h4&gt;

&lt;p&gt;This flag is a little more anonymous, in summary, it allows TypeScript to verify the correctness of the types passed as a parameter even a function is called via the &lt;em&gt;call&lt;/em&gt;, &lt;em&gt;bind&lt;/em&gt;, and &lt;em&gt;apply&lt;/em&gt; methods:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function toInt(x: string) {
  return parseInt(x);
}

const number1 = toInt.call(undefined, "10");

// Error: Argument of type 'boolean' is not assignable to
// parameter of type 'string'
const number2 = toInt.call(undefined, false);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  strictFunctionTypes
&lt;/h4&gt;

&lt;p&gt;This flag verifies that when assigning functions the parameters and return values are compatible with the subtypes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function log(x: string) {
  console.log(x.toLowerCase());
}

type StringOrNumberFunc = (ns: string | number) =&amp;gt; void;

// Error: Type '(x: string) =&amp;gt; void' is not assignable to type 'StringOrNumberFunc'
const func: StringOrNumberFunc = log;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There are three other options that, although they are not automatically enabled by setting Angular &lt;strong&gt;strict mode&lt;/strong&gt;, I highly recommend setting them manually:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.typescriptlang.org/tsconfig#noImplicitReturns"&gt;noImplicitReturns&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.typescriptlang.org/tsconfig#noUnusedLocals"&gt;noUnusedLocals&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.typescriptlang.org/tsconfig#noUnusedParameters"&gt;noUnusedParameters&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  noImplicitReturns
&lt;/h4&gt;

&lt;p&gt;This flag allows TypeScript to report an error if all paths to a function do not return a value:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Error: Not all code paths return a value
function lookupHeadphonesManufacturer(color: string) {
  if (color === 'blue') {
    return 'beats';
  }

  'bose';
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  noUnusedLocals
&lt;/h4&gt;

&lt;p&gt;This flag allows a TypeScript to report an error if a declared variable is not used:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Error: 'OnInit' is declared but its value is never read
import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss']
})
export class AppComponent {
  title: string = 'Devmy Example Project';

  // Error: 'subtitle' is declared but its value is never read
  private subtitle: string = 'Hello World';

  // Error: 'log' is declared but its value is never read
  private log(value: string): void {
    console.log(value);
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  noUnusedParameters
&lt;/h4&gt;

&lt;p&gt;This flag allows TypeScript to report an error if a function parameter is not used:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { Component } from '@angular/core';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss']
})
export class AppComponent {
  title: string = 'Devmy Example Project';

  // Error: 'value' is declared but its value is never read
  onOptionChange(value: number) {

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

&lt;/div&gt;



&lt;p&gt;If it’s mandatory to indicate the parameter, but it isn’t necessary to use it, we can simply tell TypeScript to ignore it by replacing or prefixing the parameter name with an underscore:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { Component } from '@angular/core';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss']
})
export class AppComponent {
  title: string = 'Devmy Example Project';

  onOptionChange(_value: number) {

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  Strict Angular Template
&lt;/h3&gt;

&lt;p&gt;By enabling Angular strict mode, these flags are also automatically activated:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://angular.io/guide/angular-compiler-options#stricttemplates"&gt;strictTemplates&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://angular.io/guide/angular-compiler-options#strictinjectionparameters"&gt;strictInjectionParameters&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  strictTemplates
&lt;/h4&gt;

&lt;p&gt;If enabled, Angular will check within the template files that type interface is complying:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// app.component.ts

interface User {
  firstName: string;
  lastName: string;
}

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss']
})
export class AppComponent {
  title: string = 'Devmy Example Project';
  users: User[] = [
    {
      firstName: 'Mario',
      lastName: 'Rossi'
    },
    {
      firstName: 'Maria',
      lastName: 'Rossi'
    },
    {
      firstName: 'Carlo',
      lastName: 'Rossi'
    }
  ];
}

// app.component.html

&amp;lt;div&amp;gt;
  &amp;lt;ul&amp;gt;
    &amp;lt;li *ngFor="let user of users"&amp;gt;
      &amp;lt;!-- Property 'age' does not exist on type 'User' --&amp;gt;
      {{ user.firstName }}-{{ user.lastName }}: {{ user.age }}
    &amp;lt;/li&amp;gt;
  &amp;lt;/ul&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  strictInjectionParameters
&lt;/h4&gt;

&lt;p&gt;If enabled, Angular will report an error if it is not possible to determine which type to inject for the parameter specified in the constructor.&lt;/p&gt;

&lt;h3&gt;
  
  
  Angular Bundle Budgets
&lt;/h3&gt;

&lt;p&gt;When running the build, the Angular application must respect the &lt;a href="https://angular.io/guide/build#configuring-size-budgets"&gt;maximum allowed budgets&lt;/a&gt;. If our application exceeds this size, the build will fail. This forces us to deploy performing applications without overly “heavy” dependencies.&lt;/p&gt;

&lt;p&gt;By default Angular has quite high budgets:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Up to a build size of 2MB, we will receive a simple warning, exceeding 5MB an error will be displayed during the build phase&lt;/li&gt;
&lt;li&gt;Up to a component style size of 6KB, we will receive a simple warning, exceeding 10KB you will get an error during the compilation phase&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By activating Angular strict mode, these budgets are reduced by ~ 75%, allowing us to immediately identify if we have introduced an excessively “heavy” dependency:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Up to a build size of 500KB, we will receive a simple warning, exceeding 1MB an error will be displayed during the build phase&lt;/li&gt;
&lt;li&gt;Up to a component style size of 2KB, we will receive a simple warning, exceeding 4KB you will get an error during the compilation phase&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To make sure we respect the size of budgets set we must:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use the &lt;a href="https://angular.io/guide/deployment#inspect-the-bundles"&gt;&lt;strong&gt;source-map-explorer&lt;/strong&gt;&lt;/a&gt; tool to inspect the impact of the dependencies installed within the application&lt;/li&gt;
&lt;li&gt;Use lazy-loading&lt;/li&gt;
&lt;li&gt;Avoid large imports into component styles&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Conclusions
&lt;/h3&gt;

&lt;p&gt;Although Angular strict mode may seem overly restrictive at first, I assure you that activating it will make your code more robust, less prone to bugs, and easier to update. From version 12 the Angular team has seen fit to make the strict mode as default mode, but, for pre-existing projects, it could be a godsend to go and activate the various flags!&lt;/p&gt;

&lt;p&gt;In the next article, I will talk about the recommended tools to speed up the development and use of Angular in everyday life 🤓&lt;/p&gt;

</description>
      <category>angular</category>
      <category>typescript</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Stilo -  A utility-first Flutter library for rapid UI development</title>
      <dc:creator>Mirko Rapisarda</dc:creator>
      <pubDate>Sun, 08 Nov 2020 15:04:42 +0000</pubDate>
      <link>https://dev.to/mirkorap/stilo-a-utility-first-flutter-framework-for-rapid-ui-development-1pp6</link>
      <guid>https://dev.to/mirkorap/stilo-a-utility-first-flutter-framework-for-rapid-ui-development-1pp6</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JBVEDRXH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/o59xe7rh4sq32zpy5sph.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JBVEDRXH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/o59xe7rh4sq32zpy5sph.jpeg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I started to study Dart and Flutter a couple of months ago because I've always been fascinated by mobile development, but my web background has always blocked me from approaching this different, but at the same time, similar world. Flutter gave me the possibility to approach mobile development in a very fast and easy way (and that's amazing for a lazy person like me 😆).&lt;/p&gt;

&lt;p&gt;When I started developing the first projects my "web mentality" asked myself: "How can I structure the style of my app (colors, spacings, borders, box shadows, font sizes, etc.) to avoid code duplication and speed up the development process? Why there isn't a Tailwind's like library?". These questions brought me to create &lt;strong&gt;Stilo, a utility-first Flutter library for rapid UI development.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Utility as first
&lt;/h2&gt;

&lt;p&gt;Stilo does not replace Flutter as framework, but it wraps Flutter classes to create a list of constants to deal with: &lt;strong&gt;borders, spacings, font sizes, widths, heights, box shadows, transforms, opacity, and much more…&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;But let's go to see some examples of Stilo's constants and how to use them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Examples
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. StiloBorderRadius
&lt;/h3&gt;

&lt;p&gt;This class defines constants to deal with border-radius (all, top, right, bottom, left, horizontal and vertical directions)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import 'package:stilo/stilo.dart';
Container(
  width: 200,
  height: 200,
  decoration: BoxDecoration(
    borderRadius: StiloBorderRadius.a4, // 6.0 radius all
    color: Colors.orange,
  ),
)
----------
Container(
  width: 200,
  height: 200,
  decoration: BoxDecoration(
    borderRadius: StiloBorderRadius.t5, // 9.0 radius top
    color: Colors.yellow,
  ),
)
---------
Container(
  width: 200,
  height: 200,
  decoration: BoxDecoration(
    borderRadius: StiloBorderRadius.be2, // 3.0 radius bottom-end
    color: Colors.orange,
  ),
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. StiloSpacing
&lt;/h3&gt;

&lt;p&gt;This class defines constants to deal with spacings&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import 'package:stilo/stilo.dart';
Column(
  children: &amp;lt;Widget&amp;gt;[
    Container(width: 200, height: 100, color: Colors.orange),
    StiloSpacing.y20, // space with 60.0 height
    Container(width: 200, height: 100, color: Colors.indigo),
  ],
)
------------
Column(
  children: &amp;lt;Widget&amp;gt;[
    Container(width: 200, height: 100, color: Colors.orange),
    StiloSpacing.x3, // space with 9.0 width
    Container(width: 200, height: 100, color: Colors.indigo),
  ],
),
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. StiloFontSize
&lt;/h3&gt;

&lt;p&gt;This class defines constants to deal with font sizes&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import 'package:stilo/stilo.dart';
Container(
  child: Text(
    'Hello World',
    style: TextStyle(fontSize: StiloFontSize.lg), // 13.5 font size
  ),
)
---------------
Container(
  child: Text(
    'Hello World',
    style: TextStyle(fontSize: StiloFontSize.xl5), // 36.0 font size
  ),
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  4. StiloLineHeight
&lt;/h3&gt;

&lt;p&gt;This class defines constants to deal with line heights&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import 'package:stilo/stilo.dart';
Container(
  child: Text(
    'Hello World',
    style: TextStyle(
      height: StiloLineHeight.tight, // 1.25 line height
    ),
  ),
)
---------------
Container(
  child: Text(
    'Hello World',
    style: TextStyle(
      height: StiloLineHeight.relaxed, // 1.625 line height
    ),
  ),
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  5. StiloWidth / StiloHeight
&lt;/h3&gt;

&lt;p&gt;These classes define constants to deal with widths and heights&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import 'package:stilo/stilo.dart';
Container(
  width: StiloWidth.w5, // 20.0 width
  height: StiloHeight.h5, // 20.0 height
  color: Colors.orange,
)
---------------
Container(
  width: StiloWidth.w48, // 192.0 width
  height: StiloHeight.h20, // 80.0 height
  color: Colors.orange,
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;These were just some of the constants that Stilo defines for you and, in upcoming releases, many more utility classes will be introduced to help you in the development process of your next app 😉&lt;/p&gt;

&lt;p&gt;To follow the project and suggest new features open an issue on &lt;a href="https://github.com/mirkorap/stilo"&gt;Github&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To install Stilo in your project use the &lt;a href="https://pub.dev/packages/stilo"&gt;pub package manager&lt;/a&gt;&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>mobile</category>
      <category>dart</category>
    </item>
  </channel>
</rss>
