Open harlan-zw opened 2 months ago
The problem is that the whole application has to be pre-processed. Since we can't know what hooks/components will be called. The DOM elements themselves can only be inserted at the end of <body>
or make a buffer to insert in <head>
, which makes no sense in streaming. However, many web crawlers do not look beyond </head>
, which makes SSR meaningless for SEO.
Yes, the idea is most likely a sync API for v2 that does not support hooks. I need to investigate it more but I believe we could just push the raw tags as json and resolve them client-side.
The exact use case for this is a bit niche though and needs some more thought.
Describe the feature
Related: https://github.com/unjs/unhead/issues/27
Most SSR js frameworks are streamable, we should support the same functionality with Unhead.
There is workarounds available but we should have an official solution that is documented.
Additional information