Skip to content
This repository has been archived by the owner on Mar 7, 2024. It is now read-only.

Commit

Permalink
perf(remax): 避免更新没有变化的属性 (#989)
Browse files Browse the repository at this point in the history
* perf(remax): 避免更新没有变化的属性

* chore: 更新 update 路径

* chore: payload 更新需要别名

* chore: 微信和头条也支持

* chore: normalizer

* chore: index path 问题

* chore: 修复 plain-text 更新

* test: update snapshot

* test: update snapshot

* chore: 去除多余文件

* test: make codecov happy

* fix: 修复type错误

* chore: 修复 type 错误

* fix: toutiao  base template name

* test: update snapshot

* chore: 修改 key

* test: update snapshot

* chore: 重命名 SetUpdate

* test: update snapshot

* test: update snapshot

* chore: 修改 update

* test: update test snapshot

Co-authored-by: noyobo <[email protected]>
  • Loading branch information
Darmody and noyobo committed Jun 1, 2020
1 parent 2781d0f commit 4709bda
Show file tree
Hide file tree
Showing 70 changed files with 1,952 additions and 2,420 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template name="REMAX_TPL">
<block tt:for="{{tree.root.children}}" tt:key="{{id}}">
<template is="{{'REMAX_TPL_' + item.type}}" data="{{i: item}}" />
<block tt:for="{{root.children}}" tt:key="*this">
<template is="{{'REMAX_TPL_' + root.nodes[item].type}}" data="{{i: root.nodes[item]}}" />
</block>
</template>

Expand Down Expand Up @@ -38,7 +38,7 @@
>

<block tt:for="{{i.children}}" tt:key="{{id}}">
<template is="{{'REMAX_TPL_' + item.type}}" data="{{i: item}}" />
<template is="{{'REMAX_TPL_' + i.nodes[item].type}}" data="{{i: i.nodes[item]}}" />
</block>

</button>
Expand All @@ -65,7 +65,7 @@
>

<block tt:for="{{i.children}}" tt:key="{{id}}">
<template is="{{'REMAX_TPL_' + item.type}}" data="{{i: item}}" />
<template is="{{'REMAX_TPL_' + i.nodes[item].type}}" data="{{i: i.nodes[item]}}" />
</block>

</canvas>
Expand All @@ -87,7 +87,7 @@
>

<block tt:for="{{i.children}}" tt:key="{{id}}">
<template is="{{'REMAX_TPL_' + item.type}}" data="{{i: item}}" />
<template is="{{'REMAX_TPL_' + i.nodes[item].type}}" data="{{i: i.nodes[item]}}" />
</block>

</checkbox>
Expand All @@ -104,7 +104,7 @@
>

<block tt:for="{{i.children}}" tt:key="{{id}}">
<template is="{{'REMAX_TPL_' + item.type}}" data="{{i: item}}" />
<template is="{{'REMAX_TPL_' + i.nodes[item].type}}" data="{{i: i.nodes[item]}}" />
</block>

</checkbox-group>
Expand All @@ -117,7 +117,7 @@
>

<block tt:for="{{i.children}}" tt:key="{{id}}">
<template is="{{'REMAX_TPL_' + item.type}}" data="{{i: item}}" />
<template is="{{'REMAX_TPL_' + i.nodes[item].type}}" data="{{i: i.nodes[item]}}" />
</block>

</custom-component>
Expand All @@ -131,7 +131,7 @@
>

<block tt:for="{{i.children}}" tt:key="{{id}}">
<template is="{{'REMAX_TPL_' + item.type}}" data="{{i: item}}" />
<template is="{{'REMAX_TPL_' + i.nodes[item].type}}" data="{{i: i.nodes[item]}}" />
</block>

</foo-bar>
Expand All @@ -151,7 +151,7 @@
>

<block tt:for="{{i.children}}" tt:key="{{id}}">
<template is="{{'REMAX_TPL_' + item.type}}" data="{{i: item}}" />
<template is="{{'REMAX_TPL_' + i.nodes[item].type}}" data="{{i: i.nodes[item]}}" />
</block>

</form>
Expand All @@ -170,7 +170,7 @@
>

<block tt:for="{{i.children}}" tt:key="{{id}}">
<template is="{{'REMAX_TPL_' + item.type}}" data="{{i: item}}" />
<template is="{{'REMAX_TPL_' + i.nodes[item].type}}" data="{{i: i.nodes[item]}}" />
</block>

</icon>
Expand All @@ -197,7 +197,7 @@
>

<block tt:for="{{i.children}}" tt:key="{{id}}">
<template is="{{'REMAX_TPL_' + item.type}}" data="{{i: item}}" />
<template is="{{'REMAX_TPL_' + i.nodes[item].type}}" data="{{i: i.nodes[item]}}" />
</block>

</image>
Expand Down Expand Up @@ -236,7 +236,7 @@
>

<block tt:for="{{i.children}}" tt:key="{{id}}">
<template is="{{'REMAX_TPL_' + item.type}}" data="{{i: item}}" />
<template is="{{'REMAX_TPL_' + i.nodes[item].type}}" data="{{i: i.nodes[item]}}" />
</block>

</input>
Expand All @@ -253,7 +253,7 @@
>

<block tt:for="{{i.children}}" tt:key="{{id}}">
<template is="{{'REMAX_TPL_' + item.type}}" data="{{i: item}}" />
<template is="{{'REMAX_TPL_' + i.nodes[item].type}}" data="{{i: i.nodes[item]}}" />
</block>

</label>
Expand Down Expand Up @@ -284,7 +284,7 @@
>

<block tt:for="{{i.children}}" tt:key="{{id}}">
<template is="{{'REMAX_TPL_' + item.type}}" data="{{i: item}}" />
<template is="{{'REMAX_TPL_' + i.nodes[item].type}}" data="{{i: i.nodes[item]}}" />
</block>

</navigator>
Expand Down Expand Up @@ -312,7 +312,7 @@
>

<block tt:for="{{i.children}}" tt:key="{{id}}">
<template is="{{'REMAX_TPL_' + item.type}}" data="{{i: item}}" />
<template is="{{'REMAX_TPL_' + i.nodes[item].type}}" data="{{i: i.nodes[item]}}" />
</block>

</picker>
Expand All @@ -336,10 +336,10 @@
value="{{i.props['value']}}"
>

<block tt:for="{{i.children}}" tt:key="{{item.id}}">
<block tt:for="{{i.children}}" tt:key="*this">
<picker-view-column>
<view tt:for="{{item.children}}">
<template is="{{'REMAX_TPL_' + item.type}}" data="{{i: item}}" />
<view tt:for="{{i.nodes[item].children}}" tt:for-item="sItem">
<template is="{{'REMAX_TPL_' + i.nodes[item].nodes[sItem].type}}" data="{{i: i.nodes[item].nodes[sItem]}}" />
</view>
</picker-view-column>
</block>
Expand All @@ -353,7 +353,7 @@
>

<block tt:for="{{i.children}}" tt:key="{{id}}">
<template is="{{'REMAX_TPL_' + item.type}}" data="{{i: item}}" />
<template is="{{'REMAX_TPL_' + i.nodes[item].type}}" data="{{i: i.nodes[item]}}" />
</block>

</picker-view-column>
Expand All @@ -380,7 +380,7 @@
>

<block tt:for="{{i.children}}" tt:key="{{id}}">
<template is="{{'REMAX_TPL_' + item.type}}" data="{{i: item}}" />
<template is="{{'REMAX_TPL_' + i.nodes[item].type}}" data="{{i: i.nodes[item]}}" />
</block>

</progress>
Expand All @@ -401,7 +401,7 @@
>

<block tt:for="{{i.children}}" tt:key="{{id}}">
<template is="{{'REMAX_TPL_' + item.type}}" data="{{i: item}}" />
<template is="{{'REMAX_TPL_' + i.nodes[item].type}}" data="{{i: i.nodes[item]}}" />
</block>

</radio>
Expand All @@ -419,7 +419,7 @@
>

<block tt:for="{{i.children}}" tt:key="{{id}}">
<template is="{{'REMAX_TPL_' + item.type}}" data="{{i: item}}" />
<template is="{{'REMAX_TPL_' + i.nodes[item].type}}" data="{{i: i.nodes[item]}}" />
</block>

</radio-group>
Expand All @@ -443,7 +443,7 @@
>

<block tt:for="{{i.children}}" tt:key="{{id}}">
<template is="{{'REMAX_TPL_' + item.type}}" data="{{i: item}}" />
<template is="{{'REMAX_TPL_' + i.nodes[item].type}}" data="{{i: i.nodes[item]}}" />
</block>

</rich-text>
Expand Down Expand Up @@ -473,7 +473,7 @@
>

<block tt:for="{{i.children}}" tt:key="{{id}}">
<template is="{{'REMAX_TPL_' + item.type}}" data="{{i: item}}" />
<template is="{{'REMAX_TPL_' + i.nodes[item].type}}" data="{{i: i.nodes[item]}}" />
</block>

</scroll-view>
Expand Down Expand Up @@ -505,7 +505,7 @@
>

<block tt:for="{{i.children}}" tt:key="{{id}}">
<template is="{{'REMAX_TPL_' + item.type}}" data="{{i: item}}" />
<template is="{{'REMAX_TPL_' + i.nodes[item].type}}" data="{{i: i.nodes[item]}}" />
</block>

</slider>
Expand Down Expand Up @@ -538,10 +538,10 @@
vertical="{{i.props['vertical']}}"
>

<block tt:for="{{i.children}}" tt:key="{{id}}">
<swiper-item key="{{item.props.key}}">
<block tt:for="{{item.children}}" tt:key="{{id}}">
<template is="{{'REMAX_TPL_' + item.type}}" data="{{i: item}}" />
<block tt:for="{{i.children}}" tt:key="*this">
<swiper-item key="{{i.nodes[item].props.key}}">
<block tt:for="{{i.nodes[item].children}}" tt:key="*this" tt:for-item="sItem">
<template is="{{'REMAX_TPL_' + i.nodes[item].nodes[sItem].type}}" data="{{i: i.nodes[item].nodes[sItem]}}" />
</block>
</swiper-item>
</block>
Expand All @@ -566,7 +566,7 @@
>

<block tt:for="{{i.children}}" tt:key="{{id}}">
<template is="{{'REMAX_TPL_' + item.type}}" data="{{i: item}}" />
<template is="{{'REMAX_TPL_' + i.nodes[item].type}}" data="{{i: i.nodes[item]}}" />
</block>

</switch>
Expand All @@ -586,7 +586,7 @@
>

<block tt:for="{{i.children}}" tt:key="{{id}}">
<template is="{{'REMAX_TPL_' + item.type}}" data="{{i: item}}" />
<template is="{{'REMAX_TPL_' + i.nodes[item].type}}" data="{{i: i.nodes[item]}}" />
</block>

</text>
Expand Down Expand Up @@ -627,7 +627,7 @@
>

<block tt:for="{{i.children}}" tt:key="{{id}}">
<template is="{{'REMAX_TPL_' + item.type}}" data="{{i: item}}" />
<template is="{{'REMAX_TPL_' + i.nodes[item].type}}" data="{{i: i.nodes[item]}}" />
</block>

</textarea>
Expand Down Expand Up @@ -678,7 +678,7 @@
>

<block tt:for="{{i.children}}" tt:key="{{id}}">
<template is="{{'REMAX_TPL_' + item.type}}" data="{{i: item}}" />
<template is="{{'REMAX_TPL_' + i.nodes[item].type}}" data="{{i: i.nodes[item]}}" />
</block>

</video>
Expand Down Expand Up @@ -710,7 +710,7 @@
>

<block tt:for="{{i.children}}" tt:key="{{id}}">
<template is="{{'REMAX_TPL_' + item.type}}" data="{{i: item}}" />
<template is="{{'REMAX_TPL_' + i.nodes[item].type}}" data="{{i: i.nodes[item]}}" />
</block>

</view>
Expand All @@ -726,7 +726,7 @@
>

<block tt:for="{{i.children}}" tt:key="{{id}}">
<template is="{{'REMAX_TPL_' + item.type}}" data="{{i: item}}" />
<template is="{{'REMAX_TPL_' + i.nodes[item].type}}" data="{{i: i.nodes[item]}}" />
</block>

</web-view>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<import src="/base.ttml"/>
<template is="REMAX_TPL" data="{{tree: action}}" />
<template is="REMAX_TPL" data="{{root: root}}" />
Loading

1 comment on commit 4709bda

@vercel
Copy link

@vercel vercel bot commented on 4709bda Jun 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.