<?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: Mohammed Taher</title>
    <description>The latest articles on DEV Community by Mohammed Taher (@justgeek).</description>
    <link>https://dev.to/justgeek</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%2F615148%2F0f243da6-2164-4402-953f-3e009afb1bb3.jpg</url>
      <title>DEV Community: Mohammed Taher</title>
      <link>https://dev.to/justgeek</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/justgeek"/>
    <language>en</language>
    <item>
      <title>[Boost]</title>
      <dc:creator>Mohammed Taher</dc:creator>
      <pubDate>Sat, 03 Jan 2026 22:16:45 +0000</pubDate>
      <link>https://dev.to/justgeek/-2hfe</link>
      <guid>https://dev.to/justgeek/-2hfe</guid>
      <description>&lt;p&gt;

&lt;/p&gt;
&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/justgeek/the-era-of-mechanical-horses-3dlm" class="crayons-story__hidden-navigation-link"&gt;The Era of Mechanical Horses&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/justgeek" class="crayons-avatar  crayons-avatar--l  "&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%2Fuser%2Fprofile_image%2F615148%2F0f243da6-2164-4402-953f-3e009afb1bb3.jpg" alt="justgeek profile" class="crayons-avatar__image"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/justgeek" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Mohammed Taher
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Mohammed Taher
                
              
              &lt;div id="story-author-preview-content-3141821" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/justgeek" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&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%2Fuser%2Fprofile_image%2F615148%2F0f243da6-2164-4402-953f-3e009afb1bb3.jpg" class="crayons-avatar__image" alt=""&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Mohammed Taher&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/justgeek/the-era-of-mechanical-horses-3dlm" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Jan 2&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/justgeek/the-era-of-mechanical-horses-3dlm" id="article-link-3141821"&gt;
          The Era of Mechanical Horses
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/ai"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;ai&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/softwaredevelopment"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;softwaredevelopment&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/lowcode"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;lowcode&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/futureofdevelopment"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;futureofdevelopment&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
            &lt;a href="https://dev.to/justgeek/the-era-of-mechanical-horses-3dlm#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              Comments


              &lt;span class="hidden s:inline"&gt;Add Comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            2 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;




</description>
      <category>ai</category>
      <category>softwaredevelopment</category>
      <category>lowcode</category>
      <category>futureofdevelopment</category>
    </item>
    <item>
      <title>The Era of Mechanical Horses</title>
      <dc:creator>Mohammed Taher</dc:creator>
      <pubDate>Fri, 02 Jan 2026 00:05:12 +0000</pubDate>
      <link>https://dev.to/justgeek/the-era-of-mechanical-horses-3dlm</link>
      <guid>https://dev.to/justgeek/the-era-of-mechanical-horses-3dlm</guid>
      <description>&lt;h2&gt;
  
  
  We’re Still Teaching AI to Build Faster Horses
&lt;/h2&gt;

&lt;p&gt;Scroll through any developer feed today and you’ll see the same debates repeating themselves:&lt;br&gt;
Will AI replace software engineers? Is AI-generated code safe or maintainable? Is “vibe coding” a bad practice?&lt;/p&gt;

&lt;p&gt;All of these discussions share a hidden assumption—that the way we build software today will stay fundamentally the same, just with AI assisting along the way.&lt;/p&gt;

&lt;p&gt;I think that assumption is wrong.&lt;/p&gt;

&lt;h2&gt;
  
  
  A quick look back at abstraction
&lt;/h2&gt;

&lt;p&gt;I started my software journey as an embedded systems engineer, writing code for microcontrollers. Before Embedded C—already considered a high-level language—I worked with assembly. In both cases, the end result was identical: hex code written into EEPROM, executing predefined logic on hardware.&lt;/p&gt;

&lt;p&gt;Later, as a side hobby, I worked with ActionScript (RIP Flash), which eventually helped me move into the JavaScript ecosystem and shift my career toward web development. That transition gave me a front-row seat to how quickly “high-level” changes over time.&lt;/p&gt;

&lt;p&gt;During the rise of HTML5 and Web 2.0, JavaScript development evolved rapidly. jQuery simplified DOM manipulation. Frameworks like Angular and Meteor raised the abstraction even further. Node.js brought JavaScript to the server, and bundlers like Webpack, Parcel, and later Vite automated more and more of the complexity.&lt;/p&gt;

&lt;p&gt;Yet through all of these changes, one thing remained constant: the output was still plain JavaScript, HTML, and CSS. We didn’t remove layers—we kept stacking new ones on top of the old ones.&lt;/p&gt;

&lt;h2&gt;
  
  
  AI as a mechanical horse
&lt;/h2&gt;

&lt;p&gt;Imagine a horse pulling a cart. When humans first invent an engine, the most natural idea isn’t to build a car—it’s to replace the biological horse with a mechanical one. Same cart, same mental model, just powered differently. Only later does the real leap happen.&lt;/p&gt;

&lt;p&gt;This is exactly how we’re using AI today.&lt;/p&gt;

&lt;p&gt;Most AI tools focus on writing React components, generating boilerplate, or refactoring existing code. In other words, AI is acting as a mechanical horse—doing the same job in the same system, just faster.&lt;/p&gt;

&lt;p&gt;That’s useful, but it’s not the real disruption.&lt;/p&gt;

&lt;h2&gt;
  
  
  The leap we’re not talking about
&lt;/h2&gt;

&lt;p&gt;Throughout the history of software, we’ve relied on abstraction layers to bridge the gap between human intent and machine execution. Readable, maintainable code exists primarily for humans—not for machines.&lt;/p&gt;

&lt;p&gt;So the real question isn’t whether AI can write better React code.&lt;/p&gt;

&lt;p&gt;The real question is: &lt;em&gt;what happens when AI no longer needs our abstractions at all?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Instead of asking AI to write React, we could ask it to generate the final executable logic directly—the lowest-level representation that satisfies our intent. Frameworks, languages, and even code structure become implementation details rather than primary artifacts.&lt;/p&gt;

&lt;p&gt;When that happens, yesterday’s “high-level” tools will become today’s low-level plumbing.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this means for developers
&lt;/h2&gt;

&lt;p&gt;This shift won’t eliminate software engineers, but it will change what software engineering looks like. The focus moves away from writing code line by line and toward defining goals, constraints, behavior, and outcomes.&lt;/p&gt;

&lt;p&gt;In that world, programming becomes less about syntax and more about intent.&lt;/p&gt;

&lt;p&gt;Most AI discussions today are still about faster horses.&lt;br&gt;
But the era of evolving into cars is not far.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>softwaredevelopment</category>
      <category>lowcode</category>
      <category>futureofdevelopment</category>
    </item>
    <item>
      <title>[Engineering] How to build a scalable design system</title>
      <dc:creator>Mohammed Taher</dc:creator>
      <pubDate>Fri, 28 Apr 2023 12:20:57 +0000</pubDate>
      <link>https://dev.to/justgeek/engineering-how-to-build-a-scalable-design-system-3inm</link>
      <guid>https://dev.to/justgeek/engineering-how-to-build-a-scalable-design-system-3inm</guid>
      <description>&lt;p&gt;&lt;a href="https://bradfrost.com/blog/post/atomic-web-design/" rel="noopener noreferrer"&gt;Atomic design&lt;/a&gt; was a blog article written in 2013 by &lt;a href="https://bradfrost.com/" rel="noopener noreferrer"&gt;Bradfrost&lt;/a&gt; discussing how to make proper design in a reusable and modular way, and even there is a &lt;a href="https://atomicdesign.bradfrost.com/" rel="noopener noreferrer"&gt;book&lt;/a&gt; published for it, and the content itself is much refined from the very early blog article that was written.&lt;/p&gt;

&lt;p&gt;Brad has not really invented something new, but what he did was frameworking what I see as common sense for mature UI designers, which is divide and conquer.&lt;/p&gt;

