Esri / application-base-js

A core class for creating a configurable application using JavaScript/TypeScript
https://developers.arcgis.com/javascript/
Apache License 2.0
19 stars 9 forks source link

urlUtils and itemUtils: application-level modules? #12

Closed alaframboise closed 7 years ago

alaframboise commented 7 years ago

I wonder if these are really an app-level or an app-base module?

urlUtils seems to be forcing the url/param structure to be a certain pattern and it should be up to the app to decide this. It's also loading libraries that I might not need to load. e.g. camera

https://github.com/Esri/application-base-js/blob/a7a3eecd54389739e8c2af6ed9643913cb12efdb/support/urlUtils.ts

itemUtils beyond this seems app-level too.

https://github.com/Esri/application-base-js/blob/master/support/itemUtils.js#L108

Move to app-template-examples?

@driskull @kellyhutchins

kellyhutchins commented 7 years ago

Those are the standard url parameters from ArcGIS Online that we'd like all the configurable apps to support so my vote is that they stay in app base.

alaframboise commented 7 years ago

Thanks @kellyhutchins. I wish I would have known this as I use totally different params to configure the view, marker, search...

Is this documented somewhere?

kellyhutchins commented 7 years ago

Probably not. We had an issue in devtopia for the app developers when we first started supporting the url params and then we added the urlUtils support to the boilerplate.

alaframboise commented 7 years ago

Is this what the Map Viewer uses/will use in the future?

kellyhutchins commented 7 years ago

The parameters themselves are doc'd in ArcGIS Online doc. http://doc.arcgis.com/en/arcgis-online/reference/use-url-parameters.htm

Although we don't use all of them.

alaframboise commented 7 years ago

Oh man. I don't use extent at all and use center, scale, zoom... since the map and view has changed a lot at 4.x.

There's other stuff in there too that can conflict with apps. E.g. my app uses and clears the view.graphics...

https://github.com/Esri/application-base-js/blob/master/support/itemUtils.js#L109

Plus I also see this in here for loading the view (but not in the AGO doc). I did this totally differently...

https://github.com/Esri/application-base-js/blob/master/support/itemUtils.js#L38

alaframboise commented 7 years ago

And for basemap url params, we might want to add something to accept the actual name string. e.g. streets-vector

driskull commented 7 years ago

@alaframboise if you don't want the mixins, you don't have to use them. They are all apart of the helper methods your app doesn't have to call.