<?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: Oleksandr Khivrych</title>
    <description>The latest articles on DEV Community by Oleksandr Khivrych (@sashakhivrych).</description>
    <link>https://dev.to/sashakhivrych</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%2F881389%2Fe6365143-5cda-47b3-aa66-197af994ba11.jpg</url>
      <title>DEV Community: Oleksandr Khivrych</title>
      <link>https://dev.to/sashakhivrych</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sashakhivrych"/>
    <language>en</language>
    <item>
      <title>My talk at the CityJS London (Micro Frontends Summit)</title>
      <dc:creator>Oleksandr Khivrych</dc:creator>
      <pubDate>Thu, 20 Jul 2023 15:25:08 +0000</pubDate>
      <link>https://dev.to/sashakhivrych/my-talk-at-the-cityjs-london-micro-frontends-summit-1016</link>
      <guid>https://dev.to/sashakhivrych/my-talk-at-the-cityjs-london-micro-frontends-summit-1016</guid>
      <description>&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/dsUn21z529Q"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>webpack</category>
      <category>nx</category>
      <category>microfrontends</category>
      <category>rspack</category>
    </item>
    <item>
      <title>JS Fwdays Europe - Micro Frontends</title>
      <dc:creator>Oleksandr Khivrych</dc:creator>
      <pubDate>Mon, 20 Feb 2023 10:18:39 +0000</pubDate>
      <link>https://dev.to/sashakhivrych/js-fwdays-europe-micro-frontends-3ecd</link>
      <guid>https://dev.to/sashakhivrych/js-fwdays-europe-micro-frontends-3ecd</guid>
      <description>&lt;p&gt;Designing &lt;strong&gt;micro frontends&lt;/strong&gt; can be a daunting task. While a well-planned micro frontends strategy can offer &lt;strong&gt;numerous advantages for businesses&lt;/strong&gt; , an &lt;strong&gt;improperly designed system&lt;/strong&gt; can &lt;strong&gt;result in a host of issues&lt;/strong&gt; , including poor performance, increased complexity, and excessive cognitive load.&lt;/p&gt;

&lt;p&gt;This presentation will delve into &lt;strong&gt;the best practices&lt;/strong&gt; for keeping things streamlined with &lt;strong&gt;Module Federation&lt;/strong&gt; , which enables &lt;strong&gt;autonomous release&lt;/strong&gt; flows for &lt;strong&gt;cutting-edge web applications&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/n0-DOP_xsdM"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>webpack</category>
      <category>react</category>
      <category>microfrontends</category>
      <category>nextjs</category>
    </item>
    <item>
      <title>Intro to Micro Front Ends</title>
      <dc:creator>Oleksandr Khivrych</dc:creator>
      <pubDate>Fri, 02 Dec 2022 21:02:18 +0000</pubDate>
      <link>https://dev.to/sashakhivrych/intro-to-micro-front-ends-1npm</link>
      <guid>https://dev.to/sashakhivrych/intro-to-micro-front-ends-1npm</guid>
      <description>&lt;p&gt;Architecting micro-frontends can be challenging. The right micro-frontends approach can provide many benefits for organisations. But the poorly architected system can sometimes lead to many critical issues (performance, complexity, big cognitive load).&lt;/p&gt;

&lt;p&gt;In this talk, I will explore how we can keep micro frontends simple with the help of Module Federation and enable independent release flows in modern web applications.&lt;/p&gt;

&lt;h3&gt;
  
  
  This talk will cover the following:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;What are micro frontends?&lt;/li&gt;
&lt;li&gt;Benefits and risks&lt;/li&gt;
&lt;li&gt;Overview of modern modular monolith web apps&lt;/li&gt;
&lt;li&gt;Enabling distributed frontends using Module Federation&lt;/li&gt;
&lt;li&gt;Live Demo of Client Side Rendering with Module Federation&lt;/li&gt;
&lt;li&gt;Live Demo Server Side Rendering with Module Federation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=lV-X6byaE2E"&gt;https://www.youtube.com/watch?v=lV-X6byaE2E&lt;/a&gt;&lt;/p&gt;

</description>
      <category>microfrontends</category>
      <category>react</category>
      <category>modulefederation</category>
      <category>webpack</category>
    </item>
    <item>
      <title>Bridging the gap between technical &amp; non-technical teams</title>
      <dc:creator>Oleksandr Khivrych</dc:creator>
      <pubDate>Tue, 22 Nov 2022 00:01:57 +0000</pubDate>
      <link>https://dev.to/sashakhivrych/bridging-the-gap-between-technical-non-technical-teams-4n4l</link>
      <guid>https://dev.to/sashakhivrych/bridging-the-gap-between-technical-non-technical-teams-4n4l</guid>
      <description>&lt;p&gt;Last month I participated in a panel discussion at &lt;a href="https://www.eventbrite.co.uk/e/reviving-londons-tech-scene-tickets-439163057527?aff=ebdsoporgprofile" rel="noopener noreferrer"&gt;Reviving London's Tech Scene&lt;/a&gt; event from &lt;a href="https://www.meetup.com/london-tech-network/" rel="noopener noreferrer"&gt;London Tech Network&lt;/a&gt;. A lot of professionals from &lt;a href="https://about.meta.com/" rel="noopener noreferrer"&gt;Meta&lt;/a&gt;, &lt;a href="https://www.economist.com/" rel="noopener noreferrer"&gt;The Economist&lt;/a&gt;, &lt;a href="https://www.osedea.com/" rel="noopener noreferrer"&gt;Osedea&lt;/a&gt;, &lt;a href="https://careers.beamery.com/" rel="noopener noreferrer"&gt;Beamery&lt;/a&gt; were present at this event.&lt;/p&gt;

&lt;p&gt;Our discussion focused on bridging the gap between technical and non-technical teams. Here are my key takeaways from this discussion.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why is there a gap between technical and non-technical teams?
&lt;/h2&gt;

&lt;p&gt;To a certain extent, this gap is caused by a relatively low priority that soft skills are given among tech employees. I find this problematic because in my view soft skills are equally important to technical skills when you are building a digital product.&lt;/p&gt;

&lt;p&gt;According to my research, there are at least 13 categories of soft skills: adaptability, communication, compromise, creative thinking, dependability, leadership, listening, work ethic, teamwork, positivity, critical thinking, conflict resolution, and negotiation. As you can see, each category is related to interacting with different people (managers, stakeholders, teammates, junior developers, product owners, etc.) on different levels.&lt;/p&gt;

&lt;p&gt;In any case, if you want to positively impact your organisation and build high-quality products, you definitely should not underestimate the importance of soft skills. This is even more important if you are a Senior Software Engineer and want to grow your career and move to the next level.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to bridge this gap and improve soft skills
&lt;/h2&gt;

&lt;p&gt;So, you made the decision to improve your soft skills. It might sound daunting, and a lot of introverted software engineers I know struggle with this. However, there are proven techniques that you can employ to improve your communication skills. They can be broadly divided into those that you can do during working hours and outside working hours.&lt;/p&gt;

&lt;h3&gt;
  
  
  Leverage your company resources
&lt;/h3&gt;

&lt;p&gt;My advice is to have regular 1:1 conversions with your line manager and look for ways of improving your soft skills together. I can share some personal examples from my current employer, Beamery. These are four activities that I find helpful for improving my soft skills.&lt;/p&gt;

&lt;h4&gt;
  
  
  Mentoring Program
&lt;/h4&gt;

&lt;p&gt;Beamery has an internal Mentorship program that employees can participate in as mentors and mentees, and uses our internal product called Beamery Grow. Since I joined this program, I have been mentoring a Senior QA Engineer whose goal it is to become a Full Stack Engineer, in the format of weekly sessions. Being a mentor has been an enriching experience and helped me improve my communication, listening and mentoring skills.&lt;/p&gt;

&lt;h4&gt;
  
  
  Internal events
&lt;/h4&gt;

&lt;p&gt;We host a lot of internal events at Beamery, in various formats and for various audiences. I particularly enjoy Launch and Learn sessions where engineers give presentations about some cool piece of technology or an interesting architecture proposal they have made at work. I think taking part in internal events like this can be a great way to improve your public speaking skills in a supportive environment.&lt;/p&gt;

&lt;h4&gt;
  
  
  Publications
&lt;/h4&gt;

&lt;p&gt;If you have something to share with the tech community, you can write an article for your company blog. It might be on a technical or a non-technical topic. While writing, you will begin to pay more attention to word choice, sentence structure and tone. As with everything, the more you write, the more your writing skills will improve.&lt;/p&gt;

&lt;h4&gt;
  
  
  Donut buddies
&lt;/h4&gt;

&lt;p&gt;I find the &lt;a href="https://beamery.slack.com/apps/A11MJ51SR-donut" rel="noopener noreferrer"&gt;Donut app for Slack&lt;/a&gt; to be a great way to meet new people in Slack: this app regularly matches you with a random colleague and encourages you to make a connection and organise a chat. It helps break the ice by suggesting some initial topics for conversation. I usually have a few meetings organised by Donut each month, during which Im matched to a non-technical person within the Customer Success department or product department. This is a great way to meet people you probably wouldnt meet otherwise, learn about other parts of the business and improve your communication skills. And you dont have to speak only about work!&lt;/p&gt;

&lt;h3&gt;
  
  
  Outside of working hours
&lt;/h3&gt;

&lt;p&gt;There are plenty of opportunities to improve your soft skills outside the working hours as well. You can start speaking at meetups and conferences. You can also start volunteering, which I find very enjoyable. There are lots of communities where you can be a teacher or a coding mentor, which can be a huge boost to your soft skills: you will communicate with different people with different skills, from different cultures, etc. On top of that, your contribution will actually help people to start an engineering career! I currently mentor and teach people at &lt;a href="https://codebar.io/" rel="noopener noreferrer"&gt;Codebar&lt;/a&gt;, &lt;a href="https://meetamentor.co.uk/" rel="noopener noreferrer"&gt;Meet a Mentor&lt;/a&gt;, and &lt;a href="https://codeyourfuture.io/" rel="noopener noreferrer"&gt;Code Your Future&lt;/a&gt;, which are all great organisations I can vouch for.&lt;/p&gt;

&lt;h2&gt;
  
  
  Parting thoughts
&lt;/h2&gt;

&lt;p&gt;I hope you found this article interesting and motivating, and I hope it gave you some ideas for starting working on the soft skills.&lt;/p&gt;

&lt;p&gt;What is the most effective method for improving soft skills in your experience?&lt;/p&gt;

</description>
      <category>mentorship</category>
      <category>leadership</category>
      <category>softskills</category>
    </item>
    <item>
      <title>Hack For Peace — Cross-European Hackathon</title>
      <dc:creator>Oleksandr Khivrych</dc:creator>
      <pubDate>Sat, 05 Nov 2022 11:46:35 +0000</pubDate>
      <link>https://dev.to/sashakhivrych/hack-for-peace-cross-european-hackathon-54no</link>
      <guid>https://dev.to/sashakhivrych/hack-for-peace-cross-european-hackathon-54no</guid>
      <description>&lt;h2&gt;
  
  
  About the hackathon
&lt;/h2&gt;

&lt;p&gt;Following up on &lt;a href="https://okhivrych.io/why-should-you-attend-hackathons"&gt;one of my earlier articles&lt;/a&gt; on the benefits of participating in hackathons, I wanted to share my experience participating in yet another hackathon.&lt;/p&gt;

&lt;p&gt;This time I participated in &lt;a href="https://hackforpeace.net/"&gt;Hack For Peace Cross-European Hackathon&lt;/a&gt; (21-23 October 2022). During this event, developers, entrepreneurs, mentors, and investors from across the UK, Sweden, Portugal, Poland, and Ukraine came together to build innovative products and tech solutions to solve war issues and promote peace across Europe.&lt;/p&gt;

&lt;p&gt;My team became semi-finalists in this hackathon and got to give a speech in the finals. There were four stages that we went through during this event:&lt;/p&gt;

&lt;h2&gt;
  
  
  Building a team and defining roles
&lt;/h2&gt;

&lt;p&gt;I invited a few people that I knew before this hackathon to join my team: my colleague from &lt;a href="https://careers.beamery.com/"&gt;Beamery&lt;/a&gt; Dmitry and my mentee Karim (I mentor IT professionals through &lt;a href="https://meetamentor.co.uk/"&gt;Meet a Mentor platform&lt;/a&gt;). I met the remaining members of my team, Hannah and Amrutta, through the Slack workspace of this event.&lt;/p&gt;

&lt;p&gt;I became a team leader since I organized this team and have a lot of experience leading software teams. Dmitry and Hannah joined as Software Engineers. Amrutta was our graphic designer and Karim was a UI/UX designer. In the end, we had a pretty strong team with a wide range of skills and were ready to kick off the three days of hackathon.&lt;/p&gt;


&lt;blockquote&gt;
&lt;p&gt;Hackathon in progress &lt;a href="https://twitter.com/hashtag/hackforpeace?src=hash&amp;amp;ref_src=twsrc%5Etfw"&gt;#hackforpeace&lt;/a&gt; &lt;a href="https://twitter.com/hashtag/teambotsboo?src=hash&amp;amp;ref_src=twsrc%5Etfw"&gt;#teambotsboo&lt;/a&gt; &lt;a href="https://t.co/YSqwsiQhwQ"&gt;pic.twitter.com/YSqwsiQhwQ&lt;/a&gt;&lt;/p&gt;— Oleksandr (Sasha) Khivrych🇺🇦 (@sasha_khivrych) &lt;a href="https://twitter.com/sasha_khivrych/status/1583892371418148865?ref_src=twsrc%5Etfw"&gt;October 22, 2022&lt;/a&gt;
&lt;/blockquote&gt; 
&lt;h2&gt;
  
  
  Brainstorming and defining Idea
&lt;/h2&gt;

&lt;p&gt;Hackathon had four work streams:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Information security - Info hygiene, media war, cybersecurity.&lt;/li&gt;
&lt;li&gt;Mental health - Self-support, matching with therapists, group therapy.&lt;/li&gt;
&lt;li&gt;Kids education - Pre-school and school education.&lt;/li&gt;
&lt;li&gt;Logistics - Humanitarian aid delivery, evacuation of people, and the hazard of human trafficking.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Prior to the event, I was thinking of building something related to kids' education. However, after team discussions on the first day of the hackathon, we decided to pivot and create an app related to info hygiene/media war. We had two ideas: a news fact checker and a bot detection tool.&lt;/p&gt;

&lt;p&gt;By the end of the first day, we agreed to focus on a bot detection tool. The final vision was to build a Chrome extension that would blur/unblur posts from bots and show match scores. We decided to start with a Twitter integration for our MVP version.&lt;/p&gt;

&lt;h2&gt;
  
  
  Research and Developing a prototype
&lt;/h2&gt;

&lt;p&gt;After defining our idea and having minimal requirements on the first day of the event, the next day, we started building a working prototype that we could demo for the jury.&lt;/p&gt;

&lt;p&gt;Hannah and I started researching existing tools that can detect bots on Twitter and found Botomenr API, which was perfect for our prototype. We developed a Node.js service with one endpoint, which receives an array of user names, pulls data from Twitter API and then passes this data to Botomenr API to detect potential bots and return a match score.&lt;/p&gt;

&lt;p&gt;Meanwhile, Dmitry was working on the implementation of the frontend part. Amrita and Karim were working on the design of the app logo and creating wireframes for the demo.&lt;/p&gt;

&lt;p&gt;By the end of the day, we had a prototype: BotsBoo chrome extension that can detect bots on Twitter&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wXnSUfzB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1667647345697/AVUL7t2za.png%3Fwidth%3D450" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wXnSUfzB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1667647345697/AVUL7t2za.png%3Fwidth%3D450" alt="image.png" width="450" height="440"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Presentations and demo
&lt;/h2&gt;

&lt;p&gt;On the last day of the hackathon we had to record a 3 minute presentation and demo of our app. The entire team was involved in preparing and reviewing the presentation slides. Karim and I recorded a video and uploaded it for jury review.&lt;/p&gt;


&lt;blockquote&gt;
&lt;p&gt;Fantastic teamwork! &lt;a href="https://twitter.com/hashtag/hackforpeace?src=hash&amp;amp;ref_src=twsrc%5Etfw"&gt;#hackforpeace&lt;/a&gt; &lt;a href="https://twitter.com/hashtag/teambotsboo?src=hash&amp;amp;ref_src=twsrc%5Etfw"&gt;#teambotsboo&lt;/a&gt; &lt;a href="https://t.co/XV4ihVOf3m"&gt;pic.twitter.com/XV4ihVOf3m&lt;/a&gt;&lt;/p&gt;— Oleksandr (Sasha) Khivrych🇺🇦 (@sasha_khivrych) &lt;a href="https://twitter.com/sasha_khivrych/status/1584154508963508225?ref_src=twsrc%5Etfw"&gt;October 23, 2022&lt;/a&gt;
&lt;/blockquote&gt; 

&lt;p&gt;After a selection process, we became semi-finalists and entered the finals with 12 other teams (out of 22 teams that took part).&lt;/p&gt;


&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://twitter.com/hashtag/teambotsboo?src=hash&amp;amp;ref_src=twsrc%5Etfw"&gt;#teambotsboo&lt;/a&gt; is SemiFinalist. Going to do the final talk in the finals🤟 &lt;a href="https://twitter.com/hashtag/hackforpeace?src=hash&amp;amp;ref_src=twsrc%5Etfw"&gt;#hackforpeace&lt;/a&gt; &lt;a href="https://t.co/F9Uvj2B5ni"&gt;pic.twitter.com/F9Uvj2B5ni&lt;/a&gt;&lt;/p&gt;— Oleksandr (Sasha) Khivrych🇺🇦 (@sasha_khivrych) &lt;a href="https://twitter.com/sasha_khivrych/status/1584190412063141889?ref_src=twsrc%5Etfw"&gt;October 23, 2022&lt;/a&gt;
&lt;/blockquote&gt; 

&lt;p&gt;It was exciting to see how many great projects were built during the hackathon. My favorite project was "BeesAgainstMines".&lt;/p&gt;

&lt;p&gt;On the evening of the last day, we made a live speech in the final and a Q&amp;amp;A session from the jury.&lt;/p&gt;

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

&lt;p&gt;These three days were intense, but I enjoyed the experience so much! Yet again, I saw that a hackathon is a great opportunity to improve my leadership and public speaking skills and of course sharpen my technical skills. I also met a lot of new people in the industry and made friends with my teammates. These are the connections that I cherish so much as an immigrant in London.&lt;/p&gt;

&lt;p&gt;No matter where you are in your journey in tech, taking part in a hackathon is a great way to take your career and skills to the next level and have a great time while doing it.&lt;/p&gt;

&lt;h4&gt;
  
  
  What about your hackathon experience? Let me know in the comments down below.
&lt;/h4&gt;

</description>
      <category>networking</category>
      <category>hackathon</category>
      <category>leadership</category>
      <category>team</category>
    </item>
    <item>
      <title>Next.js with Module Federation: the Future of Micro Frontends?</title>
      <dc:creator>Oleksandr Khivrych</dc:creator>
      <pubDate>Thu, 27 Oct 2022 20:03:17 +0000</pubDate>
      <link>https://dev.to/sashakhivrych/nextjs-with-module-federation-the-future-of-micro-frontends-5dn9</link>
      <guid>https://dev.to/sashakhivrych/nextjs-with-module-federation-the-future-of-micro-frontends-5dn9</guid>
      <description>&lt;p&gt;Micro Frontends are a popular topic in the frontend community these days, and I have been fascinated with micro frontends for several years now. Micro Frontends architecture provides many benefits for organisations such as increased delivery speed and more independent release cycles, and more.&lt;/p&gt;

&lt;p&gt;One of the popular options to implement Micro Frontends architecture is to use the &lt;a href="https://webpack.js.org/concepts/module-federation/" rel="noopener noreferrer"&gt;Webpack Module Federation Plugin&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you are unfamiliar with Module Federation Plugin, you can read my article at Beamery Hacking Talent Blog &lt;a href="https://medium.com/hacking-talent/module-federation-for-distributed-front-ends-the-best-of-both-worlds-bb6af9e4000e" rel="noopener noreferrer"&gt;Module Federation for distributed front ends the best of both worlds&lt;/a&gt;. In this article I talk about Module Federation and its benefits in greater detail.&lt;/p&gt;

&lt;h2&gt;
  
  
  Webpack Module Federation with Next.js?
&lt;/h2&gt;

&lt;p&gt;This approach works great with client-side rendering. But what about server-side rendering (SSR)? Its not as straightforward. Moreover, when we are talking about SSR, we need to consider the support of the most popular React.js SSR framework, &lt;a href="https://nextjs.org/" rel="noopener noreferrer"&gt;Next.js&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Introducing nextjs-mf
&lt;/h2&gt;

&lt;p&gt;Currently, there are the &lt;code&gt;nextjs-mf&lt;/code&gt; and &lt;code&gt;nextjs-ssr&lt;/code&gt; plugins created by Module Federation Team. However, they are not open source and are available with a paid subscription on &lt;a href="https://app.privjs.com/buy/packageDetail?pkg=@module-federation/nextjs-ssr" rel="noopener noreferrer"&gt;PrivJs&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The good news is that the Module Federation Team has decided to move all work to open source.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://twitter.com/ScriptedAlchemy/status/1567253027312246784?ref_src=twsrc%5Etfw%7Ctwcamp%5Etweetembed%7Ctwterm%5E1567253027312246784%7Ctwgr%5Ebd7f500401e055807c2e92327e58f5b6a657f9f4%7Ctwcon%5Es1_c10&amp;amp;ref_url=https%3A%2F%2Fpublish.twitter.com%2F%3Fquery%3Dhttps3A2F2Ftwitter.com2FScriptedAlchemy2Fstatus2F1567253027312246784widget%3DTweet" rel="noopener noreferrer"&gt;https://twitter.com/ScriptedAlchemy/status/1567253027312246784?ref_src=twsrc%5Etfw%7Ctwcamp%5Etweetembed%7Ctwterm%5E1567253027312246784%7Ctwgr%5Ebd7f500401e055807c2e92327e58f5b6a657f9f4%7Ctwcon%5Es1_c10&amp;amp;ref_url=https%3A%2F%2Fpublish.twitter.com%2F%3Fquery%3Dhttps3A2F2Ftwitter.com2FScriptedAlchemy2Fstatus2F1567253027312246784widget%3DTweet&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Repo: &lt;a href="https://github.com/module-federation/nextjs-mf" rel="noopener noreferrer"&gt;https://github.com/module-federation/nextjs-mf&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However, SSR support is still a work in progress and available only via a paid subscription.&lt;/p&gt;

&lt;h2&gt;
  
  
  Example
&lt;/h2&gt;

&lt;p&gt;Following this example: &lt;a href="https://github.com/module-federation/module-federation-examples/blob/master/nextjs-ssr:" rel="noopener noreferrer"&gt;https://github.com/module-federation/module-federation-examples/blob/master/nextjs-ssr:&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Using the &lt;code&gt;@module-federation/nextjs-mf&lt;/code&gt; package you can split your monolith application into multiple Next.js micro-apps and enable micro frontends during the software development life cycle. However, at runtime, it will work as a monolith app with a the single ReactDOM tree and remote/shared modules loading logic handled by Module Federation on server and client.&lt;/p&gt;

&lt;p&gt;Basically you just need to add &lt;code&gt;@module-federation/nextjs-mf&lt;/code&gt; plugin to &lt;code&gt;nextjs.config&lt;/code&gt;:&lt;br&gt;
&lt;/p&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;NextFederationPlugin&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;@module-federation/nextjs-mf&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// this enables you to use import() and the webpack parser&lt;/span&gt;
&lt;span class="c1"&gt;// loading remotes on demand, not ideal for SSR&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;remotes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;isServer&lt;/span&gt; &lt;span class="o"&gt;=&amp;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;location&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;isServer&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ssr&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;chunks&lt;/span&gt;&lt;span class="dl"&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="na"&gt;home&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`home@http://localhost:3001/_next/static/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/remoteEntry.js`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;shop&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`shop@http://localhost:3002/_next/static/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/remoteEntry.js`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;checkout&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`checkout@http://localhost:3000/_next/static/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/remoteEntry.js`&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;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="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;webpack5&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="nf"&gt;webpack&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;options&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;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;NextFederationPlugin&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
        &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;home&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&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/remoteEntry.js&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;exposes&lt;/span&gt;&lt;span class="p"&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;./nav&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;./components/nav.js&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;./home&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;./async-pages/index.js&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;./pages-map&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;./pages-map.js&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="na"&gt;remotes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;remotes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;options&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="na"&gt;shared&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="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;Using Module Federation on the server utilizes proprietary software, commonly known as "Software Streaming". So basically, it loads remote chunks at runtime, and it does the same on the client side.&lt;/p&gt;

&lt;h2&gt;
  
  
  Security
&lt;/h2&gt;

&lt;p&gt;This plugin creates a remote container for the server side. By default, it is written to &lt;code&gt;_next/static/ssr&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The goal of this software is to make federation "just work" with one single plugin and as little setup as possible.&lt;/p&gt;

&lt;p&gt;It is highly recommended that network access to &lt;code&gt;_next/static/SSR/*&lt;/code&gt; is restricted to servers/machines inside the VPN or internal infrastructure.&lt;/p&gt;

&lt;p&gt;If access to that route is not restricted, you could risk exposing server code to the public internet!&lt;/p&gt;

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

&lt;p&gt;It is an exciting effort from the Module Federation Team to provide Next.js support, and I look forward to seeing the final version of the &lt;code&gt;nextjs-mf&lt;/code&gt; and how the community will use it and build on top of it.&lt;/p&gt;

&lt;p&gt;There is more to look forward to in this space! For example, there were a lot of exciting announcements made recently at &lt;a href="https://nextjs.org/conf" rel="noopener noreferrer"&gt;Next.js Conf&lt;/a&gt;, one of them introducing Turbopack (now in alpha). Providing support for Turbopack will be another challenge for the Module Federation Team.&lt;/p&gt;

&lt;p&gt;Im hopeful about that though. I received a very positive answer from Zack (Author of Module Federation). And they already have a plan to integrate with Turbopack in the future.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/module-federation/nextjs-mf/issues/332" rel="noopener noreferrer"&gt;https://github.com/module-federation/nextjs-mf/issues/332&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  To learn more
&lt;/h2&gt;

&lt;p&gt;You can check out my talk about this topic as well as four more talks by amazing speakers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Getting started with Next.js by Ilesh Mistry&lt;/li&gt;
&lt;li&gt;Pre-build scripts and why we need them in Next.js by Ondrej Polesny&lt;/li&gt;
&lt;li&gt;An Introduction to On-Demand Incremental Static Regeneration by Tom Marshall&lt;/li&gt;
&lt;li&gt;Micro frontends with Next.js and Module Federation by Oleksandr Khivrych&lt;/li&gt;
&lt;li&gt;Serverless And Edge Functions in Next.js by Shivay Lamba&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://twitter.com/IM_TechMeetup/status/1580679855024541696?ref_src=twsrc%5Etfw%7Ctwcamp%5Etweetembed%7Ctwterm%5E1580679855024541696%7Ctwgr%5E5ef371fa60167933ab41890696a836b13215de49%7Ctwcon%5Es1_c10&amp;amp;ref_url=https%3A%2F%2Fpublish.twitter.com%2F%3Fquery%3Dhttps3A2F2Ftwitter.com2FIM_TechMeetup2Fstatus2F1580679855024541696widget%3DTweet" rel="noopener noreferrer"&gt;https://twitter.com/IM_TechMeetup/status/1580679855024541696?ref_src=twsrc%5Etfw%7Ctwcamp%5Etweetembed%7Ctwterm%5E1580679855024541696%7Ctwgr%5E5ef371fa60167933ab41890696a836b13215de49%7Ctwcon%5Es1_c10&amp;amp;ref_url=https%3A%2F%2Fpublish.twitter.com%2F%3Fquery%3Dhttps3A2F2Ftwitter.com2FIM_TechMeetup2Fstatus2F1580679855024541696widget%3DTweet&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What are your thoughts on micro frontends? Have you used them?&lt;/p&gt;

</description>
      <category>microfrontends</category>
      <category>nextjs</category>
      <category>modulefederation</category>
      <category>webpack</category>
    </item>
    <item>
      <title>Why should you attend hackathons?</title>
      <dc:creator>Oleksandr Khivrych</dc:creator>
      <pubDate>Sun, 16 Oct 2022 16:32:37 +0000</pubDate>
      <link>https://dev.to/sashakhivrych/why-should-you-attend-hackathons-1ng8</link>
      <guid>https://dev.to/sashakhivrych/why-should-you-attend-hackathons-1ng8</guid>
      <description>&lt;h2&gt;
  
  
  My story
&lt;/h2&gt;

&lt;p&gt;Hey, folks. I have experience participating in hackathons and being a mentor at such events. Back in 2019, I attended &lt;a href="https://www.bemyapp.com/events/smallbizhack-2019.html"&gt;SmallBizHack&lt;/a&gt; by &lt;a href="https://www.intuit.com/"&gt;Intuit&lt;/a&gt; in London. This was an amazing event with more than 100 attendees. With this article, I wanted to share my experience, talk about my insights, and hopefully motivate you to attend hackathons in the future.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. You improve your soft skills, quickly
&lt;/h3&gt;

&lt;p&gt;If Im honest, the main challenge of this hackathon for me was not related to engineering: it was about building a team. This required a lot of communication with many people at the event, while trying to build relationships and trust quickly. I managed to organize a team of 4 people. With each team member being from a different country (Kazakhstan, Ukraine, India, Turkey), I had a chance to improve my intercultural communication skills on top of learning more about managing a team in an intense and fast moving environment of a hackathon.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://twitter.com/sasha_khivrych/status/1099703955842629634?ref_src=twsrc%5Etfw%7Ctwcamp%5Etweetembed%7Ctwterm%5E1099703955842629634%7Ctwgr%5Eb675798ec57ccc1760b84b6f6b18e67c5ab01d1b%7Ctwcon%5Es1_c10&amp;amp;ref_url=https%3A%2F%2Fpublish.twitter.com%2F%3Fquery%3Dhttps3A2F2Ftwitter.com2Fsasha_khivrych2Fstatus2F1099703955842629634widget%3DTweet"&gt;https://twitter.com/sasha_khivrych/status/1099703955842629634?ref_src=twsrc%5Etfw%7Ctwcamp%5Etweetembed%7Ctwterm%5E1099703955842629634%7Ctwgr%5Eb675798ec57ccc1760b84b6f6b18e67c5ab01d1b%7Ctwcon%5Es1_c10&amp;amp;ref_url=https%3A%2F%2Fpublish.twitter.com%2F%3Fquery%3Dhttps3A2F2Ftwitter.com2Fsasha_khivrych2Fstatus2F1099703955842629634widget%3DTweet&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It was a great opportunity for me to become better at listening to others, giving feedback, and accepting criticism. I feel like this experience made me a better leader.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. You learn to brainstorm and make better product decisions
&lt;/h3&gt;

&lt;p&gt;I did not have a clear idea of what I wanted to build during the hackathon. A day before the event, I started brainstorming and decided it should be something for the hiring process. I then spent the first day of the hackathon refining product ideas with my team, starting with the problem definition and finishing with potential impact and benefits for our future clients.&lt;/p&gt;

&lt;p&gt;The final product vision was to create a platform that would automate and improve the hiring experience for companies and candidates. With a single platform, candidates would go through the entire interview process and eventually even be able to accept their job offer via our platform. From the company's side, they can build out interview stages with initial screen calls, quizzes, tasks, and scheduling face-to-face interviews. Moreover, this platform would contain a lot of templates for building interview stages and automation processes to analyze CVs, collect candidate progress and build leader boards with candidates with the best results.&lt;/p&gt;

&lt;p&gt;As you can see, we came up with an interesting product to solve important hiring problems.&lt;/p&gt;

&lt;p&gt;A hackathon can teach you a lot about the product development process, just within the space of a few days.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. You get exposed to new technologies
&lt;/h3&gt;

&lt;p&gt;One of the conditions of the event was to use &lt;a href="https://developer.intuit.com/app/developer/qbo/docs/develop"&gt;QuickBooks API&lt;/a&gt; and &lt;a href="https://www.clarifai.com/%5D"&gt;Clarifai API&lt;/a&gt; or &lt;a href="https://www.vonage.co.uk/"&gt;Vonage API&lt;/a&gt; (formerly, Nexmo) to be able to win partner nomination. We were using all of the three APIs in our MVP. For example, we were using Nexmo to perform phone and video calls for interviews.&lt;/p&gt;

&lt;p&gt;One of the exciting features was to perform an initial screening phone call using Nexmo API, and have a bot ask all the screening questions. Then the recording with answers was sent to Clarify API to analyze the interview result. It is quite a new experience to be interviewed by a bot, but we will probably see something similar in the future.&lt;/p&gt;

&lt;p&gt;Moreover, we were using Quickbooks API as an accounting solution for our platform.&lt;/p&gt;

&lt;p&gt;I had not used any of these three technologies before the event, so I enjoyed exploring them and learnt quite a lot! Representatives from each company were there to support us and help us master the APIs quickly, which was another benefit of the hackathon.&lt;/p&gt;

&lt;p&gt;A hackathon can be a great excuse to play with cool and exciting tech that you arent exposed to in your everyday work life.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. You meet new people in the industry
&lt;/h3&gt;

&lt;p&gt;Like with all public events, a hackathon is a great way to expand your professional network. I met many professionals from different business areas. It was exciting to speak with CEOs, software engineers, designers, and learn from them. I cherish the relationships I built during the hackathon, and look forward to expanding my network even further during future events.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. You (might) win
&lt;/h3&gt;

&lt;p&gt;Im not going to lie: it feels nice to win! I was so happy when my team became the Nexmo (now called &lt;a href="https://www.vonage.co.uk"&gt;Vonage&lt;/a&gt;) winning team.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://twitter.com/IntuitDev/status/1099728634896703490?ref_src=twsrc%5Etfw%7Ctwcamp%5Etweetembed%7Ctwterm%5E1099728634896703490%7Ctwgr%5E8ca4b2f881a41bdf1e7fd983e10eb0796f1e0ddf%7Ctwcon%5Es1_c10&amp;amp;ref_url=https%3A%2F%2Fpublish.twitter.com%2F%3Fquery%3Dhttps3A2F2Ftwitter.com2FIntuitDev2Fstatus2F1099728634896703490widget%3DTweet"&gt;https://twitter.com/IntuitDev/status/1099728634896703490?ref_src=twsrc%5Etfw%7Ctwcamp%5Etweetembed%7Ctwterm%5E1099728634896703490%7Ctwgr%5E8ca4b2f881a41bdf1e7fd983e10eb0796f1e0ddf%7Ctwcon%5Es1_c10&amp;amp;ref_url=https%3A%2F%2Fpublish.twitter.com%2F%3Fquery%3Dhttps3A2F2Ftwitter.com2FIntuitDev2Fstatus2F1099728634896703490widget%3DTweet&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Winning at this hackathon was an important milestone for me professionally and I became even more motivated to improve my skills as a software engineer and a leader and keep working towards my dreams.&lt;/p&gt;

&lt;p&gt;By the way, you can also expect to win really amazing prizes at most hackathons (it can be money, tech gadgets, etc.). Moreover, I won a gadget just by taking part in a survey. There are plenty of opportunities to win prizes and cool swag at a hackathon. 😉&lt;/p&gt;

&lt;p&gt;&lt;a href="https://twitter.com/IntuitDev/status/1099726219338223617?ref_src=twsrc%5Etfw%7Ctwcamp%5Etweetembed%7Ctwterm%5E1099726219338223617%7Ctwgr%5E2b784b62e4dd0a142337b1a2ce7b83ba054e0f88%7Ctwcon%5Es1_c10&amp;amp;ref_url=https%3A%2F%2Fpublish.twitter.com%2F%3Fquery%3Dhttps3A2F2Ftwitter.com2FIntuitDev2Fstatus2F1099726219338223617widget%3DTweet"&gt;https://twitter.com/IntuitDev/status/1099726219338223617?ref_src=twsrc%5Etfw%7Ctwcamp%5Etweetembed%7Ctwterm%5E1099726219338223617%7Ctwgr%5E2b784b62e4dd0a142337b1a2ce7b83ba054e0f88%7Ctwcon%5Es1_c10&amp;amp;ref_url=https%3A%2F%2Fpublish.twitter.com%2F%3Fquery%3Dhttps3A2F2Ftwitter.com2FIntuitDev2Fstatus2F1099726219338223617widget%3DTweet&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;Learning from my experience, you can see that attending a hackathon is a powerful way to improve professional skills, build your career and expand your network. If you have never taken part in a hackathon, I hope this article convinces you to give it a try.&lt;/p&gt;

</description>
      <category>hackathon</category>
      <category>career</category>
      <category>networking</category>
      <category>softskills</category>
    </item>
    <item>
      <title>Module Federation Lifehack - Custom Container Name</title>
      <dc:creator>Oleksandr Khivrych</dc:creator>
      <pubDate>Sun, 02 Oct 2022 20:14:12 +0000</pubDate>
      <link>https://dev.to/sashakhivrych/module-federation-lifehack-custom-container-name-lok</link>
      <guid>https://dev.to/sashakhivrych/module-federation-lifehack-custom-container-name-lok</guid>
      <description>&lt;h3&gt;
  
  
  Intro
&lt;/h3&gt;

&lt;p&gt;I have been using Module Federation Plugin for almost &lt;strong&gt;two years&lt;/strong&gt; and have successfully used them for implementing &lt;strong&gt;micro-frontend&lt;/strong&gt; architectures for many organisations. I decided to start sharing lifehacks related to module federation, which may save some time for other engineers trying to integrate Module Federation into their projects.&lt;/p&gt;

&lt;p&gt;If you are not familiar with Module Federation Plugin, you can read my article at Beamery Hacking Talent Blog &lt;a href="https://medium.com/hacking-talent/module-federation-for-distributed-front-ends-the-best-of-both-worlds-bb6af9e4000e"&gt;Module Federation for distributed front ends the best of both worlds?&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Problem statement
&lt;/h3&gt;

&lt;p&gt;If you use monorepo for your micro-frontends, coupled with tools such as &lt;a href="https://classic.yarnpkg.com/lang/en/docs/workspaces/"&gt;Yarn Workspaces&lt;/a&gt;, &lt;a href="https://nx.dev/"&gt;NX&lt;/a&gt; or &lt;a href="https://turborepo.org/"&gt;Turborepo&lt;/a&gt;, you probably use &lt;a href="https://docs.npmjs.com/cli/v8/using-npm/scope"&gt;package scope&lt;/a&gt; for your monorepo. Scopes are a way of grouping related packages together. For example: &lt;code&gt;@somescope/somepackagename&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Let's say you have monorepo with two micro-frontend apps. The name of each micro app in &lt;code&gt;package.json&lt;/code&gt; will be:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;@my-micro-fe/app1&lt;/code&gt;- host.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;@my-micro-fe/app2&lt;/code&gt;- remote container&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And in the host &lt;code&gt;@my-micro-fe/app1&lt;/code&gt;, you want to import the module with the Button component from remote container &lt;code&gt;@my-micro-fe/app2&lt;/code&gt;, example:&lt;br&gt;
&lt;/p&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;RemoteButton&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;lazy&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@my-micro-fe/app2/Button&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;Sounds good! However, to make it work, we need to configure Module Federation Plugin correctly.&lt;/p&gt;

&lt;p&gt;Flowing &lt;a href="https://webpack.js.org/concepts/module-federation/"&gt;documentation&lt;/a&gt;, we should specify such a Module Federation config for &lt;code&gt;@my-micro-fe/app2&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;ModuleFederationPlugin&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@my-micro-fe/app2&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&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;remoteEntry.js&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;exposes&lt;/span&gt;&lt;span class="p"&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;./Button&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;./src/Button&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="na"&gt;shared&lt;/span&gt;&lt;span class="p"&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;react&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;react-dom&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you then run webpack build command, you will receive an error:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Error: Library name base (@my-micro-fe/app2) must be a valid identifier when using a var 
declaring library type. Either use a valid identifier (e. g. _my_micro_fe_app2) or use a 
different library type (e. g. 'type: "global"', which assign a property on the global scope
 instead of declaring a variable). Common configuration options that specific library names
are 'output.library[.name]', 'entry.xyz.library[.name]', 'ModuleFederationPlugin.name' and 'ModuleFederationPlugin.library[.name]'.

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  Solution
&lt;/h3&gt;

&lt;p&gt;The problem is Module Federation plugin under the hood uses variable declaration for remote container scope. To fix this issue, you need to sanitize your app name to remove &lt;code&gt;/,-,@&lt;/code&gt; special characters and add a few more lines in the configuration with &lt;code&gt;library.name&lt;/code&gt; and &lt;code&gt;library.type&lt;/code&gt; properties:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;ModuleFederationPlugin&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
   &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@my-micro-fe/app2&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&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;remoteEntry.js&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;exposes&lt;/span&gt;&lt;span class="p"&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;./Button&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;./src/Button&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="na"&gt;library&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;global&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;_micro_fe_app2&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="na"&gt;shared&lt;/span&gt;&lt;span class="p"&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;react&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;react-dom&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The same fix you need to do in the host app:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;    &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;ModuleFederationPlugin&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
      &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@my-micro-fe/app1&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;library&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;global&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;_micro_fe_app1&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="na"&gt;remotes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@my-micro-fe/app2&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`promise new Promise(resolve =&amp;gt; {
          const remoteUrlWithVersion = 'http://localhost:3002/remoteEntry.js'
          const script = document.createElement('script')
          script.src = remoteUrlWithVersion
          script.onload = () =&amp;gt; {
            // the injected script has loaded and is available on window
            // we can now resolve this Promise
            const proxy = {
              get: (request) =&amp;gt; window._micro_fe_app2.get(request),
              init: (arg) =&amp;gt; {
                try {
                  return window._micro_fe_app2.init(arg)
                } catch(e) {
                  console.log('remote container already initialized')
                }
              }
            }
            resolve(proxy)
          }
          // inject this script with the src set to the versioned remoteEntry.js
          document.head.appendChild(script);
        })
        `&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="na"&gt;shared&lt;/span&gt;&lt;span class="p"&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;react&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;react-dom&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see, for our &lt;code&gt;@my-micro-fe/app2&lt;/code&gt; host app, I have also sanitized the name. Moreover, I am using &lt;a href="https://webpack.js.org/concepts/module-federation/#promise-based-dynamic-remotes"&gt;&lt;code&gt;pormise new Promise&lt;/code&gt;&lt;/a&gt; syntax to load &lt;code&gt;remoteEntry.js&lt;/code&gt; file from the remote container &lt;code&gt;@my-micro-fe/app1&lt;/code&gt;. That is why I also use the sensitized name to save the result of a request to the &lt;code&gt;window&lt;/code&gt; object.&lt;/p&gt;

&lt;h3&gt;
  
  
  In addition
&lt;/h3&gt;

&lt;p&gt;This was just a simple example and you can instead create a base &lt;code&gt;webpack&lt;/code&gt; config where you can sanitize the app name and generate correct remotes config using &lt;code&gt;pormise new Promise&lt;/code&gt; to reduce code duplication.&lt;/p&gt;

&lt;h4&gt;
  
  
  I hope this tip was helpful for you!
&lt;/h4&gt;

&lt;p&gt;Cheers! 🍺&lt;/p&gt;

</description>
      <category>modulefederation</category>
      <category>microfrontends</category>
      <category>webpack</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
