hybrid app development
TRANSCRIPT
Who am I
• Dmitry Demyankov • Frontend Tech Lead @ Nordnet • @dimchez • https://github.com/dimchez • https://github.com/nordnet
Why Hybrid?
• Mobile as first class citizen • Code reuse between different platforms • Instant updates, no review delays
What was that
• Mostly web code • Native navigation, multiple WebViews • Streaming data via native (TCP sockets)
We are all different
• Not possible to have “natural native” transitions with one WebView
• Differences between WebViews • Differences between platforms
• Navigation patterns • Gestures • Transitions
Native to the rescue
• Multiple WebViews • Let native handle navigation • Better scrolling performance
Message Bus
• Communication between multiple WebViews • Authentication state changes • Realtime feed updates
Native-to-Web
• Execute JS in a WebView • Receive data/events from native in WebViews • Potential race conditions
Web-to-Native
• Different support between platforms
• Keep it Simple ™ • Same interface for all platforms:
• window.external.notify(str)
nordnet://
• nordnet://[viewtype]/page.html?title=[title]#[hash]
• Platform specific view type mappings for native transitions
Not all that awesome
• Differences and limitations between platforms • Debugging different platforms
• Communication, communication, communication
What’s next
• Migration to Cordova • Native shells as Cordova plugins • Integration of new Web tech into Web core
Lessons learned
• Hybrid is a valid approach
• Coding style guidelines are important
• Multiple WebViews and native navigation for native look and feel
• Update your tech stack in a timely manner