duster/js/test_cases/block_simple
Tom Alexander 12d8b58961
Added a block inverse register order to test to prove that partial hierarchy matters.
2020-05-09 16:16:42 -04:00
..
README.md Added a block inverse register order to test to prove that partial hierarchy matters. 2020-05-09 16:16:42 -04:00
base.dust Starting a test for blocks and inline partials. 2020-05-09 15:38:15 -04:00
input1.json Starting a test for blocks and inline partials. 2020-05-09 15:38:15 -04:00
main.dust Starting a test for blocks and inline partials. 2020-05-09 15:38:15 -04:00

README.md

Blocks seem to be rendered with the last inline partial of the same name.

Blocks appear to be able to be registered in a loop, however, their context is defined by the context during the call to the block {+} as opposed to when their override is defined by an inline partial {<}.

Even if the surrounding dust would prevent a section from being rendered, the inline context is still registered, which makes me think inline contexts are parsed out in a single pass regardless of the context.

Inline partials in sub-templates do not seem to bubble up to blocks in the higher templates.

After the inverse register order test it seems that it takes the last inline partial with that name at that level, walking up the tree of partials. So each file will have exactly one value for each block name, consisting of the final inline partial with that name. Then when rendering the block, it will walk up the tree just like the context tree.