A Lifecycle for the web
Web Perf F2F, Jun 20
Shubhie Panicker
Life & Death for a Web App
What about apps in the background?
App in Background: Dead or Alive?
Why Bother?
Too Many Tabs. Limited Resources.
Ideally ...
Problem: App does not know ...
(Without APIs) App cannot know:
Well intentioned developers unable to build optimal user experiences.
Problem: Lack of Incentive
Why should I be a good citizen in background to help the foreground tab?
On Desktop - why should I:
On Mobile - the OS will stop execution & kill the app anyway.
Problem: Lifecycle Fragments
Ideally ...
Ideally there’d be a consistent way to:
Recap
Problems:
This is hurting the web platform.
What can we learn from Mobile Platforms?
iOS Lifecycle
Android
“...fundamental feature of Android is that an application process's lifetime is not directly controlled by the application itself.
Instead, it is determined by the system through a combination of the parts of the application that the system knows are running, how important these things are to the user, and how much overall memory is available in the system.”
Android
Activity
Lifecycle
Over on the web ...
Pending State?
(unreliable) beforeunload Modal Dialog ¯\_(ツ)_/¯
VisibilityState
visible
VisibilityState
hidden
Proposal: Web Lifecycle
Core Ideas
Core Ideas (continued)
Challenges & What’s Ahead