{"repo":"lfre/next-preact","free":true,"listed":false,"github":"https://github.com/lfre/next-preact","clone":"git clone https://github.com/lfre/next-preact.git","description":"Patch Next.js 13 and up to use Preact","language":"CSS","stars":41,"topics":["nextjs","preact"],"license":null,"category":"saas-starters-boilerplates","readme_excerpt":"Next with Preact Works up to Next.js 16.2.6 ✅ Since Next 13.5, Next compiles some of its dist folder into the \"dist/compiled/next-server\" folder only when publishing to NPM. This means the file \"dist/server/render.js\" is not the one that runs, and thus the patch does nothing. Instead the patches would have to be applied to \"dist/compiled/next-server/pages.runtime.dev.js\" and \"pages.runtime.prod.js\" accordingly. These files are minified so they're much harder to modify. The approach changed to instead patch Preact with a custom version of renderToReadableStream until Preact added their own version. ...Sighs in JavaScript... If you're unable to use the app directory with React Server Components, streaming and other React 18+ features, but still want/need improvements to Next and its utilities, Next with Preact is for you. Preact added renderToReadableStream in version 6.5.0. However, App Router is stil incompatible with Preact due to some internal mismatching within hooks. ⚠️ Disclaimer ⚠️ My approach was to achieve this with the least amount of changes to Next.js pointing back to Next 12.3.4. So I can't promise that this will work for all your use cases. I also can't promise that this will automatically work in future versions. Proceed with caution. Demo Live URL CodeSandbox Dependencies - next-preact-plugin - patch-package Usage Follow the instructions in next-preact-plugin, and disable esmExternals in your next.config.js to resolve this issue: Hot Reloading Since Next.js 15.","default_branch":null,"files":null,"tree":[],"storefront":"/r/lfre","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/lfre/next-preact/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}