Conformance Examples 0.1.0 — Partials: partial-blocks¶
partial-block-renders-fallback-when-key-resolves-to-nothing¶
A static {{#> key }} … {{/>}} partial block whose key matches no inline definition and no loader entry renders its fallback body.
Template
Partials
Output
partial-block-hit-renders-the-partial-and-discards-the-fallback¶
When the key resolves against the loader, the resolved partial renders and the fallback body is discarded entirely.
Template
Partials
myPartial:
Output
partial-block-renders-fallback-with-no-loader-registered-at-all¶
Unlike a bare {{> key }} tag, which hard-fails with KB-4002 when no onLoadPartial loader is registered, a partial block with no loader at all (the fixture's partials map is omitted) renders its fallback instead.
Template
Output
partial-block-dynamic-key-hit-renders-the-resolved-partial¶
A dynamic {{#> (expr) }} key that resolves against the loader renders the resolved partial, discarding the fallback, exactly like the static-key hit case.
Template
Context
Partials
myPartial:
Output
partial-block-dynamic-key-miss-renders-fallback-with-no-soft-fail-reported¶
A dynamic key that resolves to nothing renders the fallback silently: unlike a bare {{> (expr) }} miss, which reports an UnresolvedReference (KB-5005) soft failure, a partial block's fallback is itself the miss handling, so no soft-fail event is emitted at all.
Template
Context
Partials
Output
partial-block-in-scope-inline-definition-shadows-the-loader¶
An in-scope {{#inline name }} definition wins over a loader entry of the same name, exactly as it does for a bare {{> name }} reference; the fallback is discarded because the inline definition counts as a hit.
Template
Partials
myPartial:
Output
partial-block-context-argument-applies-only-to-the-resolved-partial¶
The trailing context argument on {{#> key ctx }} pushes ctx as the resolved partial's scope on a hit, exactly like {{> key ctx }}; it has no bearing on the fallback, which is never rendered in this case.
Template
Context
Partials
myPartial:
Output
partial-block-fallback-renders-against-the-current-context-not-the-context-argument¶
On a miss, the fallback is inline template content, not a partial invocation: it renders against the current context, never against the block's context argument, since the context argument only ever applies to the resolved partial on a hit.
Template
Context
Output
Source fixture: partials/partial-blocks.json