&lt;p&gt;Actually &lt;a href="https://en.wikipedia.org/wiki/Divide-and-conquer_algorithm" rel="noopener noreferrer"&gt;divide and conquer&lt;/a&gt; is not only applicable for solving design issues, but works with any big issue where you need to break it down to smaller issues/chunks that can be easily solved&lt;/p&gt;

&lt;p&gt;To my surprise, I have not really found really something similar on the Engineering side, maybe something like &lt;a href="https://bit.dev/" rel="noopener noreferrer"&gt;bit.dev&lt;/a&gt; is awesome, but it is not really about making an atomic design system, it is more like a modular framework any project, and their smallest unit is a component, but if we could say that component itself can be broken down to a more granular level&lt;/p&gt;

&lt;p&gt;The Atomic Architecture Framework, which we will discuss in this article, is simply a set of rules which define how to manage the whole process of building a scalable design system in the most efficient way (from Engineering perspective), and also covers all common parts between Design, and Engineering&lt;/p&gt;

&lt;p&gt;We can start by some definitions:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Atom:&lt;/strong&gt; &lt;br&gt;
The most broken down unit in the system, if it can be broken down more, then it is not atom. Single responsibility item&lt;br&gt;
Props (if necessary) should be as primitive as possible, this means deep nested objects, or complicated arrays are not allowed as props (unless necessary)&lt;br&gt;
Root tag is always custom and should match atom name&lt;br&gt;
Semantic HTML should be always followed when possible&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Molecule:&lt;/strong&gt; A group of atoms to serve a repetitive purpose. A molecule is consisted of multiple atoms, molecules, or both together&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Element:&lt;/strong&gt; Exposed component that groups molecules, and atoms to feature Engineers. It can offer complicated models &amp;amp; props. It&lt;br&gt;
Should reuse molecules/atoms as much as possible&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Block:&lt;/strong&gt; Block is a reusable piece of complicated Group, so for example user profile card where we render avatar, and some social profile icons with links, and maybe a button to message that user, follow, or block .. etc&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Page:&lt;/strong&gt; Page in frontend world corresponds to a single route, and a single page can render multiple fragments, or pieces of UI, and these pieces can be anything from defined above&lt;/p&gt;

&lt;p&gt;and then we can define some rules:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Layering: The idea behind the breakdown above is to separate internal concerns from external concerns. Think of it as OOP private and public class methods, where you can only expose what you need to, via public props, or methods, and the rest is kept internal, so we guarantee a consistent contract, so no breaking changes at all. However we may want to introduce breaking changes, and that will be covered in versioning rule. The internal layers are simply atoms, and molecules (private for core team working on design system), while the external layers Element, Block, and Page are usually exposed to be used by our feature Engineers (for example)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;One to One Map: The rule above will lead us to another rule which is 1:1 map, and this means that sometimes we may want to use an atom, or molecule as element, so you may find yourself in a situation where you just expose it ...&lt;/p&gt;&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%2Fse2mg18gbl9dq4ksn0yn.gif" 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%2Fse2mg18gbl9dq4ksn0yn.gif" alt=" " width="498" height="280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Just because the same exact functionality is required in the present time, doesn't necessarily mean that we expose our internal components, and the reason for that is; in future you may want to extend (or remove) some props from some atom because some element requires so, and then you will end up with a pile of unnecessary (or optional) props which really pollutes your code&lt;/p&gt;

&lt;p&gt;We need to keep our code clean and separate the concern of atom, or a molecule, from the concern of higher level layers, and this means that even you are in a situation when you need to clone an atom (e.g. checkbox atom), it is totally fine to map at as 1:1 with checkbox element&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Props vs Classes: This part is little bit tricky as it is always hard to decide if you should apply visuals via props, or classes, so for example we need to apply background color to some button, should we then create a class with background color inherited from some token (css variable), or should we expose a color prop where Engineers can change it?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There is no right, or wrong answer to this really, but there is a decision that can be made based on use case, to explain this in a simple way, lets assume we have a checkbox (again) that has some brand color matching our design system (assuming dark blue), and for some reason we want our Engineers to change the checkbox color (border or background) to red when used inside an invalid form&lt;/p&gt;

