坏消息:Flutter官方暂时不会开发热更新(Code push)了。

坏消息

自从接触Flutter以来一直就觉得热更新/动态化是一个关键的点,也是很多互联网厂家是否选择Flutter的重要因素甚至是首要因素,之前参加Google北京办公室举办的和Flutter工程师面对面的活动,来自各个厂家的程序员们提的最多的问题就是Flutter对热更新的支持。年初的时候看到2019年的Roadmap增加了对热更新的支持还着实高兴了一阵子,然而前一阵子去看相关的issue时候却发现了这个令人失望的消息:Flutter官方暂时不会开发热更新(Code push)了。

原文如下:

This was previously on our roadmap for 2019. After investigating this in greater detail, we have decided not to proceed with this work for now.

There were several factors that led us to this decision:

To comply with our understanding of store policies on Android and iOS, any solution would be limited to JIT code on Android and interpreted code on iOS. We are not confident that the performance characteristics of such a solution on iOS would reach the quality that we demand of our product. (In other words, “it would be too slow”.)

There are some serious security concerns. Since these patches would essentially allow arbitrary code execution, they would be extremely attractive malware vectors. We could mitigate this by requiring that patches be signed using the same key as the original package, but this is error prone and any mistake would have serious consequences. This is, fundamentally, the same problem that has plagued platforms that allow execution of code from third-party sources. This problem could be mitigated by integrating with a platform update mechanism, but this defeats the purpose of an out-of-band patching mechanism.

There is currently no out-of-the-box open source hosting solution for patching applications, so we would either have to rely on people configuring their Web servers accordingly, or we would have to create integrations for proprietary third-party services, or we would have to create our own bespoke solution. Hosting patches is a space we are not eager to enter. Having people configure their own server leaves them open to making mistakes with potentially serious implications as explained in the previous point about security. Depending on third-party services puts Flutter in an awkward position of having to pick winners and exposes us to the risk of those projects themselves making policy changes that would affect this feature.

We prefer to spend our engineering effort on other issues for now. We expect to keep experimenting in this space and will probably become serious about this again in the future (for example, we will probably need an update solution for desktop applications), but probably not this year.

github.com/flutter/flu…

简单翻译一下:

这个功能(code push)原本在Flutter的2019年路线图里。但是在仔细研究了相关细节以后我们决定目前先不搞了。

我们做这个决定有这么几个原因:

根据我们所理解的Android和iOS应用商店的规定。要实现Code push,在Android平台上会被限制在JIT代码。在iOS平台上会被限制在解释执行的代码。我们对于这样的限制下的解决方案在iOS平台上的性能表现能否达到我们的预期没有信心。(换句话说,“跑起来会慢的吓人吧”)。

其次就是安全方面的考虑。因为补丁会允许任意代码的执行。这会让补丁变成极具吸引力的流氓软件载体。通过强制补丁必须使用和app相同的key做签名可以缓解这一风险,但这样做也容易出错,而且一点出错有可能会导致严重的后果。这也是给一些允许执行第三方代码的平台造成困扰的根本问题。这一问题可以通过在平台里内置更新机制来缓解,但这也违背了我们想提供一个和平台无关的补丁机制的目标。

目前没有可以开箱即用的用于发放补丁的开源解决方案。所以要么我们把这个问题扔给用户,让用户在自己的Web服务器上去配置,或者我们不得不集成第三方私有服务,亦或者我们自己去创建这样的解决方案。然而我们自己并不想搞,客户自己去配置呢,他们有可能会犯上述安全方面的错误。依赖第三方服务则会把Flutter置于一个尴尬的位置。我们不得不从众多第三方服务中选择一个,并且存在第三方服务有可能自行制定相关规则从而影响Flutter的Code push功能。

目前我们更愿意把资源投入到其他问题上。我们会持续验证这个功能,而且说不定将来哪一天再次决定真的要把Code push搞起来 (例如,我们有可能需要给PC端Flutter app做更新解决方案)。但大概不会是在今年。

感想

Flutter的面世确实惊艳,一次编写,多端运行(Android/iOS/PC/浏览器)。可以媲美原生的运行体验。然而,我认为缺少热更新的Flutter是不完整的,也称不上是革命性的。只有对现有移动端开发范式/生态有颠覆性的改变,才能称得上是革命性的。

最后

自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。

深知大多数初中级Android工程师,想要提升技能,往往是自己摸索成长,自己不成体系的自学效果低效漫长且无助

因此我收集整理了一份《2024年Android移动开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。

既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上Android开发知识点!不论你是刚入门Android开发的新手,还是希望在技术上不断提升的资深开发者,这些资料都将为你打开新的学习之门

如果你觉得这些内容对你有帮助,需要这份全套学习资料的朋友可以戳我获取!!

由于文件比较大,这里只是将部分目录截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且会持续更新!
较大,这里只是将部分目录截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且会持续更新!**

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值