Semantic-ui-react: Preact?

Created on 1 Dec 2016  路  15Comments  路  Source: Semantic-Org/Semantic-UI-React

Most helpful comment

not really, but preact support would be nice

All 15 comments

Is this an issue?

not really, but preact support would be nice

Got it, I'd certainly be willing to merge PRs for increased compatibility. I'm not a Preact user so I'm not sure of the issues.

might be a bad idea after all, a fork would probably be a better idea

the only way to do this would be building twice

If the changes don't bring negative side effects, we can make them here. Though, I could see issues with regressions since I'm not sure how we'd test for Preact compatibility when shipping new features and fixes.

https://preactjs.com/guide/switching-to-preact

you basically have to replace every import of react/react-dom or alias it, but idk about the other libraries used

Yep, this would need some investigation on a PR to figure out how to solve. I'm sure there will be lots of broken features. In a library like ours, we use many things that I'm betting are not supported, like event.nativeEvent.stopImmediatePropagation() or ReactDOM.unstable_renderSubtreeIntoContainer().

Again, I'd be willing to look over and merge PRs from the community on increasing compatibility with other libraries 馃憤

I think preact-compat just needs to alias .nativeEvent there. We have the other API for sure.

Thanks for the clarification and correction on that. I'm on the look out for any PRs.

Sorry to comment on a very old issue, but does this work today? @levithomason

No idea, I've never used Preact.

@davezuko may possibly have some insight? I think he may have converted some SUIR powered apps to Preact recently.

Most of this should be handled by preact-compat without any work from SUIR itself. I think it's a far better tradeoff to include the extra ~2kb for the compat layer than to fork SUIR specifically for Preact.

I, however, defer to @developit since he maintains Preact :P.

@ForsakenHarmony Haven't you tried to use SUIR with preact-compat?
I want to use SUIR without introducing React into the runtime bundle.
However, not sure if we can get rid of React or preact-compat just act as a compatible layer on the top of React's base. Sr, I didn't notice that preact-compat has a standalone repo with its documentation. And we can get rid of the heavy React with Preact 馃槏

@levithomason @davezuko SUIR is an awesome project with impressive documentation. I think we shouldn't let it be locked in React's big empire. Will you plan to add some supports or official docs for Preact users?

@redstrike if you would like to add an Example Project to the SUIR documentation that shows how a SUIR project would be configured with preact and preact-compat, PRs are definitely welcome.

Will you plan to add some supports or official docs for Preact users?

Will I specifically? No, as I have no need or incentive for Preact. However, I am in full support of a community effort to accomplish this and will help move things along as much as I can.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

devsli picture devsli  路  3Comments

eXtreme picture eXtreme  路  3Comments

KevinGorjan picture KevinGorjan  路  3Comments

GautierT picture GautierT  路  3Comments

eGust picture eGust  路  3Comments