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
[X ] I searched for an existing RRFC which might be relevant to my RRFC
Motivation
This has been a long standing request and is generally useful when passing around blobs of related data that should be handed down between elements together.
Values that are spread into elements can conflict with otherwise bound values. While not necessarily harmful and following a simple "last one wins" rule, this behavior could be unexpected or a potential foot-gun. It's up to the user to understand this and ensure proper configuration.
The text was updated successfully, but these errors were encountered:
I don't think that this feature would be a good enhancement for Lit. The main drawback I see with it is that it muddles the template language in an unacceptable way.
The example posted gives the impression that the template is still legible.
I believe this example is not representative and a common template would be
html`<x-foo${spread(props)}>...`
This is disruptive to how we read templates and makes it really hard to understand what a component does.
The use case of dynamic properties is niche enough that a "userland" solution is good enough.
Motivation
This has been a long standing request and is generally useful when passing around blobs of related data that should be handed down between elements together.
Supporting this capability could also be used to satisfy [RRFC] Better Declarative Host Manipulation.
Example
How
Here is a slightly opinionated prototype of a
spread
directive. Sample usage with a bit of explanation inline:Opinions (favoring simplicity)
in
checkIn addition, the prototype provides a
host
directive that can be used inChildPart
position, e.g.And a
tag
directive that obviates the need to usestatic-html
, also building uponspread
, e.g.Caveats
Values that are spread into elements can conflict with otherwise bound values. While not necessarily harmful and following a simple "last one wins" rule, this behavior could be unexpected or a potential foot-gun. It's up to the user to understand this and ensure proper configuration.
The text was updated successfully, but these errors were encountered: