ArcGIS API for JavaScript Tips and Tricks for Debugging Apps. Andy Gup, Esri US Cédric Despierre Corporon, Esri FR - PDF

Description
ArcGIS API for JavaScript Tips and Tricks for Debugging Apps Andy Gup, Esri US Cédric Despierre Corporon, Esri FR Agenda Error prevention tools Front-end debugging Back-end debugging Internet Resources

Please download to get full document.

View again

of 42
All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Information
Category:

Advertisement

Publish on:

Views: 27 | Pages: 42

Extension: PDF | Download: 0

Share
Transcript
ArcGIS API for JavaScript Tips and Tricks for Debugging Apps Andy Gup, Esri US Cédric Despierre Corporon, Esri FR Agenda Error prevention tools Front-end debugging Back-end debugging Internet Resources Demo files on GitHub : https://github.com/andygup/devsummit-berlin-2015 Debugging Patterns Tools Choose your Editor There is lots of them! Use one with plugin support Productivity Errors preventions In a team : use the same config Code quality tools Use a linter JSHint JSLint Available : As a plugin in your IDE Or inside continuous integration https://github.com/esri/jsapi-resources/tree/master/jshint Additional tools Continuous Integration Automate tasks using Grunt, Gulp, etc. Run linter, beautify, minify your code And of course, test your code Esri TypeScript Browser Developer Tools Front-end Common front-end errors Page failed to load or partial loaded Items not displaying properly Map is missing Features are missing Parsing errors Life-cycle (order of code execution) Use a Web Server for testing Use or https:// IIS, Apache or similar Don t use filesystem accessor: file:// Direct file access bypass web server Web security prevents AJAX direct requests Map in pieces missing esri.css DEMO Using file:/// for web development DEMO ReferenceError: require not defined Life-cycle issues DEMO TypeError: is not a function Missing module and/or alias DEMO Parsing errors DEMO ReferenceError: not defined DEMO Device browser debugging Connect laptop to device via USB Chrome for Android Safari for ios (works best on Mac) Device browser debugging - Chrome Device browser debugging - Safari Clearing Cache Sticky cache means new changes don t show Key-board Shortcuts Browser settings URL caching Clearing Cache - Chrome Mac Shift+Command+Delete Windows Ctrl+Shift+Delete Clearing Cache - Chrome Set code breakpoints Manually via the browser In-line via debugger statement Make good use of console.log() Back-end Common back-end errors HTTP & REST request errors Slow and intermittent internet Authorization errors Cross domain requests errors Debugging Proxies Detailed HTTP inspection Show ALL HTTP/HTTPS traffic Fiddler Charles Developer Tools Network Tab Holds a lot of valuable information: HTTP Request header fields Malformed request 500 Server error HTTP Response header fields and data Statistics (times and size of data payload) Developer Tools Network Tab HTTP status codes 200 Okay 302 Redirect 403 Forbidden 404 Not Found 500 Internal Server Error ArcGIS REST API Documentation Operator descriptions Attribute/Value pairs Request/Response JSON output REST API Web Site REST request example scenario 200 Okay BUT my code is still failing? JavaScript? REST API? Cross domain requests : CORS and proxy page Cross-Origin Resource Sharing (CORS) Implemented on both server side and client side Proxy page Allow cross domain request Manage security (tokens) Go over the GET URL limit length https://github.com/esri/resource-proxy Localhost OAuth 400 error Localhost OAuth 400 error Throttling slow network testing Most important for mobile But important for every application (public app, used on remote site) Test it early in the app development process Slow network troubleshooting - 1 Try to request only what you need Simplify geometries In your database Or client side using the maxallowableoffset parameter If you need geometry operations, give the new GeometryEngine a try! Slow network troubleshooting - 2 Minimize, concatenate your.js and.css Use ArcGIS JavaScript Optimizer (or build your own!) Enable webserver gzip compression Search Engine GeoNet GIS StackExchange Internet Resources Andy Cédric Despierre Corporon Please Take Our Survey! Download the Esri Events app and find your event Select the session you attended Select User Presentation Survey or Technical Workshop Survey Complete Answers and Select Submit
Related Search
Similar documents
View more...
We Need Your Support
Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks