Closed davidmccabe closed 11 months ago
When Sandpack is used without Nodebox, the Sandpack bundler sends a 'resize' event during initialization. (https://github.com/codesandbox/sandpack-bundler/blob/ab9e6cb50be618f404e0f0e4886d2c51963790da/src/index.ts#L100)
It looks like this message doesn't get sent when using Sandpack with Nodebox.
Currently, the React docs integration relies on this message and hides its content until that message is sent. (https://github.com/reactjs/react.dev/blob/4f9e9a56611c7a56b9506cf0a7ca84ab409824bc/src/components/MDX/Sandpack/Preview.tsx#L153) This seems to be based on similar code in sandpack-react but takes it further in that it depends on resize being sent to show any content. I would guess that this avoids reflows when Sandpack is used in a documentation context.
What would it take to get Nodebox to send this message at the same point that sandpack-bundler does?
When Sandpack is used without Nodebox, the Sandpack bundler sends a 'resize' event during initialization. (https://github.com/codesandbox/sandpack-bundler/blob/ab9e6cb50be618f404e0f0e4886d2c51963790da/src/index.ts#L100)
It looks like this message doesn't get sent when using Sandpack with Nodebox.
Currently, the React docs integration relies on this message and hides its content until that message is sent. (https://github.com/reactjs/react.dev/blob/4f9e9a56611c7a56b9506cf0a7ca84ab409824bc/src/components/MDX/Sandpack/Preview.tsx#L153) This seems to be based on similar code in sandpack-react but takes it further in that it depends on resize being sent to show any content. I would guess that this avoids reflows when Sandpack is used in a documentation context.
What would it take to get Nodebox to send this message at the same point that sandpack-bundler does?