当前位置:网站首页>PWA (Progressive Web App)
PWA (Progressive Web App)
2022-07-05 10:21:00 【码小龙.】
PWA (Progressive Web App)
1、简介
是一种理念,使用多种技术来增强web app的功能,可以让网站的体验变得更好,能够模拟一些原生的功能,比如:通知推送
Js-to-Native与以PWA为首的纯web应用,将分别从两个方向挤压Hybrid的生存空间,消化当前Hybird架构主要解决的问题
IOS目前还不支持PWA
2、下一代web应用
2.1 优点
webpack、Rollup等打包工具
Babel、PostCSS等转译工具
TypeScript等可转译为Javascript的编程语言
React、Angular、vue等现代web前端框架
同构Javascript应用
2.2 缺点
网页资源下载带来的网络延迟
web应用依赖于浏览器作为入口
没有好的离线使用方案
没有好的消息通知方案
3、PWA的优点及特征
显著提高应用加载速度
web应用可以在离线环境下使用
web应用能够像原生应用一样被添加到主屏幕
web应用能够在未被激活的时候发起推送通知
web应用与操作系统集成能力进一步提高
具有渐进增强,响应式用户界面,不依赖网络链接,类原生应用,持续更新,安全,可发现,再次访问,可安装,可连接性的特征
4、Web App Manifest
4.1 介绍
通过一个清单文件向浏览器暴露web应用的元数据,包括名字、icon的URL等,以备浏览器使用,比如:在添加至主屏幕或推送通知时暴露给操作系统,从而增强web应用与操作系统的集成能力
它就好比PWA的户口本一样,承载着web应用与操作系统集成能力的重任,还将在日后不断发展,以满足web应用高速演化的需要
4.2 manifest.json
{
“short_name”: “Manifest Sample”,
“name”: “Web Application Manifest Sample”,
“icons”: [{
“src”: “launcher-icon-2x.png”,
“sizes”: “96x96”,
“type”: “image/png”
}],
“scope”:“/sample/”, // -> 定义了web应用的浏览作用域,比如作用域外的url会打开浏览器而不会在当前的PWA里继续浏览
“start_url”: “/sample/index.html”, // -> 定义了一个PWA的入口页面
“display”: “standalone”,
“orientation”: “landspace”, // -> 锁定屏幕旋转
“theme_color”: “#000”, // -> 主题色
“background_color”: “#fff” // -> 背景色
}
5、Service Worker
5.1 LocalServer
让web应用离线使用的第一次尝试
Google为了让web应用可以在本地存储数据与离线执行,特意在07年开发了一个浏览器来增强web应用 Goole Gears
在Gears API中,通过向LocalServer模块提交一个缓存文件清单来实现离线支持
5.2 Application Cache
让web应用离线使用的第二次尝试
在LocalServer的基础上进一步发展
缺点:不可编程,无法清理缓存,几乎没有路由机制
})
7、PWA与原生APP的差异
03.png
8、PWA对web APP的影响
体验层面上逐渐向原生APP靠拢,离线可用,主屏图标入口,启动动画,基本上可以和原生APP的体验一致
开发模式的变革,Web开发的同时考虑离线模式和体验
App的安装更新机制带来运营方式的变化,url可达,应用间可链接,不仅仅依赖商场分发应用
边栏推荐
- [论文阅读] CKAN: Collaborative Knowledge-aware Atentive Network for Recommender Systems
- Activity jump encapsulation
- Singleton mode encapsulates activity management class
- C#实现获取DevExpress中GridView表格进行过滤或排序后的数据
- 请问postgresql cdc 怎么设置单独的增量模式呀,debezium.snapshot.mo
- The most complete is an I2C summary
- 《通信软件开发与应用》课程结业报告
- Learning note 4 -- Key Technologies of high-precision map (Part 2)
- Universal double button or single button pop-up
- 学习笔记6--卫星定位技术(上)
猜你喜欢

Constraintlayout officially provides rounded imagefilterview
![C language QQ chat room small project [complete source code]](/img/4e/b3703ac864830d55c824e1b56c8f85.png)
C language QQ chat room small project [complete source code]

Secteur non technique, comment participer à devops?
![[论文阅读] CKAN: Collaborative Knowledge-aware Atentive Network for Recommender Systems](/img/6c/5b14f47503033bc2c85a259a968d94.png)
[论文阅读] CKAN: Collaborative Knowledge-aware Atentive Network for Recommender Systems
![[observation] with the rise of the](/img/9a/8bbf98e6aed80638f4340aacec2ea9.jpg)
[observation] with the rise of the "independent station" model of cross-border e-commerce, how to seize the next dividend explosion era?
![[paper reading] kgat: knowledge graph attention network for recommendation](/img/fa/d2061bc7bd437f062d46a009cf32cf.png)
[paper reading] kgat: knowledge graph attention network for recommendation

Learning note 4 -- Key Technologies of high-precision map (Part 2)

How does redis implement multiple zones?

Apple 5g chip research and development failure? It's too early to get rid of Qualcomm

到底谁才是“良心”国产品牌?
随机推荐
MFC宠物商店信息管理系统
AD20 制作 Logo
学习笔记4--高精度地图关键技术(下)
> Could not create task ‘:app:MyTest. main()‘. > SourceSet with name ‘main‘ not found. Problem repair
beego跨域问题解决方案-亲试成功
想请教一下,十大券商有哪些?在线开户是安全么?
Glide Mastery
The horizontally scrolling recycleview displays five and a half on one screen, lower than the average distribution of five
How to judge that the thread pool has completed all tasks?
php解决redis的缓存雪崩,缓存穿透,缓存击穿的问题
[论文阅读] CKAN: Collaborative Knowledge-aware Atentive Network for Recommender Systems
数组、、、
Redis如何实现多可用区?
Detailed explanation of the use of staticlayout
Ad20 make logo
Customize the left sliding button in the line in the applet, which is similar to the QQ and Wx message interface
小程序框架Taro
微信小程序中,从一个页面跳转到另一个页面后,在返回后发现页面同步滚动了
Workmanager Learning one
函数///