-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Allow templatizer to be used without owner or host prop forwarding. Fixes #4458 #5035
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation issue listed in the first comment of #4458 has not been resolved yet. In this preview of the docs, the documentation of the function does not mention all options are required.
@TimvdLippe See #4458 (comment), basically this PR makes it work with only one argument, the other two are now actually optional where they were not before. Whoops, I didn't mark the 2nd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah okay. Thanks for the clarification @kevinpschaaf !
lib/utils/templatize.html
Outdated
} | ||
} | ||
for (let hprop in this.__hostProps) { | ||
this._setPendingProperty(hprop, this.__dataHost['_host_' + hprop]); | ||
for (let iprop in props) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add a comment saying that passing in a prop in props
that has the same name as a bound host prop may shadow it. This is considered a user error (warn?). We should add this to the docs too.
Could we check if this PR also fixes #5063? Maybe that can be fixed at the same time. If not, we have to separate the work. |
Makes templatizer safe to be used without an owner (only needed when forwarding props to/from host via
options.forwardHostProp
and automatically hiding/showing children if the owner is hidden). If no owner is used, default template processing and binding evaluation fromPropertyEffects
will be used (normally it delegates to any overrides in the owner). Also no-opsdispatchEvent
so that path notifications when not forwarding to a host does not throw.In this change, filtering the user
props
bag onoptions.instanceProps
was removed since it seems not strictly required.Reference Issue
Fixes #4458
Fixes #3422