Progressive WebAssembly Applications

@alexkehayias

Created: 2019-08-20 Tue 18:47

Hello!

  • I'm Alex
  • I work at Stripe (we're hiring)

Woz

Content

Information provided to end-users by publishers or media producers

via Wikipedia

Content

  • Static
  • Text or media
  • Consumable

Example: HackerNews article

Content has become massively efficient

Solves three problems

Distribution

Getting the thing to users

(anyone with a web browser)

Unification

Write once available everywhere

(publisher needs to know ~nothing aboput your computer)

Experience

Easy to access, easy to use

(almost no friction—hyperlink)

Applications

Software designed to perform a group of coordinated functions, tasks, or activities for the benefit of the user

via Wikipedia

A richer form of content

  • Interactivity
  • Experiential
  • Dynamic

Mobile applications

Imagine if clicking a link were like mobile apps today

Back to our problems

  • Distribution: duopoly (Apple, Google)
  • Unification: 3rd party frameworks
  • Experience: high friction, good performance

Despite all progress, mobile apps are still hugely inefficient to create, distribute, and use.

What if consuming an application were just like content?

Web applications!

There's many advantages

Distribution: browsers > app stores

Unification: standards > frameworks

Experience: immediate > deferred

Web applications

  • Distribution: web browsers (including mobile)
  • Unification: standards-based
  • Experience: lowest friction (hyperlink)

So the answer is everyone should just use a browser right?

But mobile is different

  • Native application performance
  • Encapsulation (e.g. home screen, self-contained experience)
  • Offline by default
  • Hardware/sensors
  • Battery life

What do we do about it?

Step 1) Bring web applications to mobile

Progressive Web Applications (PWA)

Step 2) Improve performance, open access

WebAssembly

Step 3) Progressive WebAssembly Applications!

Back to Woz

A progressive WebAssembly application (PWAA) generator

  • Distribution via browsers
  • Unification via web standards
  • Experience via the good ole hyperlink

All the things you need to PWA

  • ✅ SSL certificate
  • ✅ PWA Manifest
  • ✅ Splash screen
  • ✅ Home screen icons
  • ✅ Service worker

All the things you need to PWAA

  • ✅ JS bindings to WebAssembly
  • ✅ Fetch, compile, run wasm

A quick tour

Rust 'frontend' frameworks

  • Seed
  • Percy
  • Sauron
  • Yew

Compatibility

  • These days, use wasm-bindgen
  • A few are using std-web which may eventually be compatible with wasm-bindgen
  • wasm-pack uses wasm-bindgen under the hood

Usage

cargo install woz
woz signup
woz new myapp && cd ./myapp
woz deploy

Writing an app

#[wasm_bindgen]
pub fn render() {
  // App init code here
}

Demo

What's next?

WebAssembly continues to evolve

More languages and ecosystems can target WebAssembly

Progressive Web Apps continue to evolve

Is it time for the PWAA?

Final thoughts

Thank you!

Check out woz at https://woz.sh

Would love to hear from you. You can find me @alexkehayias.

Created by Alex Kehayias