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.

Preact implementation

See original GitHub issue

Would you like it to be part of this repository? It’s very similar to slate-react.

Even if that’s not the case, I think it’s worth considering to move non-React specific code (constants, utils, even plugins) to separate package (e.g. slate-dom?) because you’d reuse most of it with every DOM view integration (libraries or DIY) if you port or get inspiration from slate-react.

Diffs in utils:

  • Eliminate ReactDOM.findDOMNode which is deprecated anyway (in strict mode) #2420. There are two identical instances here and here (which could be replaced with editor.base?). ReactDOM is also used in this utility function but it’s not even used in package nor exported.

Diffs in components:

  • This has to be changed to {[...children]}, ImmutableJS quirk? Preact children has to be regular array (Immer!!). Im not 100% sure if there are other similar cases but everything works so far.
  • Replace React.Component with Preact.Component (also in plugins/react.js).

Not sure if there are any clashes between Preact’s native events and code that’s written for React’s synthetic events (signature is the same…) but everything I’ve tried works so far and I haven’t encountered any errors.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
marvinhagemeistercommented, Mar 19, 2019

@realknack yup, preact/compat is meant to work exactly like react, even though we may do things differently under the hood. If something doesn’t work like react we treat it as a bug in preact/compat. I went ahead and made an issue.

3reactions
adjourncommented, Feb 21, 2019

@marvinhagemeister

Thanks for taking the time to write this. I already did put this project on hold until X release. Can’t wait! ☕

Read more comments on GitHub >

github_iconTop Results From Across the Web

Preact | Preact: Fast 3kb React alternative with the same ES6 ...
It's one of the fastest Virtual DOM libraries out there, thanks to a simple and predictable diff implementation. We automatically batch updates and...
Read more >
Planning for PreACT
This guide provides you with the tools you will need to successfully implement PreACT. PreACT Information Sheet. ▫ View the information sheet for...
Read more >
Introduction to Preact : A smaller, faster React alternative
It's one of the fastest Virtual DOM libraries out there, thanks to a simple and predictable diff implementation. Preact aims to deliver on...
Read more >
AshKyd/ui95: WIP: A preact implementation of Windows 95/98 ...
WIP: A preact implementation of Windows 95/98/ME style components and apps. See it in action on my personal site at https://ash.ms - GitHub...
Read more >
Intro | Testing Library
Preact Testing Library on GitHub. ... You want to write tests for your Preact components so that they avoid including implementation details ...
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 Reddit Thread

No results found

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