tomwayson / esri-angular-cli-example

Example of how to to use the ArcGIS API for JavaScript in an Angular CLI app

Home Page:https://tomwayson.github.io/esri-angular-cli-example

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

extract esri loader into it's own repo

tomwayson opened this issue Β· comments

Should be:

  • framework agnostic
  • not dependent on promises (favor callbacks) or any polyfills
  • TypeScript 😞 (or ES2015)
  • able to be loaded to be in an ES5 application (such as angular-esri-map) as a UMD module

This is what I have in mind:

@jwasilgeo @kgs916 @davetimmins thoughts or suggestions welcome.

I like the idea. I'm just about to start a new project using the react bits so I should be more in that headspace soon so I'll keep an eye on this and see about working the loader in.

For the react example when you say generate are you meaning via yeoman or just an npm package? Might end up being a case of just providing the base repo and some doco around how to use / extend it.

I also like the idea. Are you thinking to have all of these using the same version of the ArcGIS JavaScript API or will some of them be v4 and some be v3 or might there be more than one example for some of these to represent both v3 and v4?

Same here, I like it. From the perspective of angular-esri-map, it'll have to rely on esri-loader as part of its package.json dependencies, right? It'll also be a good chance to revisit the single module or array of modules options that we've been supporting and perhaps we can cut out the single module convenience that is currently provided. Do I follow what you had in mind in the general sense, @tomwayson?

@davetimmins my goal would be to use something like create-react-app or whatever is the closest thing to the angular-cli in the React ecosystem to scaffold an idiomatic React app. I'd then just make whatever changes are needed to use the esri-loader to create a map and document them. One idea would be to then bake those changes into a fork of create-react-app - which is how I think your repo works. Another idea would be to just push that modified output up as it's own repo like I did w/ this one. Sounds like you're suggesting that in your above comment as well. I'm kind of leaning towards the latter b/c it would work a lot like this one does. Also, is create-react-app the right starting point, or is there some other react generator/boilerplate that would be better?

Finally, I'll try to split the loader code into it's own repo tonight, but I won't have a chance to set up all the build and publish tooling until this weekend, which is what will be needed to be able to easily consume it.

@kgs916 good question. In the past @jwasilgeo and I have made a conscious effort to do alternate on 3.x and 4.x so people can see that these examples work w/ either. I also see the benefit in having these examples having pretty much the exact same map so you can compare apples to apples. For example, this repo should really be compared to angular2-esri-example to show the 2 different approaches to working w/ the JSAPI in an Angular2 app build w/ webpack, so one could argue that this one should load the same 3.x map. That said, I don't really want to add all the other stuff that's in that repo (legend, layer list, etc) that was there to demonstrate different ways for those components to communicate esp w/r/t map state.

Also I don't know if people are more interested in 4.x these days.

I'm open to suggestion on this.

@jwasilgeo - yeah I follow you. I don't know about cutting out the single module convenience signature of the require function in angular-esri-map - only b/c it would be a breaking change and we don't want to deal w/ that. Maybe deprecating it? I think the exercise of trying to shoehorn a minimal loader into the overly convientized API we created there will help us shape the right api for esri-loader. it may not work, but it's worth a try.

Yeah, I'm on the same page with you. I just want to break it so bad. 😏

I think the exercise of trying to shoehorn a minimal loader into the overly convientized API we created there will help us shape the right api for esri-loader.

Good point!

@tomwayson create-react-app is the simplest starter I've seen, it's very barebones though for it to be useful in this case you start by running the eject task so that you can customise the build. I also added in redux but that isn't required so using the base project is less effort in terms of total steps. Main difference becomes where you setup the map/view (reducer vs component).

I've updated the above diagram to include the other webpack examples:

https://docs.google.com/drawings/d/1ktkj9ytmDTccnhB36qHvAw9U2q-4yCkGNtd2RL9w9x4/edit?usp=sharing