Slide 1

Slide 1 text

STATE OF DECLARATIVE UI on Mobile Development

Slide 2

Slide 2 text

Hello πŸ‘‹ I’m Alessandro Calzavara πŸ“± Mobile Tech Lead @ Spreaker.com 🍺 Marca User Group meetup organizer πŸ₯© BBQ Grill Master

Slide 3

Slide 3 text

Table of Contents 1. Imperative UI 2. The Rise of Declarative UI 3. The Challenges 4. Wrap Up

Slide 4

Slide 4 text

Imperative UI

Slide 5

Slide 5 text

β€œA sequence of instructions that synchronize the UI with the state.” Imperative UI

Slide 6

Slide 6 text

Example

Slide 7

Slide 7 text

Imperative Approach Simple to understand πŸ‘ Verbose πŸ‘Ž Manual sync between UI and state πŸ‘Ž

Slide 8

Slide 8 text

The Rise of Declarative UI

Slide 9

Slide 9 text

The Rise of Declarative UI 2013: React

Slide 10

Slide 10 text

β€œthe UI is function of the state” Declarative UI

Slide 11

Slide 11 text

Foundational blocks Explicit state properties When state changes, the UI changes automatically Create views by combining several components

Slide 12

Slide 12 text

Declarative Approach Less Code to Write πŸ‘ Automatic UI Updates πŸ‘ Mental Shift Required ⚠ More CPU Demanding 🀷

Slide 13

Slide 13 text

The Rise of Declarative UI 2013: React

Slide 14

Slide 14 text

The Rise of Declarative UI 2013: React 2015: React Native

Slide 15

Slide 15 text

React Native Cross platform, but Native πŸ‘ Hot swap code πŸš€ Performance πŸ‘ŽπŸ€· Customization πŸ‘Ž

Slide 16

Slide 16 text

The Rise of Declarative UI 2013: React 2015: React Native

Slide 17

Slide 17 text

The Rise of Declarative UI 2013: React 2015: React Native 2017: Flutter

Slide 18

Slide 18 text

Flutter Declarative πŸ‘ Multi platform πŸ‘ No native UI components πŸ‘Ž

Slide 19

Slide 19 text

The Rise of Declarative UI 2013: React 2015: React Native 2017: Flutter

Slide 20

Slide 20 text

The Rise of Declarative UI 2013: React 2015: React Native 2017: Flutter 2019: SwiftUI & Jetpack Compose

Slide 21

Slide 21 text

Declarative πŸ‘ Swift πŸ‘ Slow to improve πŸ‘Ž SwiftUI

Slide 22

Slide 22 text

Jetpack Compose Declarative πŸ‘ Wide OS support πŸ‘ IDE integration πŸ‘Ž

Slide 23

Slide 23 text

SwiftUI vs Jetpack Compose

Slide 24

Slide 24 text

The Challenges

Slide 25

Slide 25 text

State Handling

Slide 26

Slide 26 text

State Handling ● State Hoisting ● Architecture ● .equals(...)

Slide 27

Slide 27 text

Testing

Slide 28

Slide 28 text

Testing ● View tests ● Demo screens as test

Slide 29

Slide 29 text

Integration with Imperative UI

Slide 30

Slide 30 text

Integration with Imperative UI Theming Navigation Incremental Deploy

Slide 31

Slide 31 text

Wrap Up

Slide 32

Slide 32 text

β€œDeclarative UI is the future.” From: Random Dev from the Internet

Slide 33

Slide 33 text

Thanks!