<?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: Hadi Zare Irani</title>
    <description>The latest articles on DEV Community by Hadi Zare Irani (@hadi_zareirani_bbcf6991f).</description>
    <link>https://dev.to/hadi_zareirani_bbcf6991f</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%2F3530914%2F67bb01e7-d41e-444f-88de-3cd2d3c31ba1.jpeg</url>
      <title>DEV Community: Hadi Zare Irani</title>
      <link>https://dev.to/hadi_zareirani_bbcf6991f</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hadi_zareirani_bbcf6991f"/>
    <language>en</language>
    <item>
      <title>Decoupling Frontend Architectures: Nx + Private Registry Approach</title>
      <dc:creator>Hadi Zare Irani</dc:creator>
      <pubDate>Thu, 30 Oct 2025 06:27:44 +0000</pubDate>
      <link>https://dev.to/hadi_zareirani_bbcf6991f/decoupling-frontend-architectures-nx-private-registry-approach-3fg8</link>
      <guid>https://dev.to/hadi_zareirani_bbcf6991f/decoupling-frontend-architectures-nx-private-registry-approach-3fg8</guid>
      <description>&lt;p&gt;What do you know about &lt;a href="https://nx.dev/" rel="noopener noreferrer"&gt;Nx&lt;/a&gt;? Based on the introduction in the Nx documentation:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Nx is a powerful, open-source, technology-agnostic build platform designed to efficiently manage codebases of any scale.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Actually, you can implement a Monorepo platform, but that could be implemented as a micro-frontend platform based on the &lt;a href="https://module-federation.io/" rel="noopener noreferrer"&gt;Module Federation&lt;/a&gt; feature. So, I don't want to teach Nx this here. I’d like to share a real problem I faced in one of my projects.&lt;/p&gt;

&lt;p&gt;Imagine you have a project with a main dashboard and many small shared libraries and features. For example, you have a Layout with a Sidebar, a Navbar, a Settings page, and a Home page. These components are specific to this platform. Additionally, you have several shared features, including authentication, a Reports page, a User Settings page, and Design systems, among others.&lt;/p&gt;

&lt;p&gt;At first, you think about Monorepo architecture, and it's a good solution, but it's not enough. We have to use those shared features in several projects. Actually, we're not an online platform; we're a B2B platform, and we try to implement a platform for each customer.&lt;/p&gt;

&lt;p&gt;It was a technical challenge for me, and I had to solve this as a senior front-end developer. The core issue when mixing frameworks is Module Federation. While MF allows one framework (like Angular) to load a module built with another (like React), it still requires the module to be built in a way that the host can consume it, and often relies on sharing core dependencies. Let's check my approach.&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media2.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%2Fu0lju4s3i1vwtzzop15n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fu0lju4s3i1vwtzzop15n.png" alt="micro-frontend diagram" width="800" height="676"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h4&gt;
  
  
  My solution: Decoupled Build with a Private Registry
&lt;/h4&gt;

&lt;p&gt;I used a private package registry and Polyrepo to publish/consume internally within my company's network. Actually, this uses Nx's ability to manage projects independently.&lt;br&gt;
1- Separate Repositories for Frameworks&lt;/p&gt;

&lt;p&gt;I created a dedicated Nx workspace/repo for my main applications as a host, and a smaller Nx workspace for each micro-frontend module or shared library.&lt;/p&gt;

&lt;p&gt;2- Establish a Private Package Registry&lt;/p&gt;

&lt;p&gt;I was working on a secure app so that I couldn't use public services. I should set up a self-hosted, private NPM registry within my secured network. I found these two options:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://verdaccio.org/" rel="noopener noreferrer"&gt;Verdaccio&lt;/a&gt;: Lightweight, easy to set up.&lt;/li&gt;
&lt;li&gt;Nexus Repository OSS: Robust, enterprise-grade solution.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;3- Publish from Remote Repositories&lt;/p&gt;

