RegularJS 0.4.4 发布了。
重要度排序
1.默认extend不再预解析模板, 这个可能在组件数量很大的情况下并且使用类似webpack的整体打包工具时,会引入不必要的组件解析成本。 解析默认放置在实例化阶段, 并且每个组件的模板只会被解析一次。不过你仍然可以通过Regular.config来控制它[code]Regular.config({
PRECOMPILE: true})[/code]2.增加了两个事件 $afterConfig, $afterInit, 使得在使用mixin时,可以更好的插入到组件逻辑中,具体顺序请看testcase[code]it('feature #82', function(){
+ var i = 0;
+ var mixins = {
+ events: {
+ $afterConfig: function(){
+ i++;
+ expect(i).to.equal(3)
+ },
+ $config: function(){
+ i++;
+ expect(i).to.equal(1)
+ },
+ $init: function(){
+ i++;
+ expect(i).to.equal(4)
+
+ },
+ $afterInit: function(){
+ i++;
+ expect(i).to.equal(6)
+ }
+ }
+ }
+
+ var Component = Regular.extend({
+ config: function(){
+ i++;
+ expect(i).to.equal(2)
+ },
+ init: function(){
+ i++;
+ expect(i).to.equal(5)
+ }
+ }).implement(mixins)
+
+ new Component();
+
+ expect(i).to.equal(6);
+ })
初始化时, 父组件不再强制将自己的数据同步给子[/code]3.初始化时, 父组件不再强制将自己的数据同步给子组件,这个允许子组件在config中准备自己的数据后,同步给父组件
软件详情:https://github.com/regularjs/regular/issues?q=milestone%3Av0.4.4+is%3Aclosed
下载地址:https://github.com/regularjs/regular/archive/v0.4.4.tar.gz
来自:开源中国社区

