Describe the feature you'd love to see
For an upcoming bomb.sh project, we'll be publishing Preact bindings for TUI projects. Because we're running in a non-browser environment, there is no global document variable.
To my great pleasure, I saw that Preact 11 has moved to scoped doc references that are dervied from node.ownerDocument.
This almost unburdens us from needing a globalThis.document shim. Unfortunately, there's still a single unguarded document reference in render.js.
Additional context
On our side, we need to define globalThis.document = undefined to avoid the ReferenceError (or wire a proper document shim).
If Preact 11 added a typeof document !== 'undefined' or 'document' in globalThis before checking if parentDom == document, we'd be able to remove our userland shim and Preact would be fully "native-compatible".
Fairly minimal change, but it would bring me great joy to contribute a fix here.
Describe the feature you'd love to see
For an upcoming bomb.sh project, we'll be publishing Preact bindings for TUI projects. Because we're running in a non-browser environment, there is no global
documentvariable.To my great pleasure, I saw that Preact 11 has moved to scoped
docreferences that are dervied fromnode.ownerDocument.This almost unburdens us from needing a
globalThis.documentshim. Unfortunately, there's still a single unguardeddocumentreference inrender.js.Additional context
On our side, we need to define
globalThis.document = undefinedto avoid theReferenceError(or wire a properdocumentshim).If Preact 11 added a
typeof document !== 'undefined'or'document' in globalThisbefore checking ifparentDom == document, we'd be able to remove our userland shim and Preact would be fully "native-compatible".Fairly minimal change, but it would bring me great joy to contribute a fix here.