01
Approaches
The case for cross-platform development, the WebView-based, bridge-based and own-rendering-engine approaches, the split between shared logic and native UI, and approach selection criteria.
- 01 The Case for Cross-Platform The case for cross-platform development is how many separate codes the same feature is written in on two platforms. The lesson classifies the sharing of a feature's code with four answers: shared, branched, split, single.
- 02 The WebView-Based Approach The WebView-based approach draws the interface from a single page and places the page inside a native shell on each platform. The lesson measures the sharing of this mechanism and shows how the input the page takes from the shell changes the sharing.
- 03 The Bridge-Based Approach The bridge-based approach defines the interface in shared code and maps each node to a platform's native component through a bridge. The lesson measures the sharing of the mapping: the same mapping function gives a different component name per platform, and it turns split when the mapping is divided into two functions.
- 04 The Own-Rendering-Engine Approach The own-rendering-engine approach does not use the platform's native components; it draws the interface onto a canvas with its own engine. The lesson measures the sharing of layout, paint order, and touch resolution, and shows how text width coming from the platform branches the layout.
- 05 Shared Logic, Native UI The shared-logic approach keeps the business rules in a shared module and writes the interface separately on each platform. The lesson measures that form validation comes out shared and the interface functions that build the form come out split, and it shows the maintenance cost of a drifted split.
- 06 Approach Selection Criteria Approach selection starts from how dependent each feature is on the platform. The lesson measures the same six features with a single codebase and with shared logic and native UI, compares the two distributions of the four sharings, and shows that the count alone does not choose the approach.