&lt;p&gt;In each remote repository, I would configure the Nx build to not just create a Module Federation remote, but also bundle and publish the module as a deployable NPM package, because our host apps could be implemented with any frameworks and libraries.&lt;br&gt;
The host apps (Angular or React) only need to interact with the private registry:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// angular-host-app/package.json
"dependencies": {
  // ... other dependencies
  "@my-org/dashboard-feature": "1.0.0"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Updating dependencies is so simple, I just need to publish a new version (e.g., 2.0.0) from the remote repo to the private NPM registry (e.g., Verdaccio), and update the version in the host app's package.json.&lt;/p&gt;




&lt;p&gt;I used this solution 2 years ago; maybe we have many approaches to implement a platform like this now. I tried to explain my approach, and this article provides a comprehensive view. I didn't want to enter too technical explanations.&lt;/p&gt;

&lt;p&gt;If you’re a front-end developer dealing with multiple client projects or multi-framework setups, this approach might help you.&lt;/p&gt;

</description>
      <category>nx</category>
      <category>microfrontend</category>
      <category>frontendarchitecture</category>
      <category>devrel</category>
    </item>
    <item>
      <title>Do We Still Need SCSS?</title>
      <dc:creator>Hadi Zare Irani</dc:creator>
      <pubDate>Fri, 26 Sep 2025 09:47:05 +0000</pubDate>
      <link>https://dev.to/hadi_zareirani_bbcf6991f/do-we-still-need-scss-289n</link>
      <guid>https://dev.to/hadi_zareirani_bbcf6991f/do-we-still-need-scss-289n</guid>
      <description>&lt;p&gt;The CSS has had a lot of changes in the last few years. We don't create it like we did in 2010 or earlier. Browsers, Hardware, and tools have undergone big changes. Modern Frameworks showed up, and the Internet has become a popular tool in human society. We implement our apps for a lot of devices with different screen sizes, and they must work (in fact, it's a delicious headache). So, CSS is a part of our life as a Frontend developer. We tried writing CSS with a preprocessor like SCSS and LESS, because they follow the goal: &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Writing a clean CSS faster than before&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;But now I have a question: &lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Do We Still Need a Preprocessor like SCSS?
&lt;/h3&gt;

&lt;p&gt;&lt;br&gt;&lt;br&gt;
I have spent my time bringing an answer to this question, and I want to share it with you. Let’s break it down.&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  What Modern CSS Can Do
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Nesting: Native CSS nesting is here. SCSS is no longer the only way to write nested selectors.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fygcroxbi47gvjrjmzxkb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fygcroxbi47gvjrjmzxkb.png" alt="Nesting" width="800" height="485"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Variables (CSS Custom Properties): Unlike SCSS variables, CSS variables are dynamic at runtime.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Flzkn6th3uhh9d9b7xpqr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Flzkn6th3uhh9d9b7xpqr.png" alt="Variables (CSS Custom Properties)" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cascade Layers &amp;amp; &lt;a class="mentioned-user" href="https://dev.to/import"&gt;@import&lt;/a&gt; Replacement: This solves the “CSS specificity war” and makes imports more powerful than in SCSS.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fkyndlrv9gbwshjkpxxgm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fkyndlrv9gbwshjkpxxgm.png" alt="Cascade Layers" width="800" height="315"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Container Queries &amp;amp; Subgrid: Imagine you have a card component with an image, title, and description. You want the text layout to adapt based on the card’s width, not the whole page width.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fz6j1fqsqvmg0icfu9ydw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fz6j1fqsqvmg0icfu9ydw.png" alt="Container Queries &amp;amp; Subgrid" width="800" height="732"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Color Functions in CSS: &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;color-mix()&lt;/code&gt;: mix two colors.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;lab()&lt;/code&gt;, &lt;code&gt;lch()&lt;/code&gt;, &lt;code&gt;oklab()&lt;/code&gt;: define colors in perceptually uniform color spaces.&lt;/p&gt;

&lt;p&gt;Why this matters:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Easier to create accessible, harmonious color palettes.&lt;/li&gt;
&lt;li&gt;Colors look consistent across browsers and devices.&lt;/li&gt;
&lt;li&gt;You can dynamically adjust colors in CSS without a preprocessor (no SCSS needed).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F7o68qdm95s7e9a9pl2wl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F7o68qdm95s7e9a9pl2wl.png" alt="Color Functions" width="800" height="537"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Where SCSS Still Wins
&lt;/h2&gt;

&lt;p&gt;SCSS also has advantages, and they are so useful: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Mixin and Functions: You can write reusable logic with them, and they don't have in pure CSS&lt;/li&gt;
&lt;li&gt;You can split CSS into small, maintainable chunks. It makes file management easy.&lt;/li&gt;
&lt;li&gt;Loops, conditionals, and calculations are useful SCSS features.&lt;/li&gt;
&lt;/ul&gt;



&lt;h2&gt;
  
  
  My Take as a Frontend Dev
&lt;/h2&gt;

&lt;p&gt;Modern CSS can replace most of SCSS features, but SCSS is becoming more niche. We have a big problem here: &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Browsers support. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Browsers don't support some of the modern CSS features yet, and this creates a problem for large-scale, international, and enterprise projects. Because, all users don't update their Browsers, and we are facing different users and devices. We must anticipate and meet the needs of most users.&lt;/p&gt;

&lt;p&gt;After that, in the large-scale projects, we need to use advanced logic like loops or complex mixins. Maybe we can handle it with CSS, but SCSS has good support for doing them, and it's a fact.&lt;/p&gt;

&lt;p&gt;I don't say you must remove SCSS from your development life and implement your project with modern CSS, because:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;SCSS isn't dead.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Just like jQuery, still useful, but not the default choice anymore.&lt;/p&gt;

&lt;p&gt;What do you think? Are you still using SCSS, or have you moved fully to native CSS?&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>css</category>
      <category>scss</category>
      <category>frontend</category>
    </item>
  </channel>
</rss>
