You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Async work has exposed what I believe to be a flaw in my pattern parameter algorithm.
Consider the following set of patterns:
paramParent.mustache
{{> test-paramMiddle(class: "foo") }}
paramParent.json
{
"url" : "link.test-foo"
}
paramMiddle.mustache
<divclass="{{class}}">
{{> test-link }}
</div>
link.mustache
<ahref="{{url}}">Click Here for Foo Pattern</a>
Expected Outcome
<divclass="foo"><ahref="../../patterns/test-foo/test-foo.rendered.html">Click Here for Foo Pattern</a></div>
Actual Outcome
<divclass="foo"></div>
Analysis
After troubleshooting for a while, I've called into question my decision to consume (i.e. immediately render) patterns when a pattern parameter is present. With async rendering within loops and recursion, this is just a nightmare.
What I am now pivoting to is a replacement of values only.
So we see class patternParameter, we replace the paramMiddle partial to:
<divclass="foo">
{{> test-link }}
</div>
and then carry on with additional resolution. I think this will yield results more consistent with user' expectations.
The text was updated successfully, but these errors were encountered:
Async work has exposed what I believe to be a flaw in my pattern parameter algorithm.
Consider the following set of patterns:
paramParent.mustache
{{> test-paramMiddle(class: "foo") }}
paramParent.json
paramMiddle.mustache
link.mustache
Expected Outcome
Actual Outcome
Analysis
After troubleshooting for a while, I've called into question my decision to consume (i.e. immediately render) patterns when a pattern parameter is present. With async rendering within loops and recursion, this is just a nightmare.
What I am now pivoting to is a replacement of values only.
So we see
class
patternParameter, we replace theparamMiddle
partial to:and then carry on with additional resolution. I think this will yield results more consistent with user' expectations.
The text was updated successfully, but these errors were encountered: