slate icon indicating copy to clipboard operation
slate copied to clipboard

split core plugin into `slate-react` and `slate-dom`

Open ianstormtaylor opened this issue 6 years ago • 22 comments

This is more of an idea, and maybe a bit longer-term, since I think keeping focused on React-only for now is best. But just thinking about if Slate were to be architected in a way that makes it possible to have view layers for different libraries (React, Vue, etc.)... in light of #1106 where we introduce the slate-react package.

Right now there's lots of logic in the <Content> component that controls things like the data object that gets passed to handlers, and e.preventDefault() to suppress browser behaviors. Lots of that stuff would want to be shared between different view libraries, since it's all just browser-specific, not necessarily React-specific.

(This separation also applies if Slate were to support React Native I think, although I don't have experience there.)

Instead, the logic inside slate-react would probably be split into another package slate-dom, which every view layer could then depend on instead of having to repeat lots of boilerplate browser-based code.

ianstormtaylor avatar Sep 11 '17 17:09 ianstormtaylor