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
Extensible template parts #810
Comments
Sorry for the delay in replying to this… The basic issue is that most components need some way to reliably reference elements (parts) in their shadow tree to manipulate their contents, apply styles, or wire up event handlers. All of the Elix components have those needs, but since you asked for specific examples, here’s a representative one. The CalendarMonth component is made up of subelements that render different parts of the calendar: the month/year, the column headers for the week days, and an CalendarDays element that can show the actual grid of dates: <calendar-month>
<calendar-month-year-header id=“monthYearHeader"></calendar-month-year-header>
<calendar-day-names-header id=“dayNamesHeader”></calendar-day-names-header>
<calendar-days id=“daysGrid”></calendar-days>
</calendar-month> If you set the // The date has changed, pass it to the shadow element showing the grid of dates.
this.daysGrid.date = this.date; The issue lies in the above reference to the subelement,
When template instantiation was proposed, the Polymer/lit-html team and I observed it would be useful to provide a Given this, I think the answer to the question about what information would the part need to carry that the browser would clone is: the part would essentially be the @justinfagnani The above is based on my recollection of the conversation at the April 2019 F2F. If I’ve gotten anything wrong or omitted important details, please chime in. |
During the F2F @JanMiksovsky and @justinfagnani brought up some use cases for being able to create your own parts, that the browser would still be responsible for to clone. E.g., having a way to deal with JavaScript properties.
It'd be interesting to know the exact use cases and requirements around this. What kind of information does such a part need to carry that the browser would be responsible to clone? Can we avoid cloning requiring executing JavaScript? Etc.
(Not saying we need this feature for v0 by the way, but it's good to know where folks want to take it as it might influence the design.)
The text was updated successfully, but these errors were encountered: