Better SSR Support
loreanvictor opened this issue · 0 comments
One of the main points of rehtm is that it supports SSR. In an SSR-context, it might easily happen that there is no global document
object, which is referenced in the following parts in the code:
Line 8 in 4238ce1
Line 40 in 4238ce1
Line 12 in 4238ce1
Line 46 in 4238ce1
This should be resolved so that a document object can be provided. I suspect since all of these call sites center around some DOM factory, perhaps a document
property can be added to DOMFactory
type, bubbling upwards the API so that any user can provide a custom API (falling back to the global document
if not provided), potentially adding some generators alongside exported constants, producing something like this in the end:
const { html, template, recipe, cached } = use(document)