Esri / cedar

JavaScript Charts for ArcGIS
https://esri.github.io/cedar
256 stars 238 forks source link

UMD bundles include arcgis-rest-js dependencies #487

Open tomwayson opened 3 years ago

tomwayson commented 3 years ago

If you search the UMD bundle for "queryFeatures" you'll see the source for that function (as well as the source decodeValues() and request(), etc. This is despite the fact that it's marked as external:

https://github.com/Esri/cedar/blob/b4e7069383c0b8789f7024c96878e9038fbd13d8/packages/cedar/profiles/base.js#L22-L24

What makes this worse is that package.main points the the UMD build:

https://github.com/Esri/cedar/blob/b4e7069383c0b8789f7024c96878e9038fbd13d8/packages/cedar/package.json#L8

Originally the thinking was that we didn't want to bother making a CJS build and node could just load the UMD bundle, but now bundlers like webpack that prefer main over module will use this UMD bundle by default.

tomwayson commented 3 years ago

Ooops, looks like we forgot to update the profile to @esri/arcgis-rest-feature-layer

https://github.com/Esri/cedar/blob/b4e7069383c0b8789f7024c96878e9038fbd13d8/packages/cedar/src/query/query.ts#L7