Angular, Micro Frontends (Module Federation), and NX Monorepos - Shared Data, Libraries, and Builds

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 ต.ค. 2023
  • Angular: Angular is a popular open-source framework for building dynamic web applications. It provides a structured approach to web development and offers a wide range of tools and libraries for creating robust, scalable, and maintainable applications.
    Module Federation (Microfrontends): Module Federation is a modern architectural pattern that allows you to build and deploy independent, self-contained modules (microfrontends) within a single web application. This approach enables teams to work on different parts of an application independently, making it easier to scale and maintain complex web projects.
    NX Monorepos: NX is a set of extensible dev tools for monorepos, which are repositories that contain multiple projects or applications. It helps manage the development, testing, and deployment of multiple projects within a single codebase efficiently. NX provides powerful tools for building, testing, and sharing code across different parts of a monorepo.
    Shared Data: Shared data refers to the practice of sharing information or state between different parts of an application, such as components or modules. In the context of microfrontends, it's essential to establish efficient mechanisms for sharing data between independent modules to ensure a cohesive user experience.
    Libraries: In the context of NX and Angular, libraries are reusable code modules that encapsulate specific functionality. They are designed to be shared across different projects within a monorepo, promoting code reusability and maintainability.
    Builds: Building refers to the process of transforming source code into executable code or distributable assets. In web development, building typically involves tasks like compiling TypeScript to JavaScript, bundling assets, and optimizing code for production. Efficient build processes are crucial for delivering fast and reliable web applications.
    In summary, the provided title suggests a comprehensive exploration of how these various concepts interact and work together within the context of Angular development, Module Federation for micro frontends, and NX Monorepos. It also highlights the importance of shared data, libraries, and efficient build processes in modern web development workflows.

ความคิดเห็น • 52

  • @praveenrl2120
    @praveenrl2120 หลายเดือนก่อน +1

    Thanks a lot man, after a long search I found the real use of Micro-Frontend in this video 😇

    • @DevBySeb
      @DevBySeb  หลายเดือนก่อน

      Thanks for watching mate, hope you liked it 🙏🏼🙏🏼

  • @juanpabloruizmunoz1424
    @juanpabloruizmunoz1424 8 หลายเดือนก่อน +1

    Amazing video, once again... thank you!

    • @DevBySeb
      @DevBySeb  8 หลายเดือนก่อน

      Thanks and thank you for watching mate 🙏🏼

  • @user-hx7wz5jo8i
    @user-hx7wz5jo8i 5 หลายเดือนก่อน +1

    Amazing!, thanks Sebastian for sharing

    • @DevBySeb
      @DevBySeb  5 หลายเดือนก่อน

      Thanks mate, and thank you for watching 🙏🏼🙏🏼

  • @MaddesMat
    @MaddesMat 8 หลายเดือนก่อน +1

    Great video👏

    • @DevBySeb
      @DevBySeb  8 หลายเดือนก่อน

      🙏🏼🙏🏼🙏🏼

  • @adrian333dev
    @adrian333dev 8 หลายเดือนก่อน +2

    Welcome back Sebastian, glad to see you upload new content. Also the resolution is only 360p if you didn't notice, the text is barely visible

    • @DevBySeb
      @DevBySeb  8 หลายเดือนก่อน +1

      Thanks mate! Omg - I will look into this - thanks for letting me know!

    • @DevBySeb
      @DevBySeb  8 หลายเดือนก่อน +1

      Seems like TH-cam is still processing the video - a better quality should be available in 30-60 minutes. :)

    • @DevBySeb
      @DevBySeb  8 หลายเดือนก่อน +3

      Up 'n running in good quality now! :)

  • @viralmoney8619
    @viralmoney8619 8 หลายเดือนก่อน +2

    I was just searching it and got at the same time.. thanks a lot.. could you please do one large playlist with better ui and concepts to understand both mono repo and remote

    • @DevBySeb
      @DevBySeb  8 หลายเดือนก่อน

      Will do that for sure mate! Thanks for watching by the way! 🙌🏼

  • @user-hz3ku5rg3q
    @user-hz3ku5rg3q 6 หลายเดือนก่อน +2

    I am working on a Nx and Angular v17 application which I am creating as MFE. This video from Sebastian is one of the best I have come across in my research as it explains key concepts. It would be great to get some more videos explaining (with examples) the concepts behind libs, features (feature shell) etc. I would also like to see a video on how to share styles and assets between apps and libs easily as this is not explained very well in the Nx documentation. Great work - love your content.

    • @DevBySeb
      @DevBySeb  6 หลายเดือนก่อน

      Thanks for your awesome feedback mate 🙏🏼 I will add that to my todo-list of videos. Once again - thank you 🙏🏼

    • @coffeeguy2429
      @coffeeguy2429 6 หลายเดือนก่อน +1

      hey,
      I'm also working on a project where i use angular and react to create mfe and use single spa. Do you have any suggestions where i can find a way to share data between the mfe.
      thanks in advance.

    • @alanrutter3273
      @alanrutter3273 6 หลายเดือนก่อน +1

      Have you looked at Zustand or Jotai?

    • @coffeeguy2429
      @coffeeguy2429 6 หลายเดือนก่อน +1

      @@alanrutter3273 will look into that

    • @niteshkhandare4567
      @niteshkhandare4567 7 วันที่ผ่านมา

      Hi i'm also working on angular 17 could you please share the MFE project git link for reference

  • @98maie
    @98maie 4 หลายเดือนก่อน +1

    Gold!!

    • @DevBySeb
      @DevBySeb  4 หลายเดือนก่อน

      Thanks mate 🙏🏼🙏🏼🙏🏼

  • @user-ck5vg4yq5m
    @user-ck5vg4yq5m 3 หลายเดือนก่อน +1

    Hi Sebastian, nice video, is it possible to have this same approach with packages.json files per application?
    That is, I can have angular applications with different versions in a productive environment, or also apps with different versions of libraries but that work with each other.

    • @DevBySeb
      @DevBySeb  3 หลายเดือนก่อน

      Hey mate. Excellent question! Nx supports one package json for all projects. This simplifies lifecycle management (upgrading, maintaining externats packages for the whole organisation. Its also easier to resolve vulnerabilities, and it is good in terms of many aspects such as; shared libs and fetures. More info can be found here: nx.dev/concepts/more-concepts/dependency-management

  • @sunils1263
    @sunils1263 7 หลายเดือนก่อน +2

    Lot of thanks Sebastian. What I was expected and searching it and i got at the same time thanks a lot man.. its a great time. Could you please do some video for mono repo with shared asset folder and multi repo concept to integrate multiple repo apps. With auth and session, cookies concepts

    • @DevBySeb
      @DevBySeb  7 หลายเดือนก่อน +1

      Thank you for watching mate. I will put it on my list of todos - Thanks! 🙏🏼

    • @sunils1263
      @sunils1263 7 หลายเดือนก่อน

      Is any idea about how to resolved (NX Daemon process terminated and closed the connection error). i have tried lot . reset, restore, clear cache, reinstall, migrate, etc. and i have mallualy start the daemon. daemon was started but while run the nx serve command again got the same error. its dosen't work for me. it was totally blocking @@DevBySeb

  • @josealancay7608
    @josealancay7608 8 หลายเดือนก่อน +2

    Hello, good tutorial bro. i am from argentina
    I have the following problem.
    The images of my assets are shown broken when I launch my mf-login together with the main but if I run it individually the mf-login the image is displayed correctly.

    • @DevBySeb
      @DevBySeb  8 หลายเดือนก่อน +1

      Hello my friend, and thank you! It should work out of box, given the baseHrefs are set. Can you ensure that the baseHrefs are correctly set and that a leading slash for the images is set e.g: ”/assets/…”.
      I will double check this during the week!

    • @josealancay7608
      @josealancay7608 6 หลายเดือนก่อน

      @@DevBySeb
      Do you know any way to apply rules by applications? For example, each application is taken by a team and only that team has permission.

  • @remiguillard3773
    @remiguillard3773 4 หลายเดือนก่อน +1

    Is it possible to have access to the github project ?

    • @DevBySeb
      @DevBySeb  3 หลายเดือนก่อน

      Thanks for watching mate, I will check if I still have that code 🙏🏼

  • @nadeemramsing669
    @nadeemramsing669 8 หลายเดือนก่อน +1

    Hello, Sebastian. I've got a similar setup, but when I click on a remote routerLink (/cart in your case) from the host app (/host), I get the error "This localhost page can’t be found HTTP ERROR 404". At 44:00, if you refresh your tab, does the same happen?

    • @DevBySeb
      @DevBySeb  8 หลายเดือนก่อน

      Hello mate, did you change the paths in the webpack.prod file? And did you setup the baseHrefs to point toward the correct url? :)

    • @nadeemramsing669
      @nadeemramsing669 8 หลายเดือนก่อน +1

      @@DevBySeb I am also going to replicate your code today and see if same happens on deployment.

    • @nadeemramsing669
      @nadeemramsing669 8 หลายเดือนก่อน +1

      @@DevBySeb Re How would be declare your nginx configuration so that your remote apps are accessible via routing in your host app?

    • @DevBySeb
      @DevBySeb  8 หลายเดือนก่อน

      Did it work to replicate it mate?@@nadeemramsing669

    • @DevBySeb
      @DevBySeb  8 หลายเดือนก่อน

      Excellent question regarding the nginx config - maybe I should make a tutorial about it (?) as I think it might be to difficult to explain in the comments here (also it differs based on deploy-approach) @@nadeemramsing669

  • @pjotreknoname1680
    @pjotreknoname1680 4 หลายเดือนก่อน +1

    Hi, I got stuck at the very beginning of this video (10 minutes). When I try to run the host locally, everything compiles correctly, but I get an error in the browser console: TypeError: Cannot read properties of undefined (reading 'call') and Cannot use import statement outside a module (at styles.js:1:1). From what I see, the problem is quite old, but no one gave the correct solution. I'm using Angular 16 and node 20

    • @DevBySeb
      @DevBySeb  3 หลายเดือนก่อน

      Thanks for sharing mate. I haven’t seen that issue before, are you serving the application in the same way as I do?

    • @pjotreknoname1680
      @pjotreknoname1680 3 หลายเดือนก่อน

      @@DevBySeb Yes, I do everything just like you. This error does not appear when I use CLI commands to create components (eg nx g @nx/angular:host dashboard). It's very strange. it seems that the NX generator in VSC is not working properly for me, or I have the wrong configuration for the NX generator :/

  • @ummaykulsumpeer3417
    @ummaykulsumpeer3417 4 หลายเดือนก่อน +1

    Hello Sebastian when I create my remote application I am not able to see my entry.module.ts file please help my node version is 18.18.1

    • @DevBySeb
      @DevBySeb  3 หลายเดือนก่อน

      Hello mate, is it possible for you to test the same versions as I use in the video?

  • @arozendojr
    @arozendojr 4 หลายเดือนก่อน

    Have you already sent the project made with nx to sonarqube?

    • @DevBySeb
      @DevBySeb  4 หลายเดือนก่อน +1

      This existing project or projects in general?

    • @arozendojr
      @arozendojr 4 หลายเดือนก่อน

      @@DevBySeb Projects created in the Angular console, using modularization, I tried to use the project from the official documentation with the Angular library, but I was unable to send it to sonarqube

    • @DevBySeb
      @DevBySeb  4 หลายเดือนก่อน +1

      @@arozendojr we are utilizing sonarqube for scanning with quality gates set up, which runs in our CI pipeline per pull request level. We utilize an npm package to publish it. I believe its called sonarscanner or something similar. So it is possible.

    • @arozendojr
      @arozendojr 4 หลายเดือนก่อน

      @@DevBySeb My problem is nx creating an angular library, I would like to send everything from git to sonarquibe, I discovered that the angular library is a complete project, a separate directory in sonarquibe is mandatory

  • @ekremkocak188
    @ekremkocak188 หลายเดือนก่อน +1

    where is the rest of the screen 😶

    • @DevBySeb
      @DevBySeb  หลายเดือนก่อน

      Thanks for the feedback mate, I’ll try to improve on that front 🙏🏼