Esri/react-arcgis

Update to Version 4.11

Closed this issue · 9 comments

I am trying to update my version to 4.11, I updated the esri-loader in the dependencies but still showing 4.10 as the version that is showing up. I also trying to set the loader options but that did not seem to change it. I am very interested in loading 4.11 to work with the Editor Widget in an application.

You can just pass loaderOptions to your Map component. I'm doing it in my app and so far it's working as expected. I'm brand new to this component though so hopefully this is the right way to do it.

const loaderOptions = { url: ‘http://js.arcgis.com/4.11’ };

<React.Fragment>
    <Helmet>
        <link rel="stylesheet" href="https://js.arcgis.com/4.11/esri/css/main.css" />
    </Helmet>
        <Map
            loaderOptions={loaderOptions}
        / >
</React.Fragment>

I wonder why this is pinned to a specific version of esri-loader. We should probably update that to ^2.9.1.

looks like a previous issue #75 locked the version. Mine actually works now since I used the loader first for Identity before I load any map.

I will update the version lock and submit a PR, good first try on a this repo :)

@travisbutcher a PR would be great.

I was talking to @jgravois about this, and we think that esri-loader should be a peer dependency of this library instead of a dependency. That way we could make the range very loose (I'm thinking "esri-loader": "^2.0.0") and people can default to whatever version of the JSAPI they want by either specifying a specific minor version of esri-loader, or by passing options.

It would be good to put loaderOptions in the docs.

I have created a PR to update to arcgis-js-api v4.12 and esri-loader ^2.10.0: #98

Can a maintainer please move the loaderOptions docs idea and peer dependency issue to separate issues?

Fun note: once this is updated to the latest esri-loader, you do not have to load the js api stylesheet manually anymore, but can send it as part of the loaderOptions like here: https://github.com/gavinr/arcgis-js-api-extent-helper/blob/master/src/App.tsx#L36

Yeah, one of the things I've been wondering is should the next version use { css: true } as the default loader options. I think so.

I am having trouble changing the version of the API. I am trying loaderOptions to upgrade to 4.11 or 4.12, but I'm stuck with 4.10. I need to work with the Editor Widget too.
edit: Issue was that I was using loadModules before loading my Map component. Switched to esri-loader for those, seems to work now.