seek-oss / playroom

Design with JSX, powered by your own component library.
MIT License
4.48k stars 182 forks source link

feat: Supports react-dom concurrent mode for frame renders #200

Closed maraisr closed 3 years ago

maraisr commented 4 years ago

TL;DR:


This PR aims to allow Playroom to support Concurrent mode (optionally). Our design system is now required to support concurrent mode (yes we've jumped the gun early). As such we'd like Playroom to mount frames with the new createRoot api. Granted this is all experimental things, and will likely need an update as soon as it drops.

This is the less impactful change. One thing that came to mind, as an alternative implementation would be to do something like sku does and simply make the consumers frame javascript file return a function, that is in charge of rendering how they please—rather than just return a component.

I guess to counter that last comment, you could instead introduce a playroom config method that does this, aka frameRenderFunction(Frame): void.

Please let me know of a direction.

maraisr commented 3 years ago

Friendly ping @markdalgleish @michaeltaranto @mattcompiles