Skip To ContentArcGIS for DevelopersSign In Dashboard

Breaking changes

A comprehensive guide to all breaking changes for the ArcGIS API for JavaScript, ordered by release version. This guide is helpful for people upgrading versions of the API in their app(s). Scroll down to find the current version of the API in use, then follow the changes up to the latest version, and make the relevant updates.

To see all the latest features and advancements, please refer to the Release Notes. To see all the added features and advancements from all versions, please refer to the Previous Versions Release Notes section.

4.17

  • For better memory management, view.destroy() now destroys all attached resources, including the map. To prevent the map from being destroyed, you can unset the map before calling destroy().
// destroy the view and all attached resources
view.destroy();

// unset map from the view so that it is not destroyed
// then destroy the view and all attached resources
const map = view.map;
view.map = null;
view.destroy();
  • The ActionButton and ActionToggle classes now correctly implement their types as either button or toggle. Prior to this, it was set as string.
  • The goToMedia() method in the Feature widget and its corresponding viewModel has been renamed to setActiveMedia.
  • The tables property for WebMap now takes a collection of Layers instead of an array of Objects.
  • The TimeSlider.loop property now has a default value of false instead of true.
  • Service metadata for all layers and tables are now collectively fetched from FeatureServer/layers/REST endpoint as opposed to each layer fetching its metadata from its dedicated endpoint, e.g. (FeatureServer/<layerID>).
  • StreamLayer.maximumTrackPoints was deprecated at version 4.15 and is now removed. Use StreamLayer.purgeOptions.maxObservations instead.
  • Using applyEdits to add geometries with z-values to a FeatureLayer with hasZ: false no longer silently drops the z-value and now throws an error.
  • Performance improvements were made to Popups. Prior to this release, it was possible to access the popup feature's geometry without having to specify outFields on the FeatureLayer or the PopupTemplate. It was always recommended to set this, but was never required. Going forward, if needing access to the underlying feature's geometry, this property must be set. This also holds true if working with WebMaps containing popups. If a popup does not have a referenced Arcade expression that works with geometry, it is now required to access either the WebMap's layer or its PopupTemplate and set the outFields.

4.16

  • Removed Dojo promises. Native Promises have been activated by default. The has flag "esri-native-promise" is no longer supported.
  • Removed use of Dojo’s declare module. This means that apps with classes that leverage the API class framework and multiple inheritance will stop working. The recommended approach is to use mixins with Accessor.
  • The TileImageryLayer is removed and replaced by the ImageryTileLayer.
  • The TimeExtent's intersection method now returns an instance of TimeExtent with undefined values for start and end properties if the two time extents do not intersect.
  • The suspended property of the View is now set to false when the view container's css style visibility is set to hidden (visibility:hidden). The view is hidden but it renders and updates data now.
  • CIMSymbol's data property now only supports CIMSymbolReference JSON. The CIMSymbol JSON should be applied at cimSymbol.data.symbol.

4.15

4.14

  • When the propagation of an event is stopped on the View, then the propagation of any derived events are stopped. For example, when stopPropagation() is called on an immediate-click event, click and double-click events are no longer emitted. When stopPropagation() is called on an pointer-up event, immediate-click, click and double-click are no longer emitted. This makes implementing event handlers easier, since applications usually want to handle only one of those event types at a time.
  • FeatureLayerView.queryFeatures and GeoJSONLayerView.queryFeatures results will no longer include z-values in 2D MapView even if the query.returnZ is set to true.
  • The Sketch has a new property called creationMode with a default value of continuous. This allows you to continuously create graphics with same geometry types by default. This is different from the widget's default behavior in previous releases, where you could create a single graphic at a time.
  • To select or unselect multiple vertices during a graphic update operation using the Sketch widget, we now use Shift + Left-click combination instead of Ctrl + Left-click on vertices.
  • 2D measurement widgets changed the base class from esri-area-measurement-3d to esri-area-measurement-2d and from esri-direct-line-measurement-3d to esri-distance-measurement-2d.
  • Removed the getImageUrl() method from MapImageLayer. This method was deprecated since version 4.11. We recommend extending BaseDynamicLayer instead.
  • Removed the value-change and values-change events from Slider and HistogramRangeSlider. These events were deprecated since version 4.13. We recommend watching the values property or using the other widget events instead.
  • Removed Hindi (hi) as a supported locale.
  • Classes related to ArcGIS Workflow Manager have been removed. They were marked as deprecated starting with version 4.13.
  • The HTML sanitizer was added to all widgets to sanitize and escape strings according to the ArcGIS Online supported HTML specification. This can cause HTML set in PopupTemplate.content or in other widgets to be removed.

4.13

4.12

4.11

  • The behavior of FeatureLayer.outFields has changed. It is no longer computed to include fields required for layer labeling, rendering, editing and elevation info. It now returns null unless it is explicitly set.
    • In general, you no longer need to specify the outFields. The API automatically determines which fields to fetch. However, if you are using the fields in custom functionality, you might still need to explicitly add those using the outFields property.
    • To find out which fields are available client-side, use the new availableFields property. It contains a list of attribute fields fetched for each feature including fields required for layer labeling, rendering, elevation info, and any additional fields defined with the FeatureLayer.outFields property. The availableFields is populated when the layer view is finished updating.
  • Query.units property's default value is now null instead of meters.
  • Sublayer.createFeatureLayer() now returns a promise resolving to a FeatureLayer, as opposed to a FeatureLayer.
  • Autocasting is no longer supported for Mesh geometry.
  • Change to how texture transparency is interpreted in esri/geometry/support/MeshMaterial. Before, values below 0.1 would be interpreted as fully transparent (i.e. masking), now this threshold was moved to 0.5. If the old behavior is desired, the threshold can now be explicitly changed using the alphaCutoff property.
  • Moved the select method out of FeatureTemplates and into the FeatureTemplatesViewModel.
  • Removed contentEnabled property on both the Feature widget and the FeatureViewModel.
  • Removed esri/geometry/ScreenPoint class.
  • Removed Legend support from MapNotesLayer.
  • Removed token property from all layer classes. The recommended approach to pass a token on a layer is to use IdentityManager.registerToken() or to use esriConfig.request.interceptors.
  • Removed the view property from Feature widget and FeatureViewModel.
  • The MapImageLayer.getImageUrl() method now returns null.
  • Renamed definitionExpression property of AttachmentQuery class to where.
  • Renamed definitionExpression property of RelationshipQuery class to where.
  • Renamed TemplateItemGroup.name to TemplateItemGroup.label.
  • Renamed FeatureLayerSearchSource class to LayerSearchSource.
  • As part of adding 3D drawing support, the 2D draw classes have moved:
  • Several popup related classes have been moved, renamed or removed:
    • Removed Chart class from esri/support/ContentElement/Media/Chart.
    • Removed Media class from esri/support/ContentElement/Media/Media.
    • ExpressionInfo class moved from esri/support/ExpressionInfo to esri/popup/ExpressionInfo.
    • FieldInfo class moved from esri/support/FieldInfo to esri/popup/FieldInfo.
    • LayerOptions class moved from esri/support/LayerOptions to esri/popup/LayerOptions.
    • RelatedRecordsInfo class moved from esri/support/RelatedRecordsInfo to esri/popup/RelatedRecordsInfo.
    • Renamed ContentElement class from esri/support/ContentElement to content and moved to esri/popup/content.
    • Renamed ContentElement class from esri/support/ContentElement/ContentElement to Content and moved to esri/popup/content/Content.
    • Renamed Attachments class from esri/support/ContentElement/Attachments to AttachmentsContent and moved to esri/popup/content/AttachmentsContent.
    • Renamed Fields class from esri/support/ContentElement/FieldsContent to FieldsContent and moved to esri/popup/content/FieldsContent.
    • Renamed Text class from esri/support/ContentElement/Text to TextContent and moved to esri/popup/content/TextContent.
    • Renamed Media class from esri/support/ContentElement/Media to MediaContent and moved to esri/popup/content/MediaContent.
    • Renamed BarChart class from esri/support/ContentElement/Media/BarChart to BarChartMediaInfo and moved to esri/popup/content/BarChartMediaInfo.
    • Renamed FieldsOrder class from esri/support/RelatedRecordsInfo/FieldOrder to RelatedRecordsInfoFieldOrder and moved to esri/popup/support/RelatedRecordsInfoFieldOrder.
    • Renamed Format class from esri/support/FieldInfo/Format to FieldInfoFormat and moved to esri/popup/support/FieldInfoFormat.
    • Renamed Series class from esri/support/ContentElement/Media/Chart/Series to ChartMediaInfoValueSeries and moved to esri/popup/content/support/ChartMediaInfoValueSeries.
    • Renamed Value class from esri/support/ContentElement/Media/Chart/Value to ChartMediaInfoValue and moved to esri/popup/content/support/ChartMediaInfoValue.
    • Renamed ColumnChart class from esri/support/ContentElement/Media/ColumnChart to ColumnChartMediaInfo and moved to esri/popup/content/ColumnChartMediaInfo.
    • Renamed LineChart class from esri/support/ContentElement/Media/LineChart to LineChartMediaInfo and moved to esri/popup/content/LineChartMediaInfo.
    • Renamed PieChart class from esri/support/ContentElement/Media/PieChart to PieChartMediaInfo and moved to esri/popup/content/PieChartMediaInfo.
    • Renamed Image class from esri/support/ContentElement/Media/Image to ImageMediaInfo and moved to esri/popup/content/ImageMediaInfo.
    • Renamed Value class from esri/support/ContentElement/Media/Image/Value to ImageMediaInfoValue and moved to esri/popup/content/support/ImageMediaInfoValue.
  • A graphic can only be in one GraphicsLayer at a time. When adding a graphic to a graphics layer, and if it is already in another graphics layer, the graphic is moved to the destination graphics layer.
  • The developer and user experiences for 2D highlights have been improved in three ways:
    • soft, anti-aliased edges
    • decreased default opacity that is now consistent with the default settings used in 3D
    • modified coverage algorithm that now highlights the transparent portions of lines and polygons

4.10

4.9

  • Bookmark class moved from esri/widgets/Bookmarks/Bookmark to esri/webmap/Bookmark.
  • FeatureLayer.queryFeatureAttachments() method is removed. Use FeatureLayer.queryAttachments instead.
  • Functions can no longer be used in renderers and visual variables in place of fields. Use the valueExpression property instead.
  • Removed esriConfig's request properties: corsDetection, corsDetectionTimeout, corsEnabledServers, forceProxy, and useCors properties.
  • Removed the allowImageDataAccess requestOption property from the esriRequest method. Also removed it as a property from MapImageLayer, BingMapsLayer, and OpenStreetMap options. The API automatically allows this without having to explicitly set it.
  • Removed the isMaxInclusive property from ClassBreaksRenderer.
  • Removed the popupOpenOnSelect property from Search widget and SearchViewModel.
  • Set the new trustedServers property available in esriConfig's request property if needing to include credentials such as cookies and authorization headers in cross origin requests. Prior to version 4.9, this would be handled by setting corsEnabledServers withCredentials property to true.
  • CSS style, esri-widget__header, was renamed to .esri-widget__heading. For additional information on working with this style, see the Styling guide topic.
  • SceneView.goTo() method now queries the target location for elevation if the target doesn't have a z-value. This means that the promise will not resolve immediately anymore, even if the animate option is set to false.

4.8

4.7

4.6

4.5

4.4

  • As of version 4.4, the response for the locator.locationToAddress() method returns a proper AddressCandidate. This bug fix affects two of five AddressCandidate properties: address and attributes. Note that there are no changes to the other AddressCandidate properties: extent, location and score.
    • Prior to 4.4, locationToAddress() incorrectly returned an object that always had an empty attributes property, and the address string was an object. As of 4.4, the address property is a string, and the attributes property will be populated.
    • Specifying an exact field, e.g. CountryCode, should now be written as attributes.CountryCode. (Prior to this version, it was written as address.CountryCode.)
    • The popup sample using reverse geocoding has been updated to reflect this change.
  • Esri icon font styles and codes have been updated, resulting in some codes being changed or used for new icon fonts.
  • ViewAnimation.stop() now rejects the ViewAnimation promise.
  • 3D Symbol layer types changed name style and now use kebab-casing to be consistent with the rest of the API.
  • The orientation of 3D WebStyleSymbols was updated. Now the forward-facing side of the symbol points in the direction of the y-axis (North). Setting a heading of 0 on a ObjectSymbol3DLayer will make the symbol point North and setting it to 180 will make the symbol point South. In comparison to the old styles, Signs and signals and Street scene changed orientation by 180 degrees and Transportation changed by 90 degrees.
  • As of version 4.x, the recommended approach to pass a token on a layer is to use IdentityManager.registerToken(). Prior to this in 3.x, it was possible to pass a token to a layer either via 1) the layer's token property, or 2) appending it to the end of the layer URL.
  • The Search widget's sources property has a new filter option which replaces the now deprecated searchQueryParams, suggestQueryParams, and searchExtent property.
  • If developing custom widgets, configuration settings should be updated to reflect "jsxFactory": "tsx", instead of "reactNamespace": "jsxFactory",. This is discussed in the TypeScript setup guide topic.
  • For the light values passed into external renderers, the balance between ambient and diffuse lighting has changed. This may result in a slightly different appearance for objects rendered with external renderers. The new light values represent colors/intensities in linear color space, and are optimized for gamma-corrected rendering with a gamma value of 2.1.
  • At 4.4, the view.click event will close the popup if the clicked location doesn't intersect a feature with a popup template. You may want to disable this default behavior if opening the popup with custom content or keep it open when the view is clicked. To do so, you must call stopPropagation() on the click event object.

4.3

4.2

  • The following VectorTileLayer properties are removed: ACCESS_TOKEN
  • To increase security, browsers are starting to block Geolocation API on insecure pages, meaning that the Locate button will not work from non-secure web pages (i.e., hosted on http). Google Chrome first implemented this in version 50 (April 2016) and Apple in Safari 10 (September 2016). Mozilla/Firefox is planning to do the same. At version 4.0 and 3.17 the JSAPI no longer displayed the Locate Button for non-secure web apps in the Chrome browser. As of version 4.2 and 3.19, the JSAPI no longer displays the Locate Button for non-secure web apps in any web browser. Note that localhost is considered "potentially secure" and can be used for easy testing.

4.1

4.0

This was the first official release of the 4x API. Since the prior 4x releases were in beta, they will not be considered here.

Content