2. X-Plat Dev-Framework Assessment Criteria
2
Domain Category Factors Details
Infrastructure Maturity
Viability License/open source
X-Plat/Device Supported target platforms
Tool/L Development platforms OS, (language)
Ease of Use/M Deploy channel support restriction, publishing, analytics
Ease of Use/M Monetization support free, freemium, paid, in-app purchase, advert
3rd-Pty Support Internationalization localization
Viability Long-term feasibility backing entity, cycle/update, maturity, stability, (community)
3rd-Pty Support Community adoption, popularity-fork/star/commit, examples
Development Support
Tool Language multiple front-end language support, syntax/style, AOT/JIT
Tool Toolchain complier, (CI/CD)
Tool IDE dependencies, hot reload, autocomplete, syntax check, built-in debug/emulator, (CI/CD)
Tool UI design support hot reload, GUI, no-code/low-code
Ease of Use Testing code analysis, testing API, pressure, profiling, logging
Ease of Use CI/CD build, source/package, pkg-sign, deploy, container
Ease of Use Ramp-up curve boilerplate, document, demo, (language/syntax), (community)
Ease of Use Scalability design pattern, modularization
Other/L Development process fit waterfall, extreme, agile
Ease of Use Maintainability hotfix solution, app structure, LOC, readability, design pattern, in-app doc
3rd-Pty Support Extension plug-in, library, components, (native platform access)
X-Plat/Device Configuration/Product support style/theming/branding, (free/paid), (localization)
App Functionality
Characteristic Philosophies main design target/pattern, characteristics, & optimal app/service type
Capability Device specific hw access
Capability Platform specific function
X-Plat/Device X-device programming
Capability Input heterogeneity
Capability Output heterogeneity
Capability App lifecycle mgmt multithreading/background service/live notification
Capability System integration Cloud API/Backend
Quality Security
Quality Robustness
App Usage
X-Plat/Device Look and feel native appearance, x-plat UI consistency
Quality Performance download/app-size, start-up, execution/speed, rendering, UI responsiveness, power, resource-consumption
Other/L Patterns online/offline running
3. What Makes a Good X-Plat Dev-Framework
3
• Optimize x-ecosystem development: iOS, Android, HarmonyOS, Web(KaiOS/H5)/Webview
• Assume desktop is not our priority, though the support of it is feasible
• Optimize development for 1+8+N x-device use cases
• Assume dynamic coupling of devices
• Laptop programming experience with power of device group
Ideal DevFramework
1
Design
Philosophy
Design characteristic aligned with target deliverable
2 Toolchain Familiar, highly efficient, comprehensive Tool support
3 Ease of use Very easy to learn, use, scale
4 Capability Rich capability for wide range of application
5 X-Device Superior x-plat/device programmability
6 Quality Create high quality/performance target deliverable
7 3rdpty Support Extensive community support
8 Viability Worth developer's long-term investment
17. React Native Teardown: 参考
17
Domain Category Factors Details React Native
Infrastructure
Maturity
Viability License/open source 友好/MIT
X-Plat/Device Supported target platforms
有优势:一次编写,三端运行,自带或依赖V8/JSC/hermes, 官方支持Android/iOS/Web, 微软支
持Win, macOS, Android TV, tvOS, Linux.
Tool/L Development platforms OS, (language)
官方支持CLI,, 第三方支持全平台IDE和web工具
CLI+DevTools+IDE
Ease of Use/M Deploy channel support restriction, publishing, analytics 通过第三方组件支持
Ease of Use/M Monetization support free, freemium, paid, in-app purchase, advert 通过第三方组件支持
3rd-Pty Support Internationalization localization 官方支持
Viability Long-term feasibility backing entity, cycle/update, maturity, stability, (community) 优势,最近官方版本更新9月2020年
3rd-Pty Support Community adoption, popularity-fork/star/commit, examples
158k star 31.3k folk 6.8k watch(React) 90.9k20.1k3.7k(RN) 最活跃的社区和第三方开发者支
持,微软,Facebook支持
Development
Support
Tool Language multiple front-end language support, syntax/style, AOT/JIT 有优势:React/JS流行语言,简洁易上手,依靠runtime
Tool Toolchain complier, (CI/CD) 提供babel编译器及转换打包工具
Tool IDE
dependencies, hot reload, autocomplete, syntax check, built-in
debug/emulator, (CI/CD) 第三方支持全平台IDE和web工具: VS code, ReactIDE(web),Atom(Web),WebStorm,VIM
Tool UI design support hot reload, GUI, no-code/low-code 有优势:提供reactstudio 等工具可视化快速开发原型
Ease of Use Testing code analysis, testing API, pressure, profiling, logging 自带支持,包括静态测试到单元测试到端端测试等。
Ease of Use CI/CD build, source/package, pkg-sign, deploy, container 支持打包,文件包括JSC.so比较大,第三方工具链支持CI/CD支持
Ease of Use Ramp-up curve boilerplate, document, demo, (language/syntax), (community) 语言易用,样例丰富。框架可轻(去掉JSC),或重(加上JSC)
Ease of Use Scalability design pattern, modularization 抽屉式组件设计 + 渐进式开发
Other/L Development process fit waterfall, extreme, agile 适应所有适合MVC的现代开发模式(包括MVC/MVVM等)
Ease of Use Maintainability hotfix solution, app structure, LOC, readability, design pattern, in-app doc 三方组件提供”Hot reloading” ,支持主流MVC/MVVM等设计模式, 支持UI/数据/业务分层。
3rd-Pty Support Extension plug-in, library, components, (native platform access) 大量三方组件,通过不同组件/模块支持对接JSC系统接口或原生Layout引擎
X-Plat/Device Configuration/Product support style/theming/branding, (free/paid), (localization) 有第三方社区开源或商业工具支持
App Functionality
Characteristic Philosophies main design target/pattern, characteristics, & optimal app/service type 一次学习多端应用;web前端技术开发UI,后端原生渲染,支持不同类型的app应用;
Capability Device specific hw access 通过不同平台的RN bridge 模块实现
Capability Platform specific function 通过不同平台的RN bridge模块实现
X-Plat/Device X-device programming 不支持
Capability Input heterogeneity 通过第三方组件实现
Capability Output heterogeneity 通过第三方组件实现
Capability App lifecycle mgmt multithreading/background service/live notification 通过第三方组件实现
Capability System integration Cloud API/Backend 通过第三方组件实现,如嵌入node.js等
Quality Security 提供oAuth2等组件,但是由于组件式设计,本身无安全检查需要,存在”deep link”威胁。
Quality Robustness 有大量商业例证
App Usage
X-Plat/Device Look and feel
native appearance, x-plat UI consistency
针对不同平台提供原生渲染,获得原生APP类似体验,大部分共性跨平台体验一致,平台特性
体验无法保证完全一致
Quality Performance
download/app-size, start-up, execution/speed, rendering, UI
responsiveness, power, resource-consumption 相对原生APP较大,和其他跨平台方案差异不大,性能近原生但受限JSC性能
Other/L Patterns online/offline running 不支持
18. ▪ Flutter, X-platform open-source dev framework, initiated by Google.
▪ 1st release in 2018, and 105k stars (the most & way more than others) at GitHub in Oct.
2020.
▪ BSD 3-clause license - almost no constraint, as long as other company’s names are not used.
▪ Release cadence and versions are fully controlled by Google: TSC Google employees
▪ Fastest growing programming language and framework in 2019.
▪ Support below platforms, with “true” single codebase and the same UI (if preferred):
▪ Android
▪ IOS
▪ Windows
▪ macOS
▪ Linux
▪ Web
Flutter 背景
18
19. ▪ Everything is built-in widget.
▪ “True” single codebase + identical UI across
platforms.
▪ Fully independent from target platforms.
▪ Layered/nested pixel-level control, with the best
performance than others
▪ 自帶渲染引擎: Skia
▪ Only needs canvas for rendering from target
platforms.
▪ Support both AOT (Ahead-of-Time) and JIT:
▪ Able to compile app code into any target
platform’s binary/bytecode, without additional
bridge in the middle (like JavaScript) to sacrifice
the performance
Flutter 架构解析
19Flutter-related diagrams come from https://flutter.dev/tos with terms included.
20. Flutter Engine – How to Access Native Platform Resources
▪ Platform Channels:
▪ Able to access "all" known target
platform's resources like
GPS/camera, with NO limitations.
▪ When needed (for new native
features that Flutter doesn’t
support yet), Dart can do
embedding/integrating/interacting
with native code.
20Flutter-related diagrams come from https://flutter.dev/tos with terms included.
21. Flutter Web Support
21
▪ Flutter supports the “generation” of web content
using standards-based web technologies: HTML,
CSS, DOM and JavaScript.
▪ Flutter implements core drawing layer on top of
standard browser APIs.
▪ Developers can compile existing Flutter code of
Dart into client experience that can be
embedded in browser and deployed to any web
server.
▪ “NO” need of browser plug-in, with the
compilation/conversion generating minified
JavaScript source files (.js).
▪ PWA (progressive web application) is supported as
target package.
▪ Support Embedded interactive content.
▪ Not every HTML scenario is suited for Flutter.
▪ For example, Flutter may not help “blog” much,
which isn’t app-centric and doesn’t focus on
interactive experience much.
Flutter-related diagrams come from https://flutter.dev/tos with terms included.
22. ▪ Both native executables & plug-in are
supported.
▪ Flutter does the work of compilation
& conversion for target platforms.
▪ For now, require building “exactly on”
target platform for desktop support.
▪ On Windows, need “Visual Studio 2019” for
now to generate executable/DLL.
▪ On macOS, need Xcode for now to
generate executable (.app).
Require CocoaPods for generating macOS
plug-in.
▪ On Linux, “snapd” will install all
dependencies for Flutter support, in order
to generate Linux executable.
Flutter Desktop Support
22Flutter-related diagrams come from https://flutter.dev/tos with terms included.
23. ▪ Comprehensive family of official tools/plug-ins (all open source):
▪ Support command line and major IDEs like Android Studio, VS Code, IntelliJ, etc.
▪ Dart DevTool : debugging tool with runtime inspection etc.
▪ Widget Inspector: widget tree hierarchy visualization and exploration.
▪ Timeline View: app monitor at a frame-by-frame level - rendering and computational work can be identified
by this tool.
▪ Source-level Debugger: step through code, set breakpoints and investigate call stack, etc.
▪ Logging View: display events from Dart runtime, application frameworks and app.
▪ Internationalized libraries: localization
▪ Support unit test, automated testing, and continuous integration like Jenkins.
▪ No magic in Flutter tool family. Everything including 3rd-parties is open source.
▪ Built-in rendering engine provide better UI consistency and performance
▪ Decouple with native components to maximize code sharing
▪ Minimize the bridge between app code and native, greatly push the performance closer to native
Flutter Developer Support
23
24. ▪ Code size: significantly bigger output code size due to built-in widgets.
▪ Currently, the smallest app can weigh no less than 4MB for Android, and 10MB for iOS.
▪ To support a new target platform, Flutter need to develop a new set of built-in widgets
corresponding to that target platform
▪ Learning curve: new OOP language - Dart (vs. popular JavaScript)
▪ Flutter project though is open source, TSC is fully controlled by Google, rather than
community (same goes to React Native/Facebook & Xamarin/Microsoft).
▪ No support for 3D yet. Google is having explicit plans exposing 3D APIs.
▪ Surprisingly, Flutter could be difficult to build apps for old 32bit iOS devices like iPhone 5.
Flutter 劣势
24
25. ▪ 105k stars (the most & way more than others) at GitHub in Oct. 2020.
▪ Support the most target platforms, way more than others.
▪ Built-in rendering engine, Skia:
▪ The best display performance at 60fps, way better than other framework. (Sometimes even better than
native apps.)
▪ Support 120fps, while others cannot.
▪ AOT + JIT:
▪ Able to generate platform-specific/independent output with the best performance.
▪ No need of additional translation/bridge, like React Native’s JavaScript.
▪ Built-in widgets for UI:
▪ “True” single codebase with identical UI across target platforms, with pixel-level control.
▪ Comprehensive developer/community support: complete official toolchains, rich
documentations, etc.
▪ Flutter even has/supports dedicated Chinese community support.
Flutter 优势
25
26. ▪ Be “TRUE X-platform” dev framework, and support as many platforms as possible:
▪ Mobiles, Web & Desktops
▪ Mini-apps
▪ Be fully independent from target platforms, in order to achieve great/better performance:
▪ Build an optimal/great compiler engine (with AOT) for better app/speed performance.
▪ Does NOT matter whether choose brand new, or popular programming language.
▪ Great compiler engine can support wide range of target platforms.
▪ Have built-in UI components & rendering engine.
▪ Not only able to provide “true” single codebase and consistent UI.
▪ But also can have better UI/display-related performance.
▪ “MUST” have comprehensive developer experience journey (or just think about “Weex”):
▪ Complete and official toolchain support (like IDE, debugger etc.)
▪ Transparent open source ecosystem to attract developers/3rd-parties, including roadmap, etc.
▪ Active community support (like demos, forums, conference, rich documentations, etc.)
Flutter 借鉴思考
26
Score
Design
Philosophy
Good
Toolchain Good
Ease of use OK
Capability Good
X-Device Limited
Quality Good
3rdpty Support OK
Viability Good
27. Flutter Capabilities: 参考
27
Domain Category Factors Details Flutter
Infrastructure
Maturity
Viability License/open source 友好/BSD 3-clause (Yet, GitHub is fully controlled by Google.)
X-Plat/Device Supported target platforms Support the most target platforms: Android/iOS, Web, Windows/macOS/Linux.
Tool/L Development platforms OS, (language) 全平台 Pack + CLI + DevTools
Ease of Use/M Deploy channel support restriction, publishing, analytics 官方支持 (for Android/iOS)
Ease of Use/M Monetization support free, freemium, paid, in-app purchase, advert 官方支持 (for Google/Apple Pay)
3rd-Pty Support Internationalization localization 官方支持
Viability Long-term feasibility backing entity, cycle/update, maturity, stability, (community) 有优势:Google has been putting huge amount of resources on it, with prompt support.
3rd-Pty Support Community adoption, popularity-fork/star/commit, examples 105k stars, 14.6k forks, 3.2k watches (Oct. 2020) - other frameworks are doing the same way like Flutter.
Development
Support
Tool Language multiple front-end language support, syntax/style, AOT/JIT Need to learn new programming language – Dart
Tool Toolchain complier, (CI/CD) Optimal compiler with AOT, which makes Flutter able to support multiple target platforms easily and well.
Tool IDE
dependencies, hot reload, autocomplete, syntax check, built-in
debug/emulator, (CI/CD) Support all major IDEs including Android Studio, VS Code, IntelliJ, etc.
Tool UI design support hot reload, GUI, no-code/low-code 有优势:Built-in widget to support stateful hot reloading better, and exactly identical UI across platforms.
Ease of Use Testing code analysis, testing API, pressure, profiling, logging 官方支持
Ease of Use CI/CD build, source/package, pkg-sign, deploy, container 官方支持 with bigger code size because of built-in widgets
Ease of Use Ramp-up curve boilerplate, document, demo, (language/syntax), (community) 官方支持 with rich documentations and high-quality demos
Ease of Use Scalability design pattern, modularization 组件式设计 + 渐进式开发
Other/L Development process fit waterfall, extreme, agile 适应现代开发模式
Ease of Use Maintainability hotfix solution, app structure, LOC, readability, design pattern, in-app doc Have the advantages of OOP language like C++, which supports design pattern model etc.
3rd-Pty Support Extension plug-in, library, components, (native platform access) Rich 3rd-party support/community. Can access full native platform resources fully, without limitations.
X-Plat/Device Configuration/Product support style/theming/branding, (free/paid), (localization) 官方支持
App Functionality
Characteristic Philosophies main design target/pattern, characteristics, & optimal app/service type 一次开发多端运行;自帶 UI & 渲染;
Capability Device specific hw access Full access without limitations, via platform channels.
Capability Platform specific function Full access without limitations, via platform channels.
X-Plat/Device X-device programming X-platform/device resource access and computation 官方支持 (Limited support for Android/iOS)
Capability Input heterogeneity True single codebase across all platforms including desktops.
Capability Output heterogeneity Able to generate target platform’s native outputs/executables.
Capability App lifecycle mgmt multithreading/background service/live notification 官方支持
Capability System integration Cloud API/Backend 官方支持
Quality Security 官方支持
Quality Robustness Good reputation, thus more and more frameworks are building on top of, or learning from Flutter.
App Usage
X-Plat/Device Look and feel native appearance, x-plat UI consistency 自帶 UI & 渲染,使跨平台体验保證完全一致
Quality Performance
download/app-size, start-up, execution/speed, rendering, UI
responsiveness, power, resource-consumption The best performance in terms of speed/display, with bigger code size due to built-in widgets.
Other/L Patterns online/offline running 官方支持
39. One Sentence Summary
39
框架 精华 局限
Flutter
提供最好的效能,灵活的UI和完善工具支持,支持最多的平台
(Built-in Widget/Rendering, AOT/Optimal Compiler) Built-in vs. Size Overhead, Learning New Language
React/Native
开放的架构和丰富的社区
(Component Design & Layer Structure) Bridge/JSC Overhead
Weex
采用极简洁又灵活的前端技术,从而最小化门槛
(Vue? DSL? Multi-Frontend?) Web-first vs Native first
Chameleon
多态协议 ,从而实现MVVM跨端环境大统一
(统一接口/组件) 需要学习新语言,需及时更新API实现
UniApp
组件丰富,性能体验好,前端上手容易
(可视IDE/Vue?) 条件编译,需要开发者较多维护工作
Application Native-Platform
native
code
Widgets/
Rendering
Canvas/
Events
System Services
(Location, Sensor, Media)
Application Native-Platform
JScode
Widgets/
Rendering
Canvas/
Events
System Services
(Location, Sensor, Media)
Application Native-Platform
Dartcode
Widgets/
Rendering
Canvas/
Events
System Services
(Location, Sensor, Media)JSbridge
Platform
Channel
原生App应用 React/Weex应用 Flutter应用
40. X-Plat Dev-Framework Risk & Opportunity
40
▪ Risk
▪ Say NO to support X-platform?
▪ X-platform dev framework may not be able to provide an optimal experience to rival native framework
▪ React Native and Flutter has a lead time of 4~5 years, with good performance and community support.
▪ InstantApp/AppClip in western market are different from Mini-App in eastern market
▪ Opportunity
▪ Mini-App ecosystem is more mature in China, posing opportunity to lead western market
▪ Enablement of x-platform computing is not considered in any of current framework – could be a competitive
differentiator
▪ Integrated security model is missing from any of current framework – could be another competitive
differentiator
▪ Enable Flutter (and/or React Native) to support NewOS to help apps migrate
▪ Onboard quality 3rd-party partners to enrich official platform offerings
41. An Ideal X-Plat Dev-Framework Design for NewOS
41
系统管理
是否熟悉?
是否容易上手?
是否简单易用?
是否开发高效?
是否工具丰富?
是否组件丰富?
框架层
原生层
自有DSL语言
(Dart vs ???)
高效JS语言
(Vue/JS+TypeScript)
前端层
是否和原生体验一致?
是否跨平台体验一致?
是否高性能媲美原生?
组件/模块/适配器
Runtime管理
(Optional)
渲染处理(布局,
数据/事件,视图)
原生接口
自有渲染引擎
(e.g.Skia)
VirtualDOM适配
原生渲染引擎
原生适配
Write Once, Run Everywhere
Fast Development & Fast Performance
是否UI性能有保证?
是否UI灵活有保证?
是否容易对接原生功能?
是否扩展能力丰富?
1
2
3
4
43. Design Discussions
43
▪ Built-in Runtime (AOT + JIT) or not
▪ Runtime is key to support hot-reload feature, though potential size impact
▪ Answer: Runtime解释 + 原生机编译的混合模式,旁路JS桥的优化是关键
▪ Built-in Widget/Render or not
▪ Key to achieve UX consistency, yet size impact
▪ Answer: 双路方案,Built-in给原生应用,DOM层对接给即时应用
▪ 腾讯为微信小程序做过reverse尝试 - 前端用微信小程序组件,后端接到Flutter渲染引擎做渲染,但只是内部尝试,没有商用
▪ Mini-App support
▪ Mostly JS/web-view based, could translate at Component level or Virtual DOM level
▪ Answer: 在Virtual DOM层适配有利于前端代码一致性,代码大小和性能要进一步分析
▪ Native platform service access
▪ Need to provide 100% native access support
▪ Answer: 官方模块需要有足够原生能力支撑,避免应用需要耦合原生平台逻辑
▪ Missing pieces
▪ 安全支持和跨平台计算的使能是目前所有平台的欠缺,也是差异化机会
44. X-Plat Dev-Framework Implement Strategy Proposal
44
▪ Grow on top of Flutter??? (For performance and build-in widget/render)
▪ Front-end adopt Vue and/or React (For ease of use) => later add other language when mature
▪ Back-end enable dual mode: built-in rendering for native app, and DOM-level integration for
Web/Mini Program (For UI flexibility and code size optimization)
▪ AOT/JIT hybrid mode (get rid of JSBridge overhead) for high performance & flexibility
▪ Enable seamless X-platform UX & computing, with small footprint for IoT/device.
▪ Ray, an-source distributed computing platform, can potentially be investigated/leveraged. Yet Ray's
latest stable release is possibly too big for resource limited devices.
▪ Currently minimum memory requirement of Ray is 512MB. In addition, Python interpreter is needed with ~50KB
flash and ~8KB RAM depending on target platform and toolchain used.
▪ Customization effort will involve decoupling AI/cloud-related components, adding ad-hoc network support, as
well as distributed heterogeneous resource access (like camera/microphone) among heterogeneous device
group (mobile, IOT etc.)
▪ (Needless to say) UI & BLo decouple => MVC/MVP/MVVM
▪ (Needless to say) Toolchain & Community