question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:23
  • Comments:21 (5 by maintainers)

github_iconTop GitHub Comments

97reactions
guotiecommented, Apr 27, 2018

slate-vue is needed…

29reactions
bbbfordcommented, May 24, 2018

Agreed! This library has everything I want… except it is tied to React!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Slate React
Get the current editor object from the React context. Re-renders the context whenever changes occur in the editor.
Read more >
Building a rich text editor in React with SlateJS
Plugins : plugins allow us to override the core behavior of the editor. They're not concerned with rendering, just with overriding what ...
Read more >
Core Plugins - TheSunny
When a key is pressed, the core plugin handles performing some of the "native" behavior that contenteditable elements must do. For example it...
Read more >
react-page/plugins-slate: Versions
The public <Editor /> component still receives all these properties without separation to not break the public api, but internally they will get...
Read more >
Top 5 slate-react Code Examples
Learn more about how to use slate-react, based on slate-react code examples created from the most popular ways it is used in public ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found