&lt;p&gt;In this case we need a way to inform our Engineers that they can customize background color based on some condition, and for that reason a prop would make perfect sense, on the other hand imagine we need to change some background color of an atom, but for some internal reason (e.g. blur, or focus), which is already predefined in our design system, then it would make perfect sense to apply this via a shared class&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Development strategy&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Convenience:
Design system, like any project needs to be well planned before executed, and for this reason, it might be helpful for the team working on it, to brainstorm together what needs to be done before writing any code&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A nice way to plan the development of any component, is to think about possbile props, and methods in the way that is most convenient for consumers, and this process may require many iterations, and feedback before reaching a stable and satisfying state&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Consistency:
Using code generators to generate components from pre-defined templates, is another great way to develop a design system, with great velocity, and consistency.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Using generators doesn't only help Engineers to focus on details,  forget about infrastructure (like naming conventions, testing ..etc), but is also very useful in case we need to do some patching for our components in the future to improve certain parts (overtime you may find out better solutions to old problems)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Publish&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Preview:
Most common way to preview a design system in modern time is storybook. There are too many alternatives like styleguidist, or patternlab, but based on personal experience storybook is the most robust, customizable, and scalable way to communicate our design system with external world&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One little issue we had was to preview our internal components (e.g. Atoms, or Molecules) separately from elements, and for that we had to create what we call playground&lt;/p&gt;

&lt;p&gt;A playground can be another storybook instance, or even a custom preview component, that help design system Engineers to preview, and visually test their components&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Versioning:
Versioning is a very nice concept, specially when it comes to make sure new changes to our components don't break a stable version that is for example already used in production&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Using something like &lt;a href="https://bit.dev/" rel="noopener noreferrer"&gt;bit.dev&lt;/a&gt; can be very handy for managing versions of our components, and we leave it up to our consumer to decide when they want to upgrade&lt;/p&gt;

</description>
      <category>design</category>
      <category>designsystem</category>
      <category>storybook</category>
    </item>
    <item>
      <title>Debug Ionic Application (NGRX) using Redux remote dev tools</title>
      <dc:creator>Mohammed Taher</dc:creator>
      <pubDate>Fri, 17 Feb 2023 02:11:57 +0000</pubDate>
      <link>https://dev.to/justgeek/debug-ionic-application-ngrx-using-redux-remote-dev-tools-4k1j</link>
      <guid>https://dev.to/justgeek/debug-ionic-application-ngrx-using-redux-remote-dev-tools-4k1j</guid>
      <description>&lt;p&gt;Recently I was working on Ionic app that was built with Angular. The application uses NGRX for state management. I wanted to debug the state (i.e inspect actions, and state ..etc) while application is running on emulator. I expected that by simply running redux dev tools from chrome that it will magically work out of the box, and straight away, but unfortunately this was not the case.&lt;/p&gt;

&lt;p&gt;Looking around for sometime I stumbled upon a precious &lt;a href="https://medium.com/nextfaze/remote-debugging-ngrx-store-with-ionic-74e367316193" rel="noopener noreferrer"&gt;article&lt;/a&gt; that was explaining how to put everything together.&lt;/p&gt;

&lt;p&gt;Unfortunately the article is outdated, but through some further search and playing around, I managed to make everything work.&lt;/p&gt;

&lt;p&gt;I thought to share details here to help anyone who might be looking for a solution to same exact issue.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Step 1:&lt;br&gt;
install &lt;a href="https://ngrx.io/guide/store-devtools/install" rel="noopener noreferrer"&gt;NGRX store dev tools&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Step 2:&lt;br&gt;
Create 2 files to handle connection between your application and Redux remote dev tool&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;File1: &lt;br&gt;
&lt;code&gt;remote-devtools-connection.ts&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;import { ReduxDevtoolsExtensionConnection } from '@ngrx/store-devtools/src/extension'

export class RemoteDevToolsConnectionProxy implements ReduxDevtoolsExtensionConnection {
  constructor(public remotedev: any, public instanceId: string) {}
  init(state?: any): void {
    console.log('Socket was initiated', state)
  }
  error(anyErr: any): void {
    console.error('Socket Error', anyErr)
  }

