-
Notifications
You must be signed in to change notification settings - Fork 599
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
Add the f-template component which can interpret a text binding and convert it to a ViewTemplate #7073
Add the f-template component which can interpret a text binding and convert it to a ViewTemplate #7073
Conversation
β¦onvert it to a ViewTemplate
fc94e07
to
c88873a
Compare
c88873a
to
2382eef
Compare
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.
This looks good to me, but I have one question. If f-template
expects a name so that it can build a custom element from the provided template then would it make more sense to rename to f-element
instead? I can see value in having both a f-element
component for creating custom elements and a f-template
component for just rendering a ViewTemplate without the need to attach it to a custom element. If I'm mistaken on this then feel free to ignore.
Interesting point, I'm not sure we would ever create a Edit: Thinking on it a little further, we might have a secondary option of referencing other templates so you might have something like: <f-template name="article">
<h2>{{title}}</h2>
<f-template part="content-body" content="{{content}}"></f-template>
</f-template>
<f-template name="card">
<img src="{{imgsrc}}">
<f-template part="content-body" content="{{content}}"></f-template>
<a href="{{link}}">{{linktext}}</a>
</f-template>
<f-template id="content-body">
<p>{{content}}</p>
</f-template> |
Yeah that's kind of what I was thinking. On its own I'm assuming the real, rendered output would just be the contents of the template with any bindings evaluated? Edit: I have something similar to this already in another project for an island component, the main difference there is that it fetches the |
Yes exactly, an example of the rendered output can be seen in the |
Pull Request
π Description
This is some initial work to convert declarative HTML into a
ViewTemplate
.π©βπ» Reviewer Notes
Some of this is preliminary work to get a workflow established for creation of aspect bindings and other requirements for the declarative HTML. This work also exposes the
fastElementRegistry
as well as exposing some global values to trigger instantiated components to update their internal definitions after a new template has been applied.β Checklist
General
$ npm run change
β Next Steps
when