Preact
Ayc0 opened this issue · 7 comments
Do you plan to support preact, which is better suited for web components because of its weight?
I liked the idea, would be great especially for sites that do not use this package very much.
It should work with preact using preact-compat!
It should also be possible to write Remount integration with Preact or any other library using custom adapters:
https://github.com/rstacruz/remount/blob/master/docs/api.md#custom-adapters
Getting support built into
remount
isn't planned at the moment, but if enough people are interested, I can put together a remount-preact package (and remount-elm, remount-deku, etc) :)
Would be nice to have these preset adapters directly in remount
as remount/adapters/deku
etc., compared to installing a bunch of separate packages.
With Preact X, it will be easy to create the bindings.
But I'm right with you @dy, maybe having a set of already defined adapters could be a good idea!
Also, I've tried to create my own adapter, and I've got this even if I'm not using React
🚨 ~/preact-x-test/node_modules/remount/dist/remount.esm.mjs:1:30: Cannot resolve dependency 'react'
> 1 | import { createElement } from 'react';
| ^
2 | import ReactDOM from 'react-dom';
3 |
4 | /* global HTMLElement */
(when I add react and react-dom, it works like a charm 🙌)
Ooh, interesting - I think this is something we can (should?) address. I've been wanting to get Remount to work on non-React environments too.
I think I'd structure it this way:
-
A
@remount/core
package, which holds everything that the current Remount implementation has, minus ReactAdaptor -
A
@remount/react
package, which is just@remount/core
with a React adaptor by default - basically the same as today'sremount
package -
Ditto with
@remount/elm
,@remount/preact
, etc -
All of this can be managed as a Yarn workspaces monorepo with Lerna
Happy to hear any feedback on this!