<?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 Improve Build Performance in Next.js/Webpack with @arcgis? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-improve-build-performance-in-next-js/m-p/1583143#M86489</link>
    <description>&lt;P&gt;Thanks - top tier answers!&lt;/P&gt;</description>
    <pubDate>Fri, 07 Feb 2025 15:24:42 GMT</pubDate>
    <dc:creator>JonathanDawe3</dc:creator>
    <dc:date>2025-02-07T15:24:42Z</dc:date>
    <item>
      <title>How to Improve Build Performance in Next.js/Webpack with @arcgis?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-improve-build-performance-in-next-js/m-p/1583093#M86483</link>
      <description>&lt;P&gt;I've been working on a project using Next.js with the ArcGIS API but ultimately reverted to using TanStack Router with Vite due to significant developer experience issues. While the production build works fine, the development process has been extremely frustrating.&lt;/P&gt;&lt;H4&gt;&lt;U&gt;Project Context&lt;/U&gt;&lt;/H4&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;Next.js branch:&amp;nbsp;&lt;A href="https://github.com/JonnyDawe/UK-Sewage-Map/tree/Bugfix/dischargetimelines" target="_self"&gt; NextJS application.&amp;nbsp;&amp;nbsp;&lt;/A&gt;&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Vite + TanStack branch:&amp;nbsp;&lt;A href="https://github.com/JonnyDawe/UK-Sewage-Map/tree/main" target="_self"&gt;using tanstack for routing.&lt;/A&gt;&lt;/STRONG&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Key Issues with Next.js&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;Slow development process compared to other mapping libraries&lt;/STRONG&gt; – Any change to a component triggers a full rebuild, taking 40–60 seconds, and requires a manual page refresh to see updates. In contrast, Vite's dependency pre-building enables near-instant updates without a full rebuild. I've built highly interactive mapping applications with Next.js before (e.g. &lt;A href="https://www.icelogistics.info/antarctic" target="_new" rel="noopener"&gt;&lt;SPAN&gt;icelogistics&lt;/SPAN&gt;&lt;SPAN&gt;.info&lt;/SPAN&gt;&lt;SPAN&gt;/antarctic&lt;/SPAN&gt;&lt;/A&gt;) using Leaflet, but the experience with ArcGIS has been significantly slower.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Turbopack incompatibility&lt;/STRONG&gt; – Some ArcGIS packages depend on Stencil.js, which uses dynamic imports and custom Webpack comments that fail to compile in Turbopack.&lt;/LI&gt;&lt;/OL&gt;&lt;H4&gt;Questions&lt;/H4&gt;&lt;UL&gt;&lt;LI&gt;Has anyone successfully optimised the development experience of using Next.js with the ArcGIS API?&lt;/LI&gt;&lt;LI&gt;Are there any known workarounds for handling Stencil.js dependencies in Next.js/Turbopack?&lt;/LI&gt;&lt;LI&gt;Is there any active work being done to improve ArcGIS compatibility with frameworks like Next.js? Will this get better in the future, or would the advice be to avoid it where possible?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I’d prefer to continue using Next.js, but the current ArcGIS compatibility issues make it challenging. Any insights or workarounds would be greatly appreciated!&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2025 14:05:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-improve-build-performance-in-next-js/m-p/1583093#M86483</guid>
      <dc:creator>JonathanDawe3</dc:creator>
      <dc:date>2025-02-07T14:05:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to Improve Build Performance in Next.js/Webpack with @arcgis?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-improve-build-performance-in-next-js/m-p/1583103#M86485</link>
      <description>&lt;P&gt;Things will get better&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;.&amp;nbsp; We are migrating away from stencil for our web components beginning at version 4.32 so that should help with your Turbopack issues. We are also working on optimizing the web components to work better with frameworks.&amp;nbsp; If you use react 19 for instance you will no longer need to use the react specific wrapper, you'll be able to use the normal native web components.&amp;nbsp; I don't have any specific build optimization suggestions for you right now as I'm not all that familiar with Next.js but we are trying to make things better for framework users.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2025 14:19:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-improve-build-performance-in-next-js/m-p/1583103#M86485</guid>
      <dc:creator>Sage_Wall</dc:creator>
      <dc:date>2025-02-07T14:19:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to Improve Build Performance in Next.js/Webpack with @arcgis?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-improve-build-performance-in-next-js/m-p/1583110#M86486</link>
      <description>&lt;P&gt;Fantastic! Thats really useful information to know! Especially regarding the switch away from StencilJS... To be blunt, the majority of any build/types/testing issues I've ever seen with ArcGIS seem to have come from the Stencil JS library&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Regarding react 19, I made a bit of an attempt to switch over to using the web components natively already!&amp;nbsp;Currently its not been super clear to me whether there is a pattern we should be following for getting the types for the web components? In fact I've been rather hamfistedly adding them in myself&amp;nbsp;&lt;SPAN class="lia-unicode-emoji"&gt;&lt;span class="lia-unicode-emoji" title=":grimacing_face:"&gt;😬&lt;/span&gt;&lt;/SPAN&gt;&lt;A href="https://github.com/JonnyDawe/UK-Sewage-Map/blob/main/src/types/global.d.ts" target="_blank" rel="nofollow noopener noreferrer"&gt;https://github.com/JonnyDawe/UK-Sewage-Map/blob/main/src/types/global.d.ts.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;This implementation gives me the allowed props, but unfortunately strips out the actual types for them (everything ends up as any)... From my investigations it looked like a StencilJS build quirk, so maybe this will also get simpler!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2025 14:26:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-improve-build-performance-in-next-js/m-p/1583110#M86486</guid>
      <dc:creator>JonathanDawe3</dc:creator>
      <dc:date>2025-02-07T14:26:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to Improve Build Performance in Next.js/Webpack with @arcgis?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-improve-build-performance-in-next-js/m-p/1583121#M86488</link>
      <description>&lt;P&gt;At version 4.32 (or RC currently) you'll be able to get the React types (and some other frameworks) by including them using a /// comment or you could also add the types in the includes section of your tsconfig if you wanted to do it there.&lt;/P&gt;&lt;P&gt;I've been adding an arcgis.d.ts file in my src folder with this in it, but that's just my preferred way not official Esri advise&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;/// &amp;lt;reference types="@arcgis/map-components/types/react.d.ts" /&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;tsconfig.app.json&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;...,
"include": ["src", "node_modules/@arcgis/map-components/types/react.d.ts"]
...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2025 14:54:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-improve-build-performance-in-next-js/m-p/1583121#M86488</guid>
      <dc:creator>Sage_Wall</dc:creator>
      <dc:date>2025-02-07T14:54:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to Improve Build Performance in Next.js/Webpack with @arcgis?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-improve-build-performance-in-next-js/m-p/1583143#M86489</link>
      <description>&lt;P&gt;Thanks - top tier answers!&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2025 15:24:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-improve-build-performance-in-next-js/m-p/1583143#M86489</guid>
      <dc:creator>JonathanDawe3</dc:creator>
      <dc:date>2025-02-07T15:24:42Z</dc:date>
    </item>
  </channel>
</rss>

