-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(chore) - create Preact example #1636
Conversation
Hi @JoviDeCroock, Welcome, and thank you for contributing to Remix! Before we consider your pull request, we ask that you sign our Contributor License Agreement (CLA). We require this only once. You may review the CLA and sign it by adding your name to contributors.yml. Once the CLA is signed, the If you have already signed the CLA and received this response in error, or if you have any questions, please contact us at [email protected]. Thanks! - The Remix team |
Thank you for signing the Contributor License Agreement. Let's get this merged! 🥳 |
|
||
const documentElement = document.documentElement; | ||
const apply = (n: HTMLElement) => document.replaceChild(n, documentElement); | ||
// Temp fix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preact currently fails when passing in document
as that has a few nodes that aren't reconcilable 😅
Does this also apply Preact for production? How are you checking for Preact in the website? |
The npm deps replace React with Preact, verified production bundles :) |
Co-authored-by: Michaël De Boey <[email protected]>
We've been working (sporadically, our fault) with @developit on this. I'm going to close this but welcome it being reopened when we announce official Preact support :) |
To be clear, we will support Preact "natively". No compat layer so we can get the client bundle even smaller :) |
This PR makes a version of the
examples/basic
app leveraging Preact. The only thing that stands out here is the "hack" we have to do in Preact to make thehydrate(x, document)
work correctly.There's an additional fix to be found in the
remix-dev
CLI, when missing a package likeReact
(or in my case Preact... Yes I forgot to install Preact 😂) it would print out that the dev cli was missing, which had me confused for quite a while. Now it will take the first line of the error message, which is the same it was before, and leverage that to indicate the missing module.