glimmerjs / glimmer-vm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Improve component tag caching for case of attribute bindings

lifeart opened this issue · comments

for js-framework benchmark

"select row case"

I'm trying to debug vm stack,

given:

  • each loop
  • closure on loop item
  • ...attribute class binding
<MyComponent class={{if (eq a b) "c" "d"}} @foo={{bar}} />

MyComponent template has ...attributes binding for <tr> tag.

current behavour:

invalidation of a/b for closure condition inside loop, invalidates component tag itself

image

jump if not modified not working, and all components checks rerunning.

because we have to execute patch-element (...attributes closure from class={...})

expected behavour:

...attribute "class" modification should not invalidate component tag (should we have one more stack for it?)

idea is - do not invalidate component tag if only binded attribute changed (outside)

ref: #132

corner case may be in case of we have to merge attribute modification logic, but it's statically analyzed.

example:

// parent:
<Child class="foo" />
// child:
<tr ...attributes class="things to merge">...</tr>

or move "patch-element" logic before "jump-if-not-modified", without counting it's tag