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
[labs/ssr] Option to omit <!--lit-part--> comments
#1928
Comments
|
Yeah, I think we could probably add a render option to omit the hydration markers. Thanks for the feature request. |
|
That's great to hear, thanks. |
<!--lit-part--> comments
|
I'm using lit-ssr to render more than just bits of the HTML page, so this issue is a little more critical for my use case. For my project, I'd like to render the HTML document bits like Is there a suggested workaround we could use until this is handled in the package? Thanks for any information! |
In @lit-labs/eleventy-plugin-lit we have a hacky workaround to just remove the outer comments with a regexp:
|
|
Thanks! I just opted to use decomment package since I actually want to get rid of all HTML comments in output instead of just lit's markers. Worked like a charm! |
<!--lit-part--> comments<!--lit-part--> comments
|
I hope to take a look at this soon. We need to figure out how exactly this would be exposed API-wise. Some of the use-cases we're aware of include server-only templates for creating a page shell, with server/client templates nesting within. For that I think we'll need a separate template tag and/or brand for its TemplateResult to tell the SSR renderer to omit comments. |
|
Check out the new server-only templates, which address this use case! |
Hi, I'm evaluating the new SSR capability, and its suitability for replacing
lit-html-serverfor various tasks. I'm running a simple test:And getting output like:
So far so good. I imagine that the
lit-partcomments are useful for rehydrating server-side rendered templates on the client - which I guess is your main use-case. But I'm also considering other templating uses, such as:Now I guess I can add a stage to my tasks to parse out those comments, but I'm just wondering if these are valid use cases for lit-labs/ssr, and if so whether an extra rendering option (perhaps included in the
renderInfoparameter to render) could indicate that they are not needed and leave them out?The text was updated successfully, but these errors were encountered: