This document discusses the Sencha Touch JavaScript framework for building rich mobile applications. It provides an overview of key features such as the touch event manager, scroll event manager, UI toolkit, MVC architecture, theming with SASS/Compass, and code examples.
61. Everything else?
ā¢ HTML for layout
ā¢ JavaScript for accessing device APIs
ā¢ CSS for look & feel
ā¢ Oīļ¬ine storage for standalone clients
ā¢ Ajax, JSONP for syncing to the cloud
ā Runs on ļ¬le:// protocol which is exempt from same-origin
policy
ā¢ Just use Sencha Touch!
64. Tools
ā¢ Browsers ā Safari the best (unfortunately)
ā¢ Web Inspector
ā¢ RemoteJS (Android debugging)
ā¢ Soudersā bookmarklets
ā stevesouders.com/mobileperf
ā¢ Jdrop
ā jdrop.org
65. Object-oriented
ā¢ Use namespaces to deļ¬ne your library
ā¢ Deļ¬ne components ā code for reusability
ā¢ Extend ļ¬rst, write plugins second (not at all
if possible)
66. Events rock!
ā¢ Use events to communicate between
components
ā¢ Use event delegation
67. Override appropriately
ā¢ Do not edit the library ļ¬les
ā¢ DO NOT EDIT THE LIBRARY FILES!
ā¢ Use an overrides ļ¬le if you need to override
the framework
ā¢ Do the same with CSS (but you should be
using cls, ui properties)
68. Deļ¬ne a directory structure
ā¢ Break your code into small ļ¬les
ā¢ Use build tools to compile for performance
ā¢ Use sencha-touch-debug.js during dev (but
never prod!)
ā¢ Keep the framework up-to-date ā upgrade as
often as you can
69. Worry about performance
ā¢ Understand client-side performance rules &
use them
ā¢ Latency bad
ā¢ JIT compilers ā compilation time relates to
size of ļ¬le the method exists in
ā¢ Keep DOM light
ā¢ Destroy components that arenāt visible
ā¢ concatenate, minify, compress!
70. Theming/Layouts
ā¢ Use SCSS
ā¢ Remove unnecessary CSS by only
including required SCSS mixins
ā¢ Understand XTemplate
ā¢ Understand doComponentLayout