cydran / cydran

Unobtrusive Javascript presentation framework
Other
6 stars 2 forks source link

v() or m() are not being proxied for IMPLICIT component when used as the "empty" type template in c:each scenario #461

Closed evilchia closed 2 years ago

evilchia commented 4 years ago

General Setup

const x_template = "

";

class ComponentX extends Component { constructor(x_template) { this.someList = []; this.attributeXYZ = "Hello"; } }

const emptyTemplate = "

[[m().attributeXYZ]]
";

builder .withPrototype("xcomponent", ComponentX) .withImplicit("myEmpty", emptyTemplate)

Expected Result See "Hello" as value when the c:each (m().someList) is empty or null

evilchia commented 4 years ago

I understand m() normally is NOT proxied to the parent of the "c:each" - we have v() to deal with a value representation but in this particular scenario it makes sense either treat the "empty" template type the same as the "item" type and make v() available OR proxy through an m() representation. This would apply to IMPLICIT templates only in a c:each scenario as an "empty" type. May have applicability with 'first' and 'after' hosting an implicit component. See current version of cydran-es6/es6/index9.html in the repo - lines 134 & 151

matthewwerny commented 4 years ago

Apparently, I missed the non-implicit component case.

matthewwerny commented 2 years ago

This may have been resolved by the FSM refactor, but an explicit integration test case using the test harness paradigm is needed in order to confirm.

matthewwerny commented 2 years ago

I've started work on integration tests for this.

matthewwerny commented 2 years ago

This issue has been resolved.