Repository navigation
Replies: 1 comment
|
Update, with a one-renderer baseline that narrows the question. Why I care: I'm exploring Three.js on Solid 2.0 where DOM labels are anchored to 3D objects (the equivalent of drei's I first framed this as a cross-renderer problem, but the same thing happens with only the DOM renderer. Baseline page: https://rickyraz.github.io/solid-cross-renderer-order/experiments/baseline/ (source under
So content placed outside its row keeps mount order, even with For comparison, Svelte does document a guarantee for its mixed renderers: when several crossings share one host container, each guest's content stays in the same order as its node in the host tree, even when a keyed The cross-renderer version of my case (scene renderer plus DOM overlay, with a bridge that moves labels in So the question is narrower now: is the lack of an ordering contract for |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Solid has supported multiple renderer configurations since v1.4. The compiler already has a hybrid fixture with
<Canvas>and<HTML>.I wanted to see what happens at runtime when two scene nodes host labels in the same DOM overlay.
I tested
DOM → scene → DOMon 30e7805 with both JSX compilers ingenerate: "dynamic"mode,@solidjs/web, and an in-memory scene built withcreateRenderer.onCleanup, removing the boundary emptied both containers.[a, b]to[b, a]moved the existing scene nodes. Labels inserted once into the shared overlay stayed in[a, b]order. When the adapter also moved each label before the next slot's label ininsertNode, both orders matched and neither label remounted.<div><mesh /></div>and<scene><label /></scene>nesting and suggested a component boundary.Svelte explicitly keeps guest content in shared containers in host order.
In Solid, should renderer authors own that ordering, and would a small test or docs example be welcome for the intended behavior?
The experiment uses existing APIs. See also Svelte's rules for crossings.
Minimal reproduction of the ordering case
Save this as
packages/universal/test/shared-overlay.spec.jsin the checkout above. This reduction uses the repository's DOM-backed universal test adapter for the host, so it needs no scene implementation.From a built checkout, run:
pnpm --filter @solidjs/universal exec vitest run test/shared-overlay.spec.jsAll reactions