ArcGIS API for JavaScript Advanced Topics

Andy Gup & John Gravois ArcGIS API for JavaScript 4.x • Modern architecture • Better control over application life-cycle • Stronger infrastructure for building larger apps Working with Modern JavaScript –2017+ • Stepping beyond plain ol’ JavaScript • ES2015, Node.js, , TypeScript, etc etc • Transpilers, module loaders, task runners, etc Getting to know modern JavaScript… Almost all modern JavaScript apps use a framework The Good News… A variety of solutions available on github! A partial list… • https://github.com/Esri/angular-esri-map • https://github.com/jwasilgeo/angular2-esri- playground • https://github.com/Esri/esri-system-js • https://github.com/lobsteropteryx/esri- webpack-typescript Two main approaches Dedicated module loader

Exclude and Require What are modules? • Different types: AMD, ES6, commonjs, etc • Reusable chunk of JavaScript • Logically encapsulate functionality • Sometimes referred to as JS libraries Example: AMD Modules Module Loaders Dojo uses an AMD module loader

Other frameworks use a variety of module loaders: e.g. webpack, SystemJS, RequireJS… Dedicated module loader Example usage: + webpack • Use esriLoader or angular2-esri-loader • Inject ArcGIS JS API as a