Releases: regularjs/regular
release v0.5.2
release v0.5.0
see milestore v0.5.0 for detail
v0.4.4
更新了以下部分 更新列表v.4.4
重要度排序
- 默认extend不再预解析模板, 这个可能在组件数量很大的情况下并且使用类似webpack的整体打包工具时,会引入不必要的组件解析成本。 解析默认放置在实例化阶段, 并且每个组件的模板只会被解析一次。不过你仍然可以通过Regular.config来控制它
Regular.config({
PRECOMPILE: true
})
- 增加了两个事件 $afterConfig, $afterInit, 使得在使用mixin时,可以更好的插入到组件逻辑中,具体顺序请看testcase
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);
+ })
- 初始化时, 父组件不再强制将自己的数据同步给子组件,这个允许子组件在config中准备自己的数据后,同步给父组件
v0.4.3
see milestone:v0.4.3 for details.
summary
new feature
- #62 : stateman
#list
now support Object. you can also use#else
ortrack by syntax
. see testcase for help - #61 : precompile
r-animation
value if the value is a Expression. for Example:<div r-anim='on:enter; class: {animationClass}'>
bugfix
v0.4.2
see milestone:v0.4.2 for detail
0.4.0
-
r-component for dynamic component
<r-component is={componentName} props.... />
-
if Express is const, now regularjs will pass a value but not a Expression like in previous version.
value = {1}
, 1 will pass to directive. -
$watch now accept function for watch complex value
this.$watch(function(){ return global.value }, function (gval, old_gval)) { })
-
#list now support alternative syntax (
{#list list as item} {item.content} {#else} list is not exsits {/list}
) -
support track-by in list statement, performance is awesome now (http://leeluolee.github.io/js-repaint-perfs/).
{#list list as item by item_index} // content here won't be destroy, only updating {/list}
-
r-class r-style will add '{}' for you if you pass a String and missed '{}' for object literal ( "left: left + 'px'" is valid now)
0.3.1 released
Regularjs v0.3.0 released
v0.3.0 is the biggest release after v0.0.1 , we introduce serveral feature to help us using regularjs easily
- The default Syntax changed from
{{}}
to{}
now. but you can return to old syntax use
Regular.config({END: '}}', BEGIN: '{{'})
- Two-way filter is introduced . see reference for detail . It is used to control the flow from view back to model. you can combine it with
r-model
to realize some complex binding. - prevent the safe error. like nested undefined error. for example
{blog.title}
won't throw' read title of undefined 'error now. - Unified
{#include}
andtransclude
. see reference for detail. , you can use transclude content in{#include}
now 。 - add
component.$mute
to disable a component .$inject(false)
to remove component from document. you can usecomponent.$mute(true).$inject(false)
to compeletely remove a component from document now. - ... and fixing some bug
fix #6 and accept [Element ] as the 'template'
0.2.8 release 0.2.8
fix some bug
fix some bug.
- r-model in list or if get uncorrect value. beacuse the dom is not construct ready