-
-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unify all templating attributes to have the same prefix #23
Comments
This will also make #22 easier to implement. |
I think the issue here is with legacy template code, particularly for the I'm not sure that the use case for renaming Although it is extra work, is it worth considering considering |
I am aware that renaming
Do you want |
I agree with Tomos that I see no particular need for renaming |
Sorry for being unclear: "arg" in my example represents the parameter name, not the string To restate, I was suggesting |
How about a - default - legacy mode that will accept both Doing this would then enable to select any prefix to be used instead of |
Sounds like the right sort of approach: I would advise caution at treating namespace prefixes in the same way as prefixes within the attribute name, however - as I'm sure you already appreciate, they are not the same thing! |
Status quo
At the moment we have most of the templating attributes share the prefix
data-template
There is two exceptions
data-target
to identify a node/ slot where children of the calling element withdata-template="templates:include"
be placeddata-template
Proposed change
Disambiguate and unify
I would propose to unify those two to
data-template-target
making its purpose more obviousdata-template-function
for the same reasonTemplate function parameters
Additional parameters to template functions are also placed alongside other template attributes.
The parameter value
$arg
for a template function declared asmy:func($node, $model, $arg)
is defined in thetemplate with
data-template-arg
. This can lead to hard to debug naming collisions.A hypothetical template function
my:clash($node, $model, $use-when)
would collide with the newly addeddata-template-use-when
(see #20).We can mitigate that by defining that additional template function parameter must be declared with
data-template-parameter-<name>
.The text was updated successfully, but these errors were encountered: