Determine how FASTStyle and Command Buffering client code gets exposed #5908
Labels
area:ssr
Pertains to SSR.
improvement
A non-feature-adding improvement
status:needs-investigation
Needs additional investigation
Milestone
SSR has two features that require client-side JavaScript code to be executed prior to custom element parsing on the client;
FASTStyle
custom elementFor both of these features, we need to decide how exactly to expose the JavaScript for those features. The JavaScript will need to be emitted to a
<script>
element in the page response / resulting HTML.Emit from
TemplateRenderer.render()
A naive approach would be to emit the code when configured whenever
TemplateRenderer.render()
is called. However, this would limit implementations to only invokingTemplateRenderer.render()
oncer per page request, otherwise duplicating the script code which would cause client side errors from defining the same element multiple times.Require authors to write the <script> into the template / page response
@microsoft/fast-ssr
can expose the script content as a string. With that, authors can write that script content into their template, or otherwise ensure it is sent appropriately with the request response. At this point this is the approach I would prefer but I'm open to other ideas or ways to improve.The text was updated successfully, but these errors were encountered: