1. Trang chủ
  2. » Công Nghệ Thông Tin

Progressive Web Apps with ReactJS

43 175 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 43
Dung lượng 1,98 MB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Progressive Web Apps with ReactJSProgressive Web Apps with ReactJSProgressive Web Apps with ReactJSProgressive Web Apps with ReactJSProgressive Web Apps with ReactJSProgressive Web Apps with ReactJSProgressive Web Apps with ReactJSProgressive Web Apps with ReactJSProgressive Web Apps with ReactJSProgressive Web Apps with ReactJSProgressive Web Apps with ReactJSProgressive Web Apps with ReactJSProgressive Web Apps with ReactJSProgressive Web Apps with ReactJSProgressive Web Apps with ReactJSProgressive Web Apps with ReactJSProgressive Web Apps with ReactJSProgressive Web Apps with ReactJSProgressive Web Apps with ReactJS

Trang 1

Progressive Web Apps with ReactJS

Full stack Developer, Devops Guy, Book Lover

Trang 2

Me

Trang 3

Our Agenda

PWA

Trang 4

goo.gl/w9Bnge

Trang 8

The hardest problem with software is

distribution.

Trang 9

Reach

App

Web

Trang 12

Progressive Web Apps

Reliable - Fast loading, work offline (never show the downasaur) and on

flaky network

Fast - Smooth animations, jank-free scrolling and seamless navigation.

Engaging - Launched from home screen and send push notification.

Trang 13

Technologies Behind Progressive Web Apps

Service Workers

Web App Manifest File

Trang 14

Service Workers

Trang 17

.then(function(registration) {

console.log('SW registered! Scope is:', registration.scope);}); // catch a registration error

main.js

Trang 18

self.addEventListener('install', function(event) {

// Do stuff during install

});

service-worker.js

Trang 19

self.addEventListener('activate', function(event) {

// Do stuff during activate

// self.clients.claim ; force control of uncontrolled clients});

service-worker.js

Trang 21

Code - Background sync

navigator.serviceWorker.register('/sw.js');

// Later request a one-off sync:

navigator.serviceWorker.ready.then(function(swRegistration) {

});

main.js

Trang 22

Service Workers Prerequisites

development purpose we can use localhost

Trang 23

<Code />

Trang 24

sw-precache

Trang 26

sw-toolbox

Trang 27

importScripts( 'sw-toolbox/sw-toolbox.js' );

// examples of using strategies

toolbox.router.get( '/getImage*' , toolbox.cacheFirst, {

"Cache" :{

"maxEntries" : 100,

"Name" : "images-cache" ,

"maxAgeSeconds" : 60*60*24 }

});

Trang 28

Cache Only

Trang 29

Network Only

Trang 30

Cache First

Trang 31

Network First

Trang 32

Fastest

Trang 33

Web App Manifest

Trang 35

"icons": [

{

"src": "images/Airhorner_192.png" , "type": "image/png" ,

"name" : "The Air Horner" ,

"short_name": "Air Horner" ,

}

Trang 36

<Code />

Trang 37

Demo

Trang 38

Lighthouse

Trang 40

Tips and Notes

connection

cross-browser

Trang 41

let's build something awesome

Trang 42

Thank you

Ngày đăng: 10/04/2018, 00:46

TỪ KHÓA LIÊN QUAN

TÀI LIỆU CÙNG NGƯỜI DÙNG

  • Đang cập nhật ...

TÀI LIỆU LIÊN QUAN