Sencha Touch 2.1 更新

简介: October 24, 2012 | Jamie Avins http://www.sencha.com/blog/whats-new-in-sencha-touch-2.1/ 啥更新了?What’s New? Sencha Touch 2.1 将是 Sencha 移动框架的下一新版本。

啥更新了?What’s New?

Sencha Touch 2.1 将是 Sencha 移动框架的下一新版本。2.1包括了下列关键更新:性能上的极大改进、正式支持图表、高级列表 List 控件,以及通过 Sencha Mobile Packager 的增强原生支持。

Sencha Touch 2.1 is our next release of the Sencha mobile framework. The 2.1 release includes the following key upgrades: significant performance improvements, charting support, an advanced list component, and enhanced native support through the Sencha Mobile Packager.

性能改进 Improved Performance

在 Sencha Touch 2.0 中令到开发者一点不爽的地方在于,进行内嵌布局的时候遭遇极大的性能问题。后来我们发现,只要把模板割裂开来,而且尽可能提供更多的信息给浏览器知道,即可改善该问题。这点优化不会影响 API 层面,但 DOM 结构以及某些 CSS 样式类就会不同。开发者在升级 Sencha Touch 2.1 的时候请注意这个变化,具体就是某些 CSS 选择器应该更新一下。

In Sencha Touch 2.0 some of our developers experienced nested layout performance issues. Our investigations found that by isolating panels and providing more layout information to the browser, the framework and your application can perform better. This implementation did not change our API, but some small changes to the DOM structure and additional CSS class names are now used to provide this enhancement. Developers of application with custom CSS should review their selectors with this update.

改进的地方还不止一点,当组件或元素控制可视之时则再不需要遍历 DOM,那是因为使用了 CSS 的 transitionEnd 的事件来检测 painted 事件。既然我们无法在 erased 事件中做到这一点,所以我们建议避免你这样做,因为它可能会降低性能。最后,我们新增了任务队列 TaskQueue  的机制,以便优化读、写的操作尤其批量的方式下的操作,因为批量读写很容易引发 DOM 回流。

Another under the hood performance improvement is a change to the ‘painted’ event which uses the CSS transitionEnd event to detect when elements and components are visible instead of having to traverse the DOM. Since we cannot do this for the ‘erased’ event, we recommend avoiding this event where you can as it can degrade performance.

Lastly, we have added a TaskQueue mechanism which helps us batch read or write operations together and prevent interleaving of DOM Read and Write operations in between internal DOM reflows.

图表Sencha Touch Charts

(……图表接触较少,而且篇幅,暂且不译……)

高级列表组件之无限翻页Advanced List component with Infinite scrolling


旧版实现 Formerimplementation

1. 新增了一项Only 1 additional item is loaded
2. 有更新一项,前面那一项被“循环再用”The component is recycled through the list with refreshed content

数据量一大,List 组件就吃不消!Sencha Touch 2.1 新的列表就是为了克服这一致命弱点而来的!此外,除了性能问题,控制列表项比以前更容易了,你只要配置好 itemConfig 和 itemTpl 两项就可以动态转为列表项配置结构,只需配置一次。奥秘在于,我们不但重构了 DOM 的结构,而且还重新设计了数据的绑定方式: 数据源 Data Store 和 DOM 元素之间不再一一对应。于是 DOM 结构包括样式肯定有所改变:例如,要修改列表项的内/外边距,你要把这样的 CSS 选择器“.x-list-item” 改为 “.x-list-item > .x-dock-horizontal > .x-dock-body”。看看例子 TouchTweets,可以反映上述的问题,里面都没有了 DataView,直接用新的列表控件替代。另外,例子中你还能看到新版插件 PullToRefresh 和 ListPaging。

Sencha Touch 2.1 also includes a new List component.The new implementation no longer has degraded performance when using lists with a large number of items in them. In addition, lists can use components if you specify them with an itemConfig and itemTpl will be converted to an itemConfig dynamically if you specify one. This is due to the list no longer being bound one-to-one between a Data Store and the DOM elements. Due to these changes, the DOM structure was altered for List, and you may need to change some CSS selectors to add appropriate styling to your lists. Typically, you need to change the selector from '.x-list-item' to '.x-list-item > .x-dock-horizontal > .x-dock-body' for any padding or margins you may have added. We changed the TouchTweets example with the new implementation; instead of using a component based DataView, it now uses the new List. It’s a good example of using the new List component with dynamic large lists. This example also shows the updated PullToRefresh and ListPaging plugins.

原生打包器 Enhanced Native Support through the Sencha Mobile Packager

Sencha Moblie Packager 包含在新版 Sencha Cmd 中。之前的版本仅是一个 SDK 工具,这次发布新增一个 native 打包器功能。你可以在测试机中、模拟器上面跑你的 apps,Packager 都为你准备好,可试试利用 Contact 联系人的 API 获取电话簿, iOS 或 Android 亦皆无问题。你可以对 packager 导入 iOS 的 info.plist 原始数据,安卓的话通过 rawConfig 导入 AndroidManifest.xml。根据大家的反馈,例如 packager 非管理员的访问这项需求,我们就实现了,——安装的时候不再需要管理员身份。

The Sencha Mobile Packager is included in the new Sencha Cmd, previously known as the SDK tools. In this release, we have enhanced native support. You can now directly run your app on your device as well as the simulator using the native packager. We have also added read only access to the device Contact API for both iOS and Android. The packager config also lets you pass in "raw" data to the iOS info.plist and Android AndroidManifest.xml through the rawConfig key. We also heard your feedback about non-admin access to the native packager, and we have updated the setup so admin access is no longer required.


交付日期 Availability

Sencha Touch 2.1 GA 将于十一月发出(——译注:已正式发布)。请关注我们的博客有关的报道。

Sencha Touch 2.1 GA will be publically available in November. Please watch our blog for the release announcement.


目录
相关文章
|
XML 数据安全/隐私保护 数据格式
【域内提权】GPP组策略首选项提权总结
当域管理员在使用组策略进行批量、统一的配置和管理,如果配置组策略的过程中需要填入密码,那么该密码会被保存到共享文件夹\SYSVOL下
529 0
|
存储 SQL 算法
【笔记】开发指南—DDL语句—分库分表语法—CREATE TABLE
本文主要介绍使用DDL语句进行建表的语法、子句、参数和基本方式。
177 0
|
4天前
|
弹性计算 关系型数据库 微服务
基于 Docker 与 Kubernetes(K3s)的微服务:阿里云生产环境扩容实践
在微服务架构中,如何实现“稳定扩容”与“成本可控”是企业面临的核心挑战。本文结合 Python FastAPI 微服务实战,详解如何基于阿里云基础设施,利用 Docker 封装服务、K3s 实现容器编排,构建生产级微服务架构。内容涵盖容器构建、集群部署、自动扩缩容、可观测性等关键环节,适配阿里云资源特性与服务生态,助力企业打造低成本、高可靠、易扩展的微服务解决方案。
1111 2
|
3天前
|
机器学习/深度学习 人工智能 前端开发
通义DeepResearch全面开源!同步分享可落地的高阶Agent构建方法论
通义研究团队开源发布通义 DeepResearch —— 首个在性能上可与 OpenAI DeepResearch 相媲美、并在多项权威基准测试中取得领先表现的全开源 Web Agent。
582 11
|
13天前
|
人工智能 运维 安全
|
4天前
|
弹性计算 Kubernetes jenkins
如何在 ECS/EKS 集群中有效使用 Jenkins
本文探讨了如何将 Jenkins 与 AWS ECS 和 EKS 集群集成,以构建高效、灵活且具备自动扩缩容能力的 CI/CD 流水线,提升软件交付效率并优化资源成本。
305 0
|
11天前
|
人工智能 异构计算
敬请锁定《C位面对面》,洞察通用计算如何在AI时代持续赋能企业创新,助力业务发展!
敬请锁定《C位面对面》,洞察通用计算如何在AI时代持续赋能企业创新,助力业务发展!
|
12天前
|
机器学习/深度学习 人工智能 自然语言处理
B站开源IndexTTS2,用极致表现力颠覆听觉体验
在语音合成技术不断演进的背景下,早期版本的IndexTTS虽然在多场景应用中展现出良好的表现,但在情感表达的细腻度与时长控制的精准性方面仍存在提升空间。为了解决这些问题,并进一步推动零样本语音合成在实际场景中的落地能力,B站语音团队对模型架构与训练策略进行了深度优化,推出了全新一代语音合成模型——IndexTTS2 。
817 23

热门文章

最新文章