<?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: Ronan Connolly 🛠</title>
    <description>The latest articles on DEV Community by Ronan Connolly 🛠 (@ronancodes).</description>
    <link>https://dev.to/ronancodes</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%2F128167%2Ffb0ba895-ef74-4069-bf05-29de40c894a9.png</url>
      <title>DEV Community: Ronan Connolly 🛠</title>
      <link>https://dev.to/ronancodes</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ronancodes"/>
    <language>en</language>
    <item>
      <title>Why NX == Modern Web Development</title>
      <dc:creator>Ronan Connolly 🛠</dc:creator>
      <pubDate>Fri, 20 Aug 2021 10:23:44 +0000</pubDate>
      <link>https://dev.to/ronancodes/why-nx-modern-web-development-2fjl</link>
      <guid>https://dev.to/ronancodes/why-nx-modern-web-development-2fjl</guid>
      <description>&lt;p&gt;I am in the process of setting up a Monorepo which will contain many large apps and libs, and I've absolutely fallen in love with NX.&lt;/p&gt;

&lt;p&gt;I've done a lot of research into NX the past few weeks and here's what I've found.&lt;/p&gt;

&lt;h2&gt;
  
  
  The benefits I see in migrating to Nx:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Upgrading Angular&lt;/strong&gt; -- The "nx migrate" commands from reading, seems to make upgrading your version of Angular much easier by letting you complete the migration in a multi-step way instead of all at once: &lt;a href="https://nx.dev/latest/angular/core-concepts/updating-nx"&gt;https://nx.dev/latest/angular/core-concepts/updating-nx&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Another benefit here is that you can upgrade all your libraries/apps at the same time, rather than having some lib fall behind a version of two of Angular, or managing getting all the repos upgraded separately, then linking them and finding more issues you need to resolve due to the upgrade.&lt;/li&gt;
&lt;/ol&gt;


&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Only run commands on affected project with "nx affected"&lt;/strong&gt; -- Lets you auto test all libraries that have been affected by updating one library, on the pipeline this will be very handy as all affected libraries will auto build, and you can have your CD auto publish too.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Reduce redundant computations with the computational cache&lt;/strong&gt; -- is great at when you are constantly running nx affected test, build, etc commands you don't want to re-run the same tests when the code hasn't changed. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;The tags are great for enforcing code boundaries&lt;/strong&gt; -- You can make sure certain libs don't depend on other libs, especially great when you have lots of less UI focused people in the code base as they will get a Lint error instead of a big PR comment (after they've worked so hard on a feature).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;

&lt;p&gt;&lt;strong&gt;The mindset behind NX&lt;/strong&gt; -- In my mind NX equals modern Web development, as in they are always pushing for the latest and greatest technologies, tooling, and creating extra tooling to help remove redundant repetitive tasks, and this is the default! Just looking at the defaults you can see this: ESLint vs TSLint, Cypress vs Protractor, Jest vs Jasmine/Karma, Prettier set up for formatting.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Along the same lines, &lt;strong&gt;it helps you push your argument to use new modern technologies&lt;/strong&gt; --  As once people in your organisation can see the efficiency that NX provides they'll start to have confidence in it's defaults (rather than Angular's) and the plugins it provides (example: see how easy it is to add a storybook with NX, let's introduce Storybook to our project! is a much easier sell with NX already in the org). &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Same could be said for NGRX&lt;/strong&gt; and the tooling it adds to help with adding and setting it up.&lt;/li&gt;
&lt;/ol&gt;


&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Helps you create your own automation&lt;/strong&gt; --  by providing generators for creating generators (ng schematics)  and  executors (ng builders). NX makes it much easier to get started adding your own automation tooling (creating generators and executors).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;The Dep Graph is a wonderful way of viewing how your project dependencies are set up&lt;/strong&gt; -- The moment you create one manually it's out of date, so an auto generated one is very useful.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Encourages smaller more modular libraries &amp;amp; code reuse&lt;/strong&gt; -- which should result in smaller bundle sizes as you won't libraries depending on other large libraries that has lots of code that is not needed. This also speeds up all your commands as you are testing, and building smaller libs.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;NX Cloud allows you to share your cached command output across the team&lt;/strong&gt; -- reducing redundant computations, which will speed up commands. It also comes with a nice GitHub bot for displaying build information. I'm not using this feature but I have tested it and it's a pretty cool idea which works well.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Setting global rules&lt;/strong&gt; -- Example: setting the same ESLint rules across the project. Anytime I have to give a PR comment I consider adding a Lint rule to catch it so it's automated. I have a list of rules that I want in all my projects, it's been a pain adding them to every project. With a Monorepo I can add it once and all the projects have it. Another example is adding a Prettier pre commit hook, if you want to add it to all projects, that may be a lot of PRs.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Setting consistent standards&lt;/strong&gt; -- Similar to my previous point, it's easier for example to have all your prefixes be named in a similar manner when you can do the update all at once and see all projects easily in one place.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Explorability &amp;amp; learnability&lt;/strong&gt; -- Monorepos are fantastic for learning about how projects work and seeing patterns and strategies in action. Previously I would have all my apps and libs cloned down to a UI folder, I'd pull down their develop branch on all repos, then open that UI folder in VSCode, and do global searches to find examples. Monorepo removes this need as I have all the examples I need in one place. This is really useful for junior devs also.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;

&lt;p&gt;&lt;strong&gt;The VSCode NX Console plugin&lt;/strong&gt; -- is extremely useful in exploring all your CLI options for generating apps &amp;amp; libs, and running the different commands like build, test, serve affected libs/apps. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The &lt;strong&gt;auto dry run output makes it easy to understand&lt;/strong&gt; what CLI commands are being created before initiating the command.&lt;/li&gt;
&lt;/ol&gt;


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

&lt;p&gt;&lt;strong&gt;Migrating from an Angular project to an NX Workspace&lt;/strong&gt; -- is well documented and there is tooling available. I haven't kicked off the process of migrating but from looking at the docs it looks fairly straight forward to turn an Angular app into an NX workspace, and migrating libs into it.&lt;br&gt;
&lt;a href="https://nx.dev/latest/angular/migration/overview"&gt;https://nx.dev/latest/angular/migration/overview&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;This command will migrate your project to an NX project:
&lt;code&gt;ng add @nrwl/workspace&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;They have great steps on migrating projects into the Monorepo too:
&lt;a href="https://nx.dev/latest/angular/migration/overview#migrating-libraries"&gt;https://nx.dev/latest/angular/migration/overview#migrating-libraries&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;


&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;You can use NX even if you don't use Angular&lt;/strong&gt; -- It supports NestJS, React, and other frameworks too.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Foot Note
&lt;/h2&gt;

&lt;p&gt;This is my current outlook on it and I hope it doesn't change. I for one find that NX solves many problems and frustrations I've had working on a very large number of large apps and libs.&lt;/p&gt;

</description>
      <category>angular</category>
      <category>narwhal</category>
      <category>nx</category>
      <category>monorepo</category>
    </item>
    <item>
      <title>Code Review Checklist ✅</title>
      <dc:creator>Ronan Connolly 🛠</dc:creator>
      <pubDate>Wed, 21 Aug 2019 15:18:13 +0000</pubDate>
      <link>https://dev.to/ronancodes/code-review-checklist-2on3</link>
      <guid>https://dev.to/ronancodes/code-review-checklist-2on3</guid>
      <description>&lt;p&gt;CR (Code Review) checklists are a powerful tool.&lt;/p&gt;

&lt;p&gt;They allow you to organise your own thoughts &amp;amp; intuitions on what you look out for when reviewing other peoples code.&lt;br&gt;
Essentially they are a reflection from your point of view of what constitutes best practices, clean code, and good code quality.&lt;/p&gt;

&lt;p&gt;Everyone has a checklist, most don't write it down.&lt;br&gt;
By not writing it down it makes it hard to prioritise what's important.&lt;/p&gt;

&lt;h2&gt;
  
  
  ❓ What should my checklist include?
&lt;/h2&gt;

&lt;p&gt;Different people, teams, and organisations will have different items on their checklist, with their priority in differing orders, and the enforcement of each item at different levels.&lt;br&gt;
And all of these things will change over time, especially during when deadlines are close!&lt;/p&gt;

&lt;p&gt;Most of the time it's to do with code quality, design patterns, tests, formatting, and styles of programming.&lt;/p&gt;

&lt;h3&gt;
  
  
  My current CR checklist:
&lt;/h3&gt;

&lt;p&gt;Below is an example of a CR checklist; this is my current CR checklist (and will most likely look different in a weeks time! 👀).&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;No bugs are being introduced.&lt;/strong&gt;&lt;br&gt;
If you find a scenario where the new code may be introducing a bug.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Methods &amp;amp; Classes have a singular purpose.&lt;/strong&gt;&lt;br&gt;
Remember SRP (Single Responsibility Principle) from Uncle Bobs &lt;a href="https://en.wikipedia.org/wiki/SOLID"&gt;SOLID&lt;/a&gt; principles.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Names should be meaningful.&lt;/strong&gt;&lt;br&gt;
Classes, methods, and properties should have names that describe what they do.&lt;br&gt;
A method/class name should describe &lt;strong&gt;what&lt;/strong&gt; it does, and a comment may be added to explain the &lt;strong&gt;why&lt;/strong&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If you find yourself writing comments in your code, it may be a sign that you need to make the name more meaningful or break your method into multiple methods.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Naming should be consistent.&lt;/strong&gt;&lt;br&gt;
If you name one property: &lt;code&gt;personCount&lt;/code&gt;, don't name the next property: &lt;code&gt;countAnimal&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Follow current patterns.&lt;/strong&gt;&lt;br&gt;
Your project will develop certain patterns or ways of doing things over time.&lt;br&gt;
If you are breaking the pattern you should have a good reason for doing so.&lt;br&gt;
This is an example of a good time to self annotate your PR.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;All method logic paths are tested.&lt;/strong&gt;&lt;br&gt;
Make sure that every branch of logic is tested.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;There are some code coverage tools that will enforce this. If you are testing web components then trigger the method calls through the UI.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;HTML Template logic is tested.&lt;/strong&gt;&lt;br&gt;
Make sure to test the logic in the HTML template, such as showing/hiding elements.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Most of these assertions should be done when testing the method, but sometimes you will need a specific test for some HTML template binding.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Project style &amp;amp; formatting standards adhered to.&lt;/strong&gt;&lt;br&gt;
Having consistent code formatting matters.&lt;br&gt;
Imagine reading a book where the font-face, font-color, font-size, and line indentation was different in every paragraph.&lt;br&gt;
It would be difficult to read, and incredibly difficult to update (maintain) and find typos (bugs).&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This is often a good candidate for automation (The likes of &lt;a href="https://prettier.io/"&gt;Prettier&lt;/a&gt; and &lt;a href="https://palantir.github.io/tslint/"&gt;TSLint rules&lt;/a&gt; can help here).&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Add documentation to the required methods.&lt;/strong&gt;&lt;br&gt;
Some teams will require everything to have a method doc, others will require only public methods, and some will have it as optional for complex methods.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;You can automate this check and fail the build if certain methods are missing documentation. TSLint can help enforce JSDoc rules: &lt;a href="https://www.npmjs.com/package/tslint-jsdoc-rules"&gt;https://www.npmjs.com/package/tslint-jsdoc-rules&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Documentation is meaningful.&lt;/strong&gt;&lt;br&gt;
A method/class doc comment should be the &lt;strong&gt;why&lt;/strong&gt; not the &lt;strong&gt;what&lt;/strong&gt;.&lt;br&gt;
The method/class name should be self-descriptive, leaving the doc to be the &lt;strong&gt;why&lt;/strong&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Avoid this kind of &lt;strong&gt;what&lt;/strong&gt; doc: "The add method". Instead, state the why or don't add the doc at all.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  ⭐ Benefits of writing it down
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Prioritise important items.&lt;/strong&gt;&lt;br&gt;
By writing down what you look out for when reviewing code, it allows you to prioritize what's important.&lt;br&gt;
You may find that most CR comments are to do with formatting and styling issues; these types of comments may be at the bottom of your CR checklist and hence should either be less strict or should be ideally automated.&lt;br&gt;
During certain times in a project, delivery takes precedence over code quality and as such, you can be less strict on items lower down in the list.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Share the checklist with colleagues.&lt;/strong&gt;&lt;br&gt;
They may be missing items that you have and vice versa.&lt;br&gt;
They can give their view on why particular items should be at different priorities.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Gives confidence and passes on intuition to juniors.&lt;/strong&gt;&lt;br&gt;
Junior engineers won't have the intuition or experience to know what to look for when reviewing code, and often the case they won't review code or will just approve as they don't want to give an incorrect comment.&lt;br&gt;
By having a checklist it gives juniors the confidence to give CR comments.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  🤷 When to use the CR checklist
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;When reviewing other peoples code.&lt;/strong&gt;&lt;br&gt;
Instead of including all items in your initial look through each file, you could instead flick through the files checking for the top 5 items, and then flick through the files again with the next 5; this can help with really big PRs, or WIP (work in progress PRs); as they can become overwhelming.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;When writing your own code.&lt;/strong&gt;&lt;br&gt;
As you write your own code, always keep your CR checklist in mind; like a little code quality angel is watching over you.&lt;br&gt;
Ideally, you would print out your CR checklist and stick it up beside your monitor (👼 Angel doodle required).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;When you open your code for review.&lt;/strong&gt;&lt;br&gt;
Review your own code before sending it to others.&lt;br&gt;
Often you are in such a scramble to get your feature working and your tests complete, that you miss basic stuff.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

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

&lt;p&gt;This is my current CR checklist and it will most likely be different in a weeks time.&lt;/p&gt;

&lt;p&gt;Treat it like an ever-evolving document that reflects your vision of code quality.&lt;/p&gt;

&lt;h2&gt;
  
  
  💭 Thoughts
&lt;/h2&gt;

&lt;p&gt;What's on your checklist?&lt;br&gt;
Have I missed anything on my list that you think I should add?&lt;br&gt;
Do you disagree with the priority of my items?&lt;/p&gt;

&lt;p&gt;Please comment with your thoughts below! 🙃&lt;/p&gt;

</description>
      <category>codereview</category>
      <category>codequality</category>
      <category>cleancode</category>
      <category>bestpractices</category>
    </item>
    <item>
      <title>Why start a blog?</title>
      <dc:creator>Ronan Connolly 🛠</dc:creator>
      <pubDate>Sun, 18 Aug 2019 14:50:34 +0000</pubDate>
      <link>https://dev.to/ronancodes/why-start-a-blog-1dji</link>
      <guid>https://dev.to/ronancodes/why-start-a-blog-1dji</guid>
      <description>&lt;h2&gt;
  
  
  Previous attempts
&lt;/h2&gt;

&lt;p&gt;I've tried this blogging thing here and there over the years.&lt;br&gt;
Usually, I would end up blogging about a variety of things: food, nature, technology, poetry, etc.&lt;br&gt;
To be honest, this is probably why I didn't continue, it wasn't niche enough.&lt;/p&gt;

&lt;p&gt;Now that I've read enough blogs, I have a better idea of how to do my own.&lt;br&gt;
My niche is Front-End software development, and this is what I will be blogging about.&lt;/p&gt;

&lt;p&gt;I'll leave my business and finance knowledge to separate blogs if I wish to write articles on them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why create a blog?
&lt;/h2&gt;

&lt;p&gt;I want to use this blog as a learning tool. Everything I blog about will be something I've just learned.&lt;br&gt;
The great thing about this is that I'll be writing in a way that is beginner-friendly. Once a concept has clicked for me, I'll summarize my learnings for you to digest.&lt;/p&gt;

&lt;p&gt;As such there may be errors in my articles, and if there are and people point it out, that's great. I can then learn from my audience!&lt;/p&gt;

&lt;h2&gt;
  
  
  What to blog about?
&lt;/h2&gt;

&lt;p&gt;I'll be covering the niche of Front-End software engineering.&lt;br&gt;
This will cover:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Vanilla JS&lt;/li&gt;
&lt;li&gt;Angular &amp;amp; everything within (RxJS, TS, AgGrid, Sass, etc)&lt;/li&gt;
&lt;li&gt;Productivity tips&lt;/li&gt;
&lt;li&gt;Getting a job&lt;/li&gt;
&lt;li&gt;Digital nomadism&lt;/li&gt;
&lt;li&gt;Tools, techniques, and workflows&lt;/li&gt;
&lt;li&gt;UI Design&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Audience
&lt;/h2&gt;

&lt;p&gt;I'm aiming this at the Front-End community and will be sharing on Dev, Twitter, LinkedIn, and my personal site (&lt;a href="https://ronanconnolly.dev/blog"&gt;https://ronanconnolly.dev/blog&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;To be honest, I'm writing this for myself, and if others learn from it that's great!&lt;/p&gt;

&lt;p&gt;But I am very excited to see what this Dev.to community is all about ☺️&lt;/p&gt;

</description>
      <category>blog</category>
      <category>writing</category>
      <category>sharing</category>
      <category>community</category>
    </item>
  </channel>
</rss>
