summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoranomal00us <95467104+anomal00us@users.noreply.github.com>2022-07-22 11:55:28 +0200
committerroot <root@delphi.lan>2022-08-08 21:08:27 +0200
commitdcc145e50cd966da90b4b506b18359245613ec72 (patch)
tree4433d2af7d728d10c5e00de3c09e17a059be8719
parent6e9b75d723b081048dd5dd863c31cd650a67b2a0 (diff)
downloadmustache-spec-dcc145e50cd966da90b4b506b18359245613ec72.tar.gz
Updating rationale (squashed) (coauthored)
Update specs/~dynamic-names.yml Co-authored-by: Justin Hileman <github@0x7f.us> Update specs/~dynamic-names.yml Co-authored-by: Justin Hileman <github@0x7f.us> Update specs/~dynamic-names.yml Co-authored-by: Justin Hileman <github@0x7f.us> Update specs/~dynamic-names.yml Co-authored-by: Justin Hileman <github@0x7f.us> Update specs/~dynamic-names.yml Co-authored-by: Justin Hileman <github@0x7f.us> Update specs/~dynamic-names.yml Co-authored-by: Justin Hileman <github@0x7f.us>
-rw-r--r--specs/~dynamic-names.json2
-rw-r--r--specs/~dynamic-names.yml21
2 files changed, 12 insertions, 11 deletions
diff --git a/specs/~dynamic-names.json b/specs/~dynamic-names.json
index 84a5473..9c80402 100644
--- a/specs/~dynamic-names.json
+++ b/specs/~dynamic-names.json
@@ -1,5 +1,5 @@
{
- "overview": "Rationale: this special notation was introduced specifically to allow the\ndynamic loading of partials. Although there are already solutions that allow\nto dynamically load partials possible, these solutions either require the use\nof optional (and complex) features such as lambdas, or require mechanisms that\nin interpreted programming languages are rather tedious to implement and are\nalso rather inefficient, both in terms of space, due to a possible necessary\noverhead of the included partials, and in terms of computational efficiency,\nregarding a possible necessary pre-buffering.\n\nDynamic Names are a special notation to dynamically determine a tag's content.\n\nDynamic Names MUST be a non-whitespace character sequence NOT containing\nthe current closing delimiter. A Dynamic Name consists of an asterisk,\nfollowed by a dotted name. The latter follows the same notation as in an\nInterpolation tag.\n\nThis tag's dotted name, which is equal to the Dynamic Name excluding the\nleading asterisk, refers to a key in the context whose value will be used in\nplace of the Dynamic Name itself as content of the tag. The dotted name\nresolution produces the same value as an Interpolation tag and does not affect\nthe context for further processing.\n\nSet Delimiter tags MUST NOT affect the resolution of a Dynamic Name. The\nDynamic Names MUST be resolved against the context stack local to the tag.\nFailed resolution of the dynamic name should result in nothing being rendered.\n\nEngines that implement Dynamic Names MUST support their use in Partial tags.\nIn engines that also implement the optional inheritance spec, Dynamic Names\ninside Parent tags should be supported as well. Dynamic Names cannot be\nresolved more than once (Dynamic Names cannot be nested).\n",
+ "overview": "Rationale: this special notation was introduced specifically to allow the\ndynamic loading of partials. The main advantage that this new special notation\noffers is to allow dynamic loading of partials, which is particularly useful\nin cases where there needs to be rendered polymorphic data or in cases where\nthere is a child template shared by multiple parent templates; cases which\notherwise would be possible to render only by using either complex (and\noptional) features such as lambdas, or by using solutions that are inefficient\nboth in terms of space and in terms of computational efficiency, such as:\noverloading the template with if blocks or preprocessing the template.\n\nDynamic Names are a special notation to dynamically determine a tag's content.\n\nDynamic Names MUST be a non-whitespace character sequence NOT containing\nthe current closing delimiter. A Dynamic Name consists of an asterisk,\nfollowed by a dotted name. The latter follows the same notation as in an\nInterpolation tag.\n\nThis tag's dotted name, which is equal to the Dynamic Name excluding the\nleading asterisk, refers to a key in the context whose value will be used in\nplace of the Dynamic Name itself as content of the tag. The dotted name\nresolution produces the same value as an Interpolation tag and does not affect\nthe context for further processing.\n\nSet Delimiter tags MUST NOT affect the resolution of a Dynamic Name. The\nDynamic Names MUST be resolved against the context stack local to the tag.\nFailed resolution of the dynamic name should result in nothing being rendered.\n\nEngines that implement Dynamic Names MUST support their use in Partial tags.\nIn engines that also implement the optional inheritance spec, Dynamic Names\ninside Parent tags should be supported as well. Dynamic Names cannot be\nresolved more than once (Dynamic Names cannot be nested).\n",
"tests": [
{
"name": "Basic Behavior - Partial",
diff --git a/specs/~dynamic-names.yml b/specs/~dynamic-names.yml
index c7bf7ab..d93fe4f 100644
--- a/specs/~dynamic-names.yml
+++ b/specs/~dynamic-names.yml
@@ -1,12 +1,13 @@
overview: |
Rationale: this special notation was introduced specifically to allow the
- dynamic loading of partials. Although there are already solutions that allow
- to dynamically load partials possible, these solutions either require the use
- of optional (and complex) features such as lambdas, or require mechanisms that
- in interpreted programming languages are rather tedious to implement and are
- also rather inefficient, both in terms of space, due to a possible necessary
- overhead of the included partials, and in terms of computational efficiency,
- regarding a possible necessary pre-buffering.
+ dynamic loading of partials. The main advantage that this notation
+ offers is to allow dynamic loading of partials, which is particularly useful
+ in cases where polymorphic data needs to be rendered, or in cases where
+ a child template is shared by multiple parent templates; cases which
+ otherwise would be possible to render only by using either complex (and
+ optional) features such as lambdas, or by using solutions that are inefficient
+ both in terms of space and in terms of computational efficiency, such as:
+ overloading the template with if blocks or preprocessing the template.
Dynamic Names are a special notation to dynamically determine a tag's content.
@@ -15,15 +16,15 @@ overview: |
followed by a dotted name. The latter follows the same notation as in an
Interpolation tag.
- This tag's dotted name, which is equal to the Dynamic Name excluding the
- leading asterisk, refers to a key in the context whose value will be used in
+ This tag's dotted name, which is the Dynamic Name excluding the
+ leading asterisk, references a key in the context whose value will be used in
place of the Dynamic Name itself as content of the tag. The dotted name
resolution produces the same value as an Interpolation tag and does not affect
the context for further processing.
Set Delimiter tags MUST NOT affect the resolution of a Dynamic Name. The
Dynamic Names MUST be resolved against the context stack local to the tag.
- Failed resolution of the dynamic name should result in nothing being rendered.
+ Failed resolution of the dynamic name SHOULD result in nothing being rendered.
Engines that implement Dynamic Names MUST support their use in Partial tags.
In engines that also implement the optional inheritance spec, Dynamic Names