Hacker News new | past | comments | ask | show | jobs | submit login

For many codebases, Preact can be use simple as:

    npm i -S preact preact-compat
then add this to webpack config:

    {
      "resolve": {
        "alias": {
          "react": "preact-compat",
          "react-dom": "preact-compat"
        }
      }
    }
https://preactjs.com/guide/switching-to-preact



The tricky part is probably testing. I don't think e.g. jest (or maybe it was enzyme?) supports alternative implementations quite yet, though they were working on it...that was true months ago though.

If you're starting from scratch pretty easy though, sure. But that assumption is all too widespread in the JS ecosystem these days : (


We saw no problems with Mocha & Enzyme, can't comment on Jest.


woot.

brb :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: