<?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 How to convert a widget view to use ES modules? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-convert-a-widget-view-to-use-es-modules/m-p/1078868#M73867</link>
    <description>&lt;P&gt;My goal is to add a new button to the Sketch widget. I'm starting with the provided &lt;A href="https://github.com/Esri/arcgis-js-api/blob/4master/widgets/Sketch.tsx" target="_self"&gt;sketch.tsx&lt;/A&gt; view code.&amp;nbsp; My Angular project is using ES modules so I need to convert all of the imports to @arcgis/core.&amp;nbsp; I've found several cases where declarations do not exist in the code sample below.&lt;BR /&gt;&lt;BR /&gt;Is there an available Sketch.tsx available using ES Modules?&lt;BR /&gt;Is there a way around this problem?&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Example original import
import Graphic from "esri/widgets/../Graphic";
// Converted ES module import :)
import Graphic from "@arcgis/core/Graphic"

// These example imports have no ES equivalents :(
import Selector from "esri/widgets/support/Selector";
import { VNode } from "esri/widgets/support/interfaces"; 
import SketchMessages from "esri/widgets/Sketch/t9n/Sketch"
import { CreateTool } from "esri/widgets/Sketch/support/interfaces";



&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 14 Jul 2021 19:11:07 GMT</pubDate>
    <dc:creator>ShaneBuscher1</dc:creator>
    <dc:date>2021-07-14T19:11:07Z</dc:date>
    <item>
      <title>How to convert a widget view to use ES modules?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-convert-a-widget-view-to-use-es-modules/m-p/1078868#M73867</link>
      <description>&lt;P&gt;My goal is to add a new button to the Sketch widget. I'm starting with the provided &lt;A href="https://github.com/Esri/arcgis-js-api/blob/4master/widgets/Sketch.tsx" target="_self"&gt;sketch.tsx&lt;/A&gt; view code.&amp;nbsp; My Angular project is using ES modules so I need to convert all of the imports to @arcgis/core.&amp;nbsp; I've found several cases where declarations do not exist in the code sample below.&lt;BR /&gt;&lt;BR /&gt;Is there an available Sketch.tsx available using ES Modules?&lt;BR /&gt;Is there a way around this problem?&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Example original import
import Graphic from "esri/widgets/../Graphic";
// Converted ES module import :)
import Graphic from "@arcgis/core/Graphic"

// These example imports have no ES equivalents :(
import Selector from "esri/widgets/support/Selector";
import { VNode } from "esri/widgets/support/interfaces"; 
import SketchMessages from "esri/widgets/Sketch/t9n/Sketch"
import { CreateTool } from "esri/widgets/Sketch/support/interfaces";



&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jul 2021 19:11:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-convert-a-widget-view-to-use-es-modules/m-p/1078868#M73867</guid>
      <dc:creator>ShaneBuscher1</dc:creator>
      <dc:date>2021-07-14T19:11:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a widget view to use ES modules?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-convert-a-widget-view-to-use-es-modules/m-p/1078952#M73871</link>
      <description>&lt;P&gt;I've also just come across, I think, a similar problem for &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html" target="_self"&gt;IdentityManager&lt;/A&gt;. In my case I'm trying to move a React project from using &lt;A href="https://github.com/Esri/esri-loader" target="_self"&gt;esri-loader&lt;/A&gt; local &lt;A href="https://developers.arcgis.com/javascript/latest/es-modules/" target="_self"&gt;es imports&lt;/A&gt;&amp;nbsp;and this was the one module that I'm not sure about. I know that it is a singleton, maybe there is a special approach for this? Will start a new thread if the answer to this is different than for authors original question.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jul 2021 20:57:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-convert-a-widget-view-to-use-es-modules/m-p/1078952#M73871</guid>
      <dc:creator>RyanSutcliffe</dc:creator>
      <dc:date>2021-07-14T20:57:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a widget view to use ES modules?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-convert-a-widget-view-to-use-es-modules/m-p/1079161#M73885</link>
      <description>&lt;P&gt;If you are converting to ES modules this should work:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;import IdentityManager from '@arcgis/core/identity/IdentityManager';&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jul 2021 12:16:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-convert-a-widget-view-to-use-es-modules/m-p/1079161#M73885</guid>
      <dc:creator>ShaneBuscher1</dc:creator>
      <dc:date>2021-07-15T12:16:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a widget view to use ES modules?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-convert-a-widget-view-to-use-es-modules/m-p/1081624#M73975</link>
      <description>&lt;P&gt;You're right. That works. Could have sworn I tried that before and had issues with the `registerToken` method but seems to work fine now so not sure what I did. Thanks and sorry to hijack your question with this distraction.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jul 2021 05:06:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-convert-a-widget-view-to-use-es-modules/m-p/1081624#M73975</guid>
      <dc:creator>RyanSutcliffe</dc:creator>
      <dc:date>2021-07-22T05:06:41Z</dc:date>
    </item>
  </channel>
</rss>