  subscribe(listener: (change: any) =&amp;gt; void): any {
    const listenerWrapper = (change: any) =&amp;gt; {
      listener(change)
    }

    this.remotedev.subscribe(listenerWrapper)
    // Hack fix for commit/time-travelling etc. if the devtools are already open
    setTimeout(() =&amp;gt; listenerWrapper({ type: 'START' }))
  }

  unsubscribe(): any {
    // HACK fix bug in @ngrx/store-devtools that calls this instead of returning
    // a lambda that calls it when their Observable wrapper is unsubscribed.
    return () =&amp;gt; this.remotedev.unsubscribe(this.instanceId)
  }

  send(action: any, state: any): any {
    this.remotedev.send(action, state)
    // Never called
  }
}

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

&lt;/div&gt;



&lt;p&gt;File2 (depends on File1): &lt;br&gt;
&lt;code&gt;remote-devtools-proxy.ts&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;import {
  ReduxDevtoolsExtension,
  ReduxDevtoolsExtensionConfig,
  ReduxDevtoolsExtensionConnection
} from '@ngrx/store-devtools/src/extension'
import { connect } from 'remotedev/lib/devTools'

import { RemoteDevToolsConnectionProxy } from './remote-devtools-connection'

export class RemoteDevToolsProxy implements ReduxDevtoolsExtension {
  remotedev: any = null
  defaultOptions = {
    realtime: true,
    autoReconnect: true,
    connectTimeout: 20000,
    ackTimeout: 10000,
    secure: true
  }

  constructor(defaultOptions: Object) {
    this.defaultOptions = {
      ...this.defaultOptions,
      ...defaultOptions
    }
    console.log('Socket config', this.defaultOptions)
  }

  connect(
    options:
      | {
          shouldStringify?: boolean
          instanceId: string
        } &amp;amp; ReduxDevtoolsExtensionConfig
  ): ReduxDevtoolsExtensionConnection {
    const connectOptions = Object.assign(this.defaultOptions, options)

    this.remotedev = connect(connectOptions)

    const connectionProxy = new RemoteDevToolsConnectionProxy(
      this.remotedev,
      connectOptions.instanceId
    )
    return connectionProxy
  }

  send(action: any, state: any): any {
    this.remotedev.send(action, state)
  }
}

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

&lt;/div&gt;



&lt;p&gt;File3 (depends on File2): make sure to include this file in your app based on your environment setup. Like direct import, or webpack include .. etc&lt;/p&gt;

&lt;p&gt;The variables &lt;code&gt;REMOTE_DEV_HOST&lt;/code&gt; &amp;amp; &lt;code&gt;REMOTE_DEV_PORT&lt;/code&gt; can be environment dependent, or hardcoded. You can hardcode them at least to make sure everything works as expected. However the most important point it to use "EXACT" same IP, and PORT in all following steps&lt;/p&gt;

&lt;p&gt;&lt;code&gt;index.ts&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;import { RemoteDevToolsProxy } from './remote-devtools-proxy'

declare const REMOTE_DEV_HOST: string
declare const REMOTE_DEV_PORT: number

if (!window['devToolsExtension'] &amp;amp;&amp;amp; !window['__REDUX_DEVTOOLS_EXTENSION__']) {
  console.log('!!!!!! REDUX INSPECTION HAS STARTED !!!!!')
  const remoteDevToolsProxy = new RemoteDevToolsProxy({
    // Needs to match what you run `remotedev` command with and
    // what you setup in remote devtools local connection settings
    hostname: REMOTE_DEV_HOST,
    port: REMOTE_DEV_PORT,
    connectTimeout: 300000, // extend for pauses during debugging
    ackTimeout: 120000, // extend for pauses during debugging
    secure: false // dev only
  })

  // support both the legacy and new keys, for now
  window['devToolsExtension'] = remoteDevToolsProxy
  window['__REDUX_DEVTOOLS_EXTENSION__'] = remoteDevToolsProxy
} else {
  // handle case outside real device, or emulator
}

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Step 3:
in your angular module make sure you include store dev module
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@NgModule({
  imports: [CommonModule, StoreDevtoolsModule.instrument({ maxAge: 100 })]
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Step 4:&lt;br&gt;
install &lt;a href="https://www.npmjs.com/package/@redux-devtools/cli" rel="noopener noreferrer"&gt;@redux-devtools/cli&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Step 5:&lt;br&gt;
add a script to start redux devtools server which will listen to state, and action changes in your package.json&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;scripts:
{"remote-dev":"redux-devtools --hostname=ADD_IP_FROM_PREVIOUS_STEPS --port=ADD_PORT_FROM_PREVIOUS_STEPS --wsEngine=ws --logLevel=3"}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and run it in a separate terminal tab/window&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Step 6:
You may get some error about global is not defined, and in this case add following to polyfill.ts (this is generated by default in your root folder) in your Angular app (more info can be found &lt;a href="https://github.com/angular/angular-cli/issues/9827#issuecomment-369578814" rel="noopener noreferrer"&gt;here&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;polyfill.ts&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;(window as any).global = window
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Step 7:
open chrome, and right click redux extension to open remote dev tools&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%2Fo84fc33m13t75okk7arg.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%2Fo84fc33m13t75okk7arg.png" alt=" " width="289" height="353"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Step 8:
connect to your host from redux remote settings (UX is bad as there is no feedbad if connection succeeds, or fails). Howevwer ater successful connection you should see the store visible in your dev tools&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%2Fu773gxtyn6kq6vxsdrqe.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%2Fu773gxtyn6kq6vxsdrqe.png" alt=" " width="492" height="576"&gt;&lt;/a&gt;&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%2F88rgtjmdg2ca9m1kdmm9.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%2F88rgtjmdg2ca9m1kdmm9.png" alt=" " width="800" height="231"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Happy Hacking ...&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>forem</category>
    </item>
    <item>
      <title>Using Nextjs with Sass the Angular way!</title>
      <dc:creator>Mohammed Taher</dc:creator>
      <pubDate>Sat, 05 Feb 2022 23:47:41 +0000</pubDate>
      <link>https://dev.to/justgeek/using-nextjs-with-sass-the-angular-way-3f7l</link>
      <guid>https://dev.to/justgeek/using-nextjs-with-sass-the-angular-way-3f7l</guid>
      <description>&lt;p&gt;I am someone who has quite good experience in frontend world (14+ years), and I believe frameworks (like Angular) is a great way to keep code style consistency, and quality specially in quite big team.&lt;/p&gt;

&lt;p&gt;Frameworks however come with a downside that it can't be easily customized.&lt;/p&gt;

&lt;p&gt;I recently started using nextjs to kickstart a new project, and I was shocked by the fact that very simple structure decisions are hard to make! specially when it comes to something as simple as connecting my logic to style files.&lt;/p&gt;

&lt;p&gt;Some approach that I am used to very long time ago is separation of concern, and the most simple way in frontend application to apply this, is for example keeping all logic (ts, or js files), and style (css,sass,scss ..etc), and sometimes (html if you dont use SFCs) in the same directory, and also keep them linked together (i.e a single entry point usually imports styles and layout files).&lt;/p&gt;

&lt;p&gt;Unfortunately when I started using nextjs I found that keeping my sass files in the same directory as my react component is not as easy as I imagined, but the good news that after few hours of searhcing and trying I found a working solution, and that is why am writing this article to share knowledge and save someone's else time if they happen to be looking for a similar solution.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Steps:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Let's start by creating NEXTJS Hello World project (at the time of writing this article, the latest NextJS version was 12.0.10)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;npx create-next-app@latest --typescript&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Next we need to install all dependencies
&lt;code&gt;npm i&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Next we can run our app
&lt;code&gt;npm run dev&lt;/code&gt;
So far everything looks cool. However the challenge starts when I want to create a simple page with following structure
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;|-- path
    |-- to
        |-- MyPage
            |-- index.tsx
            |-- style.scss
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Unfortunately nextjs only allows using modules, which I don't find very convenient!&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Under pages create Mypage folder, and create two new children, &lt;code&gt;index.tsx&lt;/code&gt;, and &lt;code&gt;style.scss&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="c1"&gt;// index.tsx&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./style.scss&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;MyFirstPage&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"my-first-page"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"title-1"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Title 1&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"title-2"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Title 2&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

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

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scss"&gt;&lt;code&gt;&lt;span class="c1"&gt;// style.scss&lt;/span&gt;
&lt;span class="nn"&gt;#my-first-page&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nc"&gt;.title-1&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;red&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nc"&gt;.title-2&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;green&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;import the page we have just created into &lt;code&gt;app.tsx&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Router&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;next/router&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;AppProps&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;next/app&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;MyFirstPage&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./MyFirstPage&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;Component&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;pageProps&lt;/span&gt; &lt;span class="p"&gt;}:&lt;/span&gt; &lt;span class="nx"&gt;AppProps&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// return &amp;lt;Component {...pageProps} /&amp;gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;MyFirstPage&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;;&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;If you try to run the previous code, you will get error from nextjs
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Global CSS cannot be imported from files other than your Custom &amp;lt;App&amp;gt;. Please move all global CSS imports to pages/_app.js.
Read more: https://err.sh/next.js/css-global
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I got stuck at this point for long time, and most solutions on the internet were really inconvenient for me, but luckily I could come up with a working solution!&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;install following
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;mini-css-extract-plugin css-loader sass sass-loader
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The plugins are optional but just in case you have a previous nextjs config feel free to install them, or just remove it from config file and skip this step
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;next-compose-plugins next-transpile-modules
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Open next.config.js and add the following
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;withTM&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;next-transpile-modules&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)([]);&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;withPlugins&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;next-compose-plugins&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;MiniCssExtractPlugin&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;mini-css-extract-plugin&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;withPlugins&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="nx"&gt;withTM&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;reactStrictMode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;webpack&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;buildId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;dev&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;isServer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;defaultLoaders&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;webpack&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Find and remove NextJS css rules.&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;cssRulesIdx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;rules&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;findIndex&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;oneOf&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;cssRulesIdx&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Could not find NextJS CSS rule to overwrite.&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;rules&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;splice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;cssRulesIdx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// Add a simpler rule for global css anywhere.&lt;/span&gt;
    &lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;plugins&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;MiniCssExtractPlugin&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
        &lt;span class="c1"&gt;// Options similar to the same options in webpackOptions.output&lt;/span&gt;
        &lt;span class="c1"&gt;// both options are optional&lt;/span&gt;
        &lt;span class="na"&gt;filename&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;static/chunks/pages/[contenthash].css&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;chunkFilename&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;static/chunks/pages/[contenthash].css&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="p"&gt;}),&lt;/span&gt;
    &lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;rules&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
      &lt;span class="na"&gt;test&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="se"&gt;\.(&lt;/span&gt;&lt;span class="sr"&gt;sa|sc|c&lt;/span&gt;&lt;span class="se"&gt;)&lt;/span&gt;&lt;span class="sr"&gt;ss$/i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;use&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;MiniCssExtractPlugin&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;loader&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;css-loader&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;sass-loader&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;

    &lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;rules&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
      &lt;span class="na"&gt;test&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="se"&gt;\.&lt;/span&gt;&lt;span class="sr"&gt;tsx/&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;use&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;defaultLoaders&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;babel&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;The above code simply overrides nextjs global css rules, and it also uses MinicssExtractPlugin to write the sass content which was transpiled by sass loader into separate css files&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Run the app once more and here you go ! a nice non scoped styles with only using css specifity
&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%2F0c89cxhjfp5ycadbc2e6.png" alt="code preview screenshot"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you are so lazy like myself, feel free to clone the whole experiment from &lt;a href="https://github.com/justgeek/nextjs-global-sass" rel="noopener noreferrer"&gt;here&lt;/a&gt;, and play around with it! Happy Hacking ✌️&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>sass</category>
      <category>react</category>
      <category>webpack</category>
    </item>
  </channel>
</rss>
