<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Gaurav Poojari on Medium]]></title>
        <description><![CDATA[Stories by Gaurav Poojari on Medium]]></description>
        <link>https://medium.com/@gaurav.poojari?source=rss-e9f9ea377e43------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*cUFwGWJhm6LyUkde</url>
            <title>Stories by Gaurav Poojari on Medium</title>
            <link>https://medium.com/@gaurav.poojari?source=rss-e9f9ea377e43------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 05:28:57 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@gaurav.poojari/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[AEM Micro Frontend Design]]></title>
            <link>https://medium.com/@gaurav.poojari/aem-micro-frontend-integration-aee64e923b00?source=rss-e9f9ea377e43------2</link>
            <guid isPermaLink="false">https://medium.com/p/aee64e923b00</guid>
            <category><![CDATA[single-page-applications]]></category>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[micro-frontends]]></category>
            <category><![CDATA[aem]]></category>
            <dc:creator><![CDATA[Gaurav Poojari]]></dc:creator>
            <pubDate>Fri, 03 Dec 2021 07:32:59 GMT</pubDate>
            <atom:updated>2022-04-09T14:35:09.583Z</atom:updated>
            <content:encoded><![CDATA[<p>This blog represents the details on how to achieve the AEM and React integration using the micro frontend architecture.<br>After reading the article we should be able to develop an AEM website which can have components with different UI frameworks/modules.</p><p><strong>What is Micro Frontend architecture ?<br></strong>Micro Frontend architecture is an design approach in which a front-end app is decomposed into individual, semi-independent “microapps” working loosely together.</p><p>It’s approach is rooted in the concept that a web application is a compilation of independent features that can be developed by different teams and then fused to create a homogenous interface.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/683/1*spA1nTAxsY2LGTQCXS0S4A.png" /></figure><h4><strong>Pros :</strong></h4><ol><li><strong>Scalability : </strong>Ability to use the components in any page independent from the template scope.</li><li><strong>Reuseability: </strong>The components can be used with any project having the same functional requirement.</li><li><strong>Loosely Coupled : </strong>Micro Frontend architecture gives the flexibility to integrate multiple UI frameworks in the project without making the project dependent on a specific UI framework.</li><li><strong>Lightweight : </strong>Reduces the load size of the source code since only components which are needed , the source for only that component is loaded instead of the whole components library.</li></ol><h4>Cons :</h4><ol><li><strong>Performance Factor :</strong> Since multiple micro apps with different frameworks are loaded in a webpage , managing and analyzing the page performance can be a challenge.</li><li><strong>Complex Structure :</strong> Managing multiple FE modules can be complicated interm’s of maintaining build pipelines..</li></ol><h3>AEM-Micro Frontend Fusion :</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*diaJHwu7H1o5fkTclEekmw.png" /></figure><p>This architecture pattern would make the AEM website more scalable and modular , Following are the advantages :</p><p><strong>1. Multi Module Scaling: </strong>This pattern would allow the developers flexibility to choose the UI framework as per the business requirements and needs and create multiple modules with different frameworks and configurations that can be managed efficiently.</p><p><strong>2. Loosely Coupled : </strong>By making the FE module loosely coupled with the page and allowing to configure different components with different frameworks such as (React , Angular, Vue etc) makes the project scalable.</p><p><strong>3. Author Anywhere : </strong>The components developed with this approach can be used on any template since it’s not tightly coupled with the project template.</p><p><strong>4. Avoids Page Breakdown : </strong>Since the components are loosely coupled and modular, failure in one component will not make the webpage break and would not impact the rest of the components in the page.</p><h3>AEM-Micro Frontend Integration Steps :</h3><p>In the following example, an sample component (shown in the below image) is been built which uses the micro frontend architecture approach.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9-bQlpRETWP9MWd_" /></figure><p>below are the steps to be implemented -</p><p><strong>How does this work? :</strong></p><p>All the components will be loaded independently with their own set of dependencies , the component would be rendered under a wrapper element having a component specific data- attribute.</p><p>In the below steps will develop a category gallery component as a sample component.</p><p>Following would be the DOM Structure :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pPTFaBp1YyJGM-4I" /></figure><p><strong>data-compid : </strong>This attribute will be needed to identify and render the react component specific to the data-attribute under the wrapper div.</p><p><strong>data-compprops :</strong> This attribute will have the data props in the form of json needed to be displayed and is authored in the component level.</p><p><strong>React FrontEnd Module Changes :</strong></p><p><strong>Structure</strong> -<br>Below is the FE module structure ,the default FE module can be generated using the maven archetype configuration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/315/0*O9wqe7B_Xmlb9wbp" /></figure><p><strong>a) POM Configuration For FE Module :<br></strong>for managing and installing the Node/NPM locally and dependencies we use maven frontend plugin. This plugin allows us to configure npm tasks / scripts , run unit tests.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/881/0*SVWVXVI6umu1R1D5" /></figure><p><strong>b) Package.json :<br></strong>Need to specify the needed dependencies and scripts config needed for building and processing the code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/0*dV7kUE9VTfOjSC9T" /></figure><p><strong>c) Webpack Configuration:</strong><br>Needed for compiling the frontend code such as (js, jsx) etc and bundling it into independent components.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/0*LXaO6XoK5s0SFDM8" /></figure><p><strong>d) Component Logic :<br></strong>Below is the logic of the sample react component to be loaded.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/969/0*d3afgEGN8PDDDBSk" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/841/0*JGw-ZfybyXQnrdUX" /></figure><p><strong>FE Build Output :</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/286/0*sENQhzvj_apVp80U" /></figure><p><strong>BackEnd Module and AEM Changes :</strong></p><p>Following are the items for implementation :</p><p><strong>1. Component Dialog Creation:<br></strong>We will create the component dialog for the category gallery component , below is the node structure and dialog image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*NK7Zcad2Ux1ynGlB" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*P90hPfFt15yZzUHq" /></figure><p><strong>2. HTML Logic:<br></strong>Provide a placeholder wrapper element in which the react component would render. This will also include the react library inclusion shown in below snippet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/989/1*PsQR0nxy0jLA8LL6XiA67Q.png" /></figure><p><strong>3. Sling Model :<br> </strong>We will be creating an sling model class for exposing the component jcr properties in the form of props and assign it to data-compprops which would be picked up by react component.</p><p><strong>4. Component Serializer Class :</strong><br> This class is needed to serialize the sling model object into a json object.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/0*-qvWvlRiRpQClkKU" /></figure><p><strong>Conclusion :</strong></p><p><strong>The above integration steps can be served as a solution for below :</strong> <strong><br>1.</strong> Making react components independent and loosely coupled which can be used on any AEM page irrespective of which FE framework is being used.</p><p><strong>2.</strong> Authoring components with different UI framework in any sequence or order in a page.</p><p><strong>3.</strong> Loading the react component library which are only authored in the page hence reduce the script load size.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aee64e923b00" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>