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.

Add Preact support

See original GitHub issue

🙋 Feature Request

It would be nice to support Preact in addition to React. Preact supports most of the features we need, and is considerably more lightweight, so it would be nice to support it for applications that need to be super slim. Things should mostly already work I think, but there may be places where we rely on React specific features like the synthetic event system. We should try to abstract that.

💁 Possible Solution

  • Test things out and see if they work. Maybe create a demo app aliasing react -> preact and see what breaks.
  • Add the ability to run the test suite against Preact in addition to React to prevent future breakages.
  • Fix the issues. Adjust code as needed to ensure we’re compatible with both implementations.
  • Figure out how to release this. Do we want to require people to have an alias in their app? Do we want to create a completely separate set of packages that switch react for preact? Should we abstract things so you could inject an implementation for where to get hooks like useState/useEffect/etc. from? That might allow even more implementations that support the hooks API in the future (e.g. Haunted). How do other libraries handle this?

🧢 Your Company/Team

RSP

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:12
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
devongovettcommented, Nov 30, 2020

Here’s a list of issues we ran into if anyone is interested in helping here. Some have been filed with the Preact team, and some may require workarounds on our side.

https://gist.github.com/mischnic/15d81e667cda5c6fa7ab60d0bc77d34b

3reactions
devongovettcommented, Sep 17, 2020

@mischnic has been working on it. I believe we ran into a few bugs that he’s reported so waiting on resolution of those at the moment. But getting closer! 😊

Read more comments on GitHub >

github_iconTop Results From Across the Web

Switching to Preact (from React)
Switching to Preact can be as easy as installing and aliasing preact-compat in for react and react-dom . This lets you continue writing...
Read more >
Getting Started | Preact: Fast 3kb React alternative with the ...
New to Preact? New to Virtual DOM? Check out the tutorial. This guide helps you get up and running to start developing Preact...
Read more >
Switching to Preact (from React)
This is the recommended way to try out Preact if you have an existing React app. This lets you continue writing React/ReactDOM code...
Read more >
Getting Started | Preact: Fast 3kb React alternative with the ...
So, we want to have a 1-second timer start once the Component gets added to the DOM, and stop if it is removed....
Read more >
Browser Support | Preact
Preact supports modern browsers (Chrome, Firefox, Safari, Edge) and IE11. It works out of the box with these browsers and no additional polyfills...
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