SlideShare una empresa de Scribd logo
Introducción a PWA
Introducción a PWA
💣 💣
WordCamp SJO - 2019
José Leiva
leivajd.com / @leivajd
Introducción a PWA
Introducción a PWA
Objetivos.
1.Visión general.
1.Visión general.
2.Beneficios e implementación.
1.Visión general.
2.Beneficios e implementación.
3.Lecciones aprendidas.
¿Qué es?
Progressive Web Apps
Término “sombrilla” que
involucra una nueva filosofía y
tecnologías.
Progressive Web Apps: Escaping
Tabs Without Losing Our Soul
Alex Russell - 2015
Frances Berriman - 2017
Naming Progressive Web Apps
¿Qué involucra?
Progressive. Filosofía de
mejora progresiva.
¿Qué involucra?
Web. No nativo, no dependencias,
no terceros.
¿Qué involucra?
App. ¿Qué es un app? Necesitamos
un término simple.
Basado en features soportados
por el browser, de manera
progresiva se vuelven apps-like.
¿app-like?
¿app-like?
● Responsive.
¿app-like?
● Responsive.
● Offline first.
¿app-like?
● Responsive.
● Offline first.
● Interacciones (touch, shell).
¿app-like?
● Responsive.
● Offline first.
● Interacciones (touch, shell).
● Linkable.
¿app-like?
● Responsive.
● Offline first.
● Interacciones (touch, shell).
● Linkable.
● Seguro (HTTPS).
¿app-like?
● Responsive.
● Offline first.
● Interacciones (touch, shell).
● Linkable.
● Seguro (HTTPS).
● Instalable.
¿Porqué?
Beneficios
● Mobile first.
Beneficios
● Mobile first.
● Performance.
Beneficios
● Mobile first.
● Performance.
● Engagement.
Beneficios
● Mobile first (pero de verdad!)
● Performance.
● Engagement.
● “Build once, deploy anywhere.”
https://www.pwastats.com/2018/01/tinder/
https://www.pwastats.com/2018/01/uber/
https://www.pwastats.com/2017/12/pinterest/
https://www.pwastats.com/2017/05/twitter/
https://www.pwastats.com/2017/08/flipkart/
Los beneficios son atractivos
para cualquier sitio web.
Introducción a PWA
Introducción a PWA
Introducción a PWA
Introducción a PWA
Introducción a PWA
Introducción a PWA
¿Cómo?
La implementación puede cubrirse
en varias charlas adicionales.
Técnicamente
● HTTPS.
● Web App Manifest.
● Service Worker.
Técnicamente
● HTTPS.
...service workers create the
opportunity for a bad actor to
turn a bad day into a bad
eternity.[ 👉 Especificación]
Técnicamente
● Web App Manifest.
{
"short_name": "name",
"name": "App name",
"icons": [
{
"src": "/images/icons-512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": "",
"background_color": "#3367D6",
"display": "standalone",
"scope": "/",
"theme_color": "#3367D6"
}
Técnicamente
● Web App Manifest.
<link rel="manifest" href="/manifest.json">
Técnicamente
● Service Worker.
🤯 😨 😎
🏃💨
La “P” en PWA es clave.
Service Worker
🤯 ☁
GET /something
Respuesta
Service Worker
🤯 ☁
GET /something
Respuesta
❌
Service Worker
🤯 ☁
GET /something
Respuesta
❌
😭
Service Worker
● JS script en background.
Service Worker
● JS script en background.
● Push notifications.
Service Worker
● JS script en background.
● Push notifications.
● Background sync.
Service Worker
● JS script en background.
● Push notifications.
● Background sync.
● Network proxy.
Service Worker - network proxy
🤯 ☁
GET /something
Response
🤖
Service Worker - network proxy
🤯 ☁
GET /something
Response
🤖
📦
Service Worker - network proxy
● Control sobre request.
Service Worker - network proxy
● Control sobre request.
● Control sobre cache.
Service Worker - registro
if ('serviceWorker' in navigator) {
window.addEventListener('load', function() {
navigator.serviceWorker
.register('/service-
worker.js');
});
}
Service Worker - registro
if ('serviceWorker' in navigator) {
window.addEventListener('load', () => {
if (has('killserviceworker')) {
navigator.serviceWorker.getRegistrations().then(registrations => {
registrations.forEach(registration => {
registration.unregister();
});
});
} else {
navigator.serviceWorker.register('/service-worker.js', {
scope: '/',
}).then(() => {
console.log('Service worker registration success');
}, (err) => {
console.log('Service worker registration failed: ', err);
});
}
});
}
Service Worker - existe?
if ('serviceWorker' in navigator) {
// el browser lo soporta
}
Service Worker - load
window.addEventListener('load', () => {
// minimizar carga en CPU y
memoria
});
Service Worker - feature flag
if (has('killserviceworker')) {
// desregistro
} else {
// registro
}
Service Worker - desregistro
navigator.serviceWorker
.getRegistrations()
.then(registrations => {
registrations.forEach(registration => {
registration.unregister();
});
);
Service Worker - registro
navigator.serviceWorker
.register('/service-worker.js',
{
scope: '/',
});
Service Worker - estrategias
● Cache only.
● Network only.
● Network first.
● Cache first.
● Stale-While-Revalidate
Service Worker - estrategias
● Ejemplo Cache first.
Caso.
Introducción a PWA
V1 - reemplazar iOS app
V1 - explorar Android app
V1 - caching & repeat visitors
V1 - caching & repeat visitors
● Webpagetest.org
● Home, PLP & PDP.
V1 - caching & repeat visitors
● ~0.4ms - SW vs No SW
V1 - caching & repeat visitors
● ~0.4ms - SW vs No SW
● Resultado esperado 🙆.
V1 - caching & repeat visitors
● ~0.4ms - SW vs No SW
● Resultado esperado.
● Base para offline.
V1 - soporte offline
V1 - métricas (PWA)
● Instalaciones 11,161 (Android)
V1 - métricas (PWA)
● Instalaciones 11,161 (Android)
● Open from Home 91,025
V1 - métricas (PWA)
● Instalaciones 11,161 (Android)
● Open from Home 91,025
○ Android ~76%
○ iOS ~13%
V1 - métricas (repeat rate)
● Mobile Web - 1.54
● Old app - 2.10
● New app - 2.42
V1 - métricas (conversion rate)
● Mobile Web - 1.57%
● Old app - 2.03%
● New app - 2.93%
Service Worker nos dan la
oportunidad de crear mejores
experiencias.
El nombre no es para nosotros, y
preocuparnos es una distraccion.
El nombre no es para nosotros, y
preocuparnos es una distracción.
El nombre es para su jefe, su
cliente ó marketing.
PWA, solo necesitamos HTTPS,
Service Worker y un Manifiesto.
PWA, solo necesitamos HTTPS,
Service Worker y un Manifiesto.
El reto es saber cómo y cuándo
aplicar estas tecnologías.
¿Qué van a construir?
Recursos.
● leivajd.com/nota/introduccion-pwa
José Leiva
leivajd.com / @leivajd
Introducción a PWA

Más contenido relacionado

PDF
Google Analytics para Desarrolladores
PDF
UXN CDMX 02-32 - Velocidad para todos: AMP y PWA
PPTX
Generación de pruebas de performance a partir de pruebas funcionales para sis...
PPTX
Pruebas tempranas de performance
PDF
Manual Ajax con jquery
PDF
Kit para crear un Sitio Web Móvil asombroso!
PDF
Desarrollo de aplicaciones multiplataforma 2/2
PPTX
NetConfUy 2016 - Cómo asegurar la performance de aplicaciones móviles tanto e...
Google Analytics para Desarrolladores
UXN CDMX 02-32 - Velocidad para todos: AMP y PWA
Generación de pruebas de performance a partir de pruebas funcionales para sis...
Pruebas tempranas de performance
Manual Ajax con jquery
Kit para crear un Sitio Web Móvil asombroso!
Desarrollo de aplicaciones multiplataforma 2/2
NetConfUy 2016 - Cómo asegurar la performance de aplicaciones móviles tanto e...

Similar a Introducción a PWA (20)

PDF
Ionic, Adaptación de desarrollos web a dispositivos móviles
PPTX
VLCTechFest - Simplificando Controladores: Una introducción a Action-Domain ...
PDF
App engine
PDF
Progressive web apps
PDF
Javascript y Jquery
PPTX
Vision 360º en Web Analytics
KEY
Gearman - Comunidad JavaGDL
PPT
ventajas y desventajas de programas informaticos
PPT
ventajas y desventajas de programas informaticos
PDF
AngularJS 1 - A Superheroic Javascript MVC framework (Spanish)
PPTX
Manejando las redes como un señor
PDF
Effective Network Layer: API lovers and Apps
PDF
Desarrollo de Mobile Web Apps
PPTX
Webinar AppDynamics
PDF
Orquestando microservicios como lo hace Netflix
PPTX
SEO y JavaScript - Ensalada SEO 2019 - Laura López
PDF
Mejorar la usabilidad y la conversion con WPO en Wordpress
PPTX
01_Semana_01.pptx
PDF
Introducción a las Progressive web apps
Ionic, Adaptación de desarrollos web a dispositivos móviles
VLCTechFest - Simplificando Controladores: Una introducción a Action-Domain ...
App engine
Progressive web apps
Javascript y Jquery
Vision 360º en Web Analytics
Gearman - Comunidad JavaGDL
ventajas y desventajas de programas informaticos
ventajas y desventajas de programas informaticos
AngularJS 1 - A Superheroic Javascript MVC framework (Spanish)
Manejando las redes como un señor
Effective Network Layer: API lovers and Apps
Desarrollo de Mobile Web Apps
Webinar AppDynamics
Orquestando microservicios como lo hace Netflix
SEO y JavaScript - Ensalada SEO 2019 - Laura López
Mejorar la usabilidad y la conversion con WPO en Wordpress
01_Semana_01.pptx
Introducción a las Progressive web apps
Publicidad

Más de Jose Leiva (10)

PDF
CSS - Drupal Camp Costa Rica 2016
PDF
CSS, planeando para el futuro
PDF
Sass & Compass - DrupalCamp CR13
PDF
Intro a Sass
PDF
No más curva.
PDF
Pruebas de usabilidad, guerrilla style
PDF
HTML5 101 - Drupaleada jun12
PPT
Drupal - prototipos rápidos
PDF
Año Nuevo, Herramientas Nuevas
PPT
Hablemos sobre Drupal vs WordPress
CSS - Drupal Camp Costa Rica 2016
CSS, planeando para el futuro
Sass & Compass - DrupalCamp CR13
Intro a Sass
No más curva.
Pruebas de usabilidad, guerrilla style
HTML5 101 - Drupaleada jun12
Drupal - prototipos rápidos
Año Nuevo, Herramientas Nuevas
Hablemos sobre Drupal vs WordPress
Publicidad

Último (10)

PPTX
Tratará sobre Grafos_y_Arboles_Presentacion.pptx
PDF
Clase 3 - Presentación visual (Insertando objetos visuales) POWER POINT.pdf
PDF
Su punto de partida en la IA: Microsoft 365 Copilot Chat
PDF
AutoCAD Herramientas para el futuro, Juan Fandiño
PPTX
ORIGEN DE LA IA - GRADO 1102 INTELIGENCIA
PPTX
sistemas de informacion.................
DOCX
trabajo programacion.docxxdxxxddxdxxdxdxxxdxxdxdxd
PPTX
Fundamentos de Python - Curso de Python dia 1
PPTX
Conceptos basicos de Base de Datos y sus propiedades
PPTX
Implementación equipo monitor12.08.25.pptx
Tratará sobre Grafos_y_Arboles_Presentacion.pptx
Clase 3 - Presentación visual (Insertando objetos visuales) POWER POINT.pdf
Su punto de partida en la IA: Microsoft 365 Copilot Chat
AutoCAD Herramientas para el futuro, Juan Fandiño
ORIGEN DE LA IA - GRADO 1102 INTELIGENCIA
sistemas de informacion.................
trabajo programacion.docxxdxxxddxdxxdxdxxxdxxdxdxd
Fundamentos de Python - Curso de Python dia 1
Conceptos basicos de Base de Datos y sus propiedades
Implementación equipo monitor12.08.25.pptx

Introducción a PWA

Notas del editor

  • #15: Idea de que sitios web deben construirse en capas.
  • #16: No depender de terceros para publicar, App Store, equipos y skills especializados, etc
  • #27: better mobile experiences. Aunque mobile first existe desde hace tiempo, la mayoria de los sitios web siguen siendo deficientes
  • #28: Control sobre el cache
  • #29: Push notifications, mejor experiencia, hay que ganarse estar en el Home screen
  • #30: No dependencias, no Apple Drama
  • #47: Archivo json que le informa al navegador acerca de nuestra aplicación web y cómo debe comportarse cuando se 'instala' en el dispositivo móvil o escritorio del usuario. Chrome requiere tener un manifiesto para mostrar el mensaje Agregar a la pantalla de inicio.
  • #61: Control sobre request Control sobre cache
  • #65: The Navigator interface represents the state and the identity of the user agent. It allows scripts to query it and to register themselves to carry on some activities.
  • #77: Home, PLP, PDP 9 corridas
  • #78: Custom GA implementacion
  • #79: Custom GA implementacion
  • #80: Custom GA implementacion
  • #82: Custom GA implementacion
  • #83: Custom GA implementacion
  • #84: Custom GA implementacion
  • #85: Custom GA implementacion
  • #86: Custom GA implementacion