React or Preact?
natemoo-re opened this issue · 1 comments
natemoo-re commented
I need to make a decision here. It currently ships with @types/react
and does some gnarly transforms to the bundle to swap in preact
in a non-ideal way.
The options are:
- Use
react
typings and swap inpreact/compat
at compile time? - Drop
react
and just use barepreact
natemoo-re commented
I am leaning towards dropping React compatibility and only using preact
. Please feel free to weigh in on this issue with reactions or comments.
This is obviously a big trade-off, but here are some of my thoughts...
- React and Preact are likely to diverge at some point in the near future. See (the road to Preact 11)[https://github.com/preactjs/preact/issues/2621]. This is a good move for Preact since React continues to grow in size. As Microsite is focused on performance and size, it's not a bad idea to place our bets on Preact early.
- The React ecosystem is quite rich, but not as performance focused as the Preact ecosystem. Sticking with Preact likely means that Microsite users don't have as many opportunities for footguns.
- Preact has phenomenal custom element support, whereas React seems to have little interest in improving their support. Custom Elements are a good ideological fit for Microsite.
- Microsite is ESM-first and Preact actually ships ESM. React somehow still ships CJS only.
Additional questions:
- Should Microsite move to
htm
? This could keep the clientside code close to 1-to-1 with SSR.