<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to architect a micro-frontends project under ArcGIS JS API? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-architect-a-micro-frontends-project-under/m-p/1281663#M80937</link>
    <description>&lt;DIV class=""&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;Thank you very much for your reply. I am using the SDK with ESM. Following your advice, I modified my code structure like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;mfe-arcgis-api
├── package.json
├── readme.md
├── api (arcgis js api)
│   ├── src
│   ├── package.json
│   ├── webpack.config.js
│   └── ...
├── host
│   ├── src
│   ├── package.json
│   ├── webpack.config.js
│   └── ...
└── remote 
    ├── src
    ├── package.json
    ├── webpack.config.js
    └── ...&lt;/PRE&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;My host's webpack5 config:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;new ModuleFederationPlugin({
      name: "host",
      filename: "remoteEntry.js",
      remotes: {
        api: "api@http://localhost:8000/remoteEntry.js",
        remote: "remote@http://localhost:3000/remoteEntry.js",
      },
      //  ...
}&lt;/PRE&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;usage&lt;/SPAN&gt;&lt;SPAN class=""&gt;: &lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;import ArcGISMap from "api/Map"; // which from my api application
import MapView from "api/views/MapView";&lt;/PRE&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;Both the host and remote get the SDK from the "api", ensuring that Accessor is the same class. Now this simple demo is sufficient for my needs. However, I still hope that the official documentation can provide more elegant examples, similar to those in [Esri/jsapi-resources](&lt;/SPAN&gt;&lt;A href="https://github.com/Esri/jsapi-resources" target="_blank" rel="noopener"&gt;&lt;SPAN class=""&gt;https://github.com/Esri/jsapi-resources&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN class=""&gt;). Thank you again for your response, which has pointed me in the right direction.&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
    <pubDate>Sun, 23 Apr 2023 01:32:06 GMT</pubDate>
    <dc:creator>DaoYu</dc:creator>
    <dc:date>2023-04-23T01:32:06Z</dc:date>
    <item>
      <title>How to architect a micro-frontends project under ArcGIS JS API?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-architect-a-micro-frontends-project-under/m-p/1277677#M80841</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello, I'm trying to architect a microfrontend project under ArcGIS JSAPI. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;However, I've encountered a critical issue where different remote applications using the ArcGIS JS API result in an error,such as&amp;nbsp;„Logger.js:5 [esri.core.Accessor] Accessor#set Assigning an instance of 'esri.geometry.SpatialReference' which is not a subclass of 'esri.geometry.SpatialReference“&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I've read similar issues such as "&lt;A href="https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/problem-using-es-modules-in-webpack-module/m-p/1129100" target="_blank"&gt;https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/problem-using-es-modules-in-webpack-module/m-p/1129100&lt;/A&gt;", but there doesn't seem to be an out-of-the-box solution provided. I was wondering if there were any progress or shared knowledge from the internal team regarding microfrontends?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;---&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I can probably guess the reason for this error. I instantiated the Access class of the API in different micro-frontends that are not aware of each other, which has to do with the prototype chain. However, I'm not sure how to handle this issue.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2023 08:33:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-architect-a-micro-frontends-project-under/m-p/1277677#M80841</guid>
      <dc:creator>DaoYu</dc:creator>
      <dc:date>2023-04-12T08:33:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to architect a micro-frontends project under ArcGIS JS API?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-architect-a-micro-frontends-project-under/m-p/1277816#M80846</link>
      <description>&lt;P&gt;This is going to depend on how you are using the SDK. You can't mix builds different builds.&lt;/P&gt;&lt;P&gt;Are these different components? Like you have some pieces for displaying legend, layerlist on one port, something to handle the map on another port? One solution is to have your components take ArcGIS Modules as inputs, so your "main" application supplies the ArcGIS SDK modules and your components instantiate them. That would help to solve this issue. There is not really a clean story here.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2023 14:38:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-architect-a-micro-frontends-project-under/m-p/1277816#M80846</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2023-04-12T14:38:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to architect a micro-frontends project under ArcGIS JS API?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-architect-a-micro-frontends-project-under/m-p/1281663#M80937</link>
      <description>&lt;DIV class=""&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;Thank you very much for your reply. I am using the SDK with ESM. Following your advice, I modified my code structure like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;mfe-arcgis-api
├── package.json
├── readme.md
├── api (arcgis js api)
│   ├── src
│   ├── package.json
│   ├── webpack.config.js
│   └── ...
├── host
│   ├── src
│   ├── package.json
│   ├── webpack.config.js
│   └── ...
└── remote 
    ├── src
    ├── package.json
    ├── webpack.config.js
    └── ...&lt;/PRE&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;My host's webpack5 config:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;new ModuleFederationPlugin({
      name: "host",
      filename: "remoteEntry.js",
      remotes: {
        api: "api@http://localhost:8000/remoteEntry.js",
        remote: "remote@http://localhost:3000/remoteEntry.js",
      },
      //  ...
}&lt;/PRE&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;usage&lt;/SPAN&gt;&lt;SPAN class=""&gt;: &lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;import ArcGISMap from "api/Map"; // which from my api application
import MapView from "api/views/MapView";&lt;/PRE&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;Both the host and remote get the SDK from the "api", ensuring that Accessor is the same class. Now this simple demo is sufficient for my needs. However, I still hope that the official documentation can provide more elegant examples, similar to those in [Esri/jsapi-resources](&lt;/SPAN&gt;&lt;A href="https://github.com/Esri/jsapi-resources" target="_blank" rel="noopener"&gt;&lt;SPAN class=""&gt;https://github.com/Esri/jsapi-resources&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN class=""&gt;). Thank you again for your response, which has pointed me in the right direction.&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 23 Apr 2023 01:32:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-architect-a-micro-frontends-project-under/m-p/1281663#M80937</guid>
      <dc:creator>DaoYu</dc:creator>
      <dc:date>2023-04-23T01:32:06Z</dc:date>
    </item>
  </channel>
</rss>

