liveBook · Manning

Hybrid application

As explained in Fast by Default

A hybrid application combines web-based interface code with a native container or native implementations.

A hybrid application combines shared, web-based, or cross-platform interface code with a native container or native implementations where they matter most. The pattern trades uniform implementation for targeted platform work: most screens can reuse code, while features whose performance affects the experience can remain native. It is most useful when UI complexity is moderate and the gap from a fully native implementation is not visible to users. section 5.2.2

A common hybrid-web form wraps HTML, CSS, and JavaScript in a native container through a WebView. Cordova and Capacitor maximize reuse of an existing web application, but the embedded page can feel less native, has more limited device access, and is generally slower than native UI. The important cost is often startup behavior rather than the programming language: a WebView must initialize its JavaScript engine and rendering pipeline and load assets on a cold launch, while native and Flutter runtimes can benefit from remaining resident after earlier launches. section 5.2.2

Use the pattern deliberately rather than treating every screen alike:

  • Keep shared or cross-platform code for ordinary screens where its performance is sufficient for the user experience. section 5.2.2
  • Implement complex animation, heavy data processing, or real-time interaction natively when the cross-platform performance gap becomes user-visible. section 5.2.2
  • Treat launch speed as an architectural concern; delay expensive startup work that is not needed before the first interactive screen. section 7.3.6
  • Watch the boundary between native code and web content, where memory use combines and synchronous bridge calls can block the main thread. section 7.3.6

Profiling an embedded dashboard

An app can embed a heavy web dashboard in a WKWebView or Android WebView while retaining native navigation and device-facing features. Profile both layers: inspect the web page with Safari Web Inspector on iOS or chrome://inspect on Android, then measure the app on a physical device. A memory snapshot before and after leaving and revisiting the dashboard can reveal accumulated browser-view memory; tracing bridge calls can show whether either side waits on the other and stalls the main thread. section 7.3.6

A newer variation keeps standard web code but replaces the browser view with a native rendering engine. WebF, for example, runs HTML, CSS, and JavaScript on Flutter’s GPU-accelerated renderer rather than in a browser, aiming to retain reuse of React, Vue, or vanilla JavaScript while avoiding ordinary WebView cold-start behavior. This changes the container, not the need to validate real-device startup and interaction performance. section 5.2.2 section 7.3.6

How Fast by Default covers it

How deep it goes
Explains WebView startup costs and bridge risks, then gives concrete profiling tools and a real-device measurement workflow.
Examples
Uses Cordova, Capacitor, WKWebView, Android WebView, WebF, and startup, scrolling, and memory profiling on physical devices.
What you can do after
Diagnose/debug with platform profilers by measuring launch, scrolling, memory, and native-to-web bridge calls on real devices.
How it connects
Connects WebView, cold starts, Flutter, native UI, JavaScript bridges, memory, and main-thread performance.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Fast by Default. The section links point to the parts of the book it draws on.