Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support collection type and nesting templates diff #70

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

cryzzchen
Copy link

@cryzzchen cryzzchen commented May 16, 2022

Diff 逻辑优化:

  • 当且仅当 templateString 或 part 类型发生变化时,删除 part 并重新渲染,否则则更新 part;
  • 跟踪修改的属性名, normalAttributes 只会在其值真实修改时才会更新
  • 支持移除 Attributes,包括事件类型;

响应式:

  • 支持将 Colleciton (Set, Map, WeakSet, WeakMap)类型的属性设置为响应式;

@codecov
Copy link

codecov bot commented May 16, 2022

Codecov Report

Merging #70 (b14d297) into main (4ccdec1) will increase coverage by 0.14%.
The diff coverage is 92.37%.

@@            Coverage Diff             @@
##             main      #70      +/-   ##
==========================================
+ Coverage   89.62%   89.76%   +0.14%     
==========================================
  Files          45       46       +1     
  Lines         896     1124     +228     
  Branches      211      260      +49     
==========================================
+ Hits          803     1009     +206     
- Misses         92      114      +22     
  Partials        1        1              
Impacted Files Coverage Δ
packages/pwc/src/constants.ts 100.00% <ø> (ø)
...ages/pwc/src/elements/part/utils/createTemplate.ts 100.00% <ø> (ø)
packages/pwc/src/elements/part/base.ts 42.85% <42.85%> (ø)
packages/pwc/src/reactivity/collectionProxy.ts 86.17% <86.17%> (ø)
...ges/pwc/src/elements/part/utils/commitTemplates.ts 88.52% <88.52%> (ø)
packages/pwc/src/reactivity/createReactive.ts 88.88% <88.88%> (ø)
packages/pwc/src/reactivity/track.ts 93.75% <93.75%> (ø)
...es/pwc/src/elements/part/utils/commitAttributes.ts 95.91% <95.91%> (ø)
packages/pwc/src/reactivity/baseProxy.ts 96.42% <96.42%> (ø)
packages/pwc/src/elements/part/template.ts 97.05% <97.05%> (ø)
... and 13 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4ccdec1...b14d297. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant