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
Due to popular demand for BTR/SSR solutions, as an alternate approach to using the html tagged template literal this issue outlines the use of a declarative syntax template resolver.
The resolver would require an async approach to resolving and attaching the template. This will require a few pieces, the first is the declarative HTML syntax. Once this has been declared on the page for the custom element, it will be added to the element's definition.
This syntax is a close mirroring of how html template uses directives etc. so as not to confuse current consumers of html tagged template literal. We recognize that there are current efforts to create a standard for declarative HTML, but as they have not passed any meaningful stage at this time we will wait until the platforms proceed with a solution before we consider convergence.
One issue with declarative HTML is that we will not be interpreting any JavaScript, the developers will not be able to do anything like the following: <f-when condition="x.friends.length > 0">. This limitation means that we will only allow function execution from the custom element, or access to attrs/properties.
Declarative HTML Template resolver
The second piece is the interpretation by a resolver to provide the ViewTemplate. This should be located on a different export path, per #7036 compose step example.
Pre-Hydration
Part of how the underlying hydration works is the assignment of unique ids for each function call inside an html tagged template. As this happens in a JS environment, we intend to require any BTR/SSR (Build Time Rendering/Server Side Rendering) to add comments which will then be updated during a pre-hydration step.
Introduction
Due to popular demand for BTR/SSR solutions, as an alternate approach to using the
html
tagged template literal this issue outlines the use of a declarative syntax template resolver.Requires completion of #7036
Requirements
Declarative HTML Template Syntax
The resolver would require an async approach to resolving and attaching the template. This will require a few pieces, the first is the declarative HTML syntax. Once this has been declared on the page for the custom element, it will be added to the element's definition.
Example:
This syntax is a close mirroring of how
html
template uses directives etc. so as not to confuse current consumers ofhtml
tagged template literal. We recognize that there are current efforts to create a standard for declarative HTML, but as they have not passed any meaningful stage at this time we will wait until the platforms proceed with a solution before we consider convergence.One issue with declarative HTML is that we will not be interpreting any JavaScript, the developers will not be able to do anything like the following:
<f-when condition="x.friends.length > 0">
. This limitation means that we will only allow function execution from the custom element, or access to attrs/properties.Declarative HTML Template resolver
The second piece is the interpretation by a resolver to provide the
ViewTemplate
. This should be located on a different export path, per #7036 compose step example.Pre-Hydration
Part of how the underlying hydration works is the assignment of unique ids for each function call inside an
html
tagged template. As this happens in a JS environment, we intend to require any BTR/SSR (Build Time Rendering/Server Side Rendering) to add comments which will then be updated during a pre-hydration step.Example before pre-hydration:
Example after pre-hydration:
The text was updated successfully, but these errors were encountered: