Skip to content
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

RFC: React Native? #1000

Closed
mmahalwy opened this issue Dec 7, 2016 · 45 comments
Closed

RFC: React Native? #1000

mmahalwy opened this issue Dec 7, 2016 · 45 comments

Comments

@mmahalwy
Copy link

mmahalwy commented Dec 7, 2016

Maybe a little ambitious, but I am SOOOO excited to use this library!

I also would love to use it (at least common elements) in my React Native app. Thoughts?

@levithomason
Copy link
Member

Duplicate #790

@tarang9211
Copy link
Contributor

tarang9211 commented Jan 2, 2017

@mmahalwy would you be interested in collaborating for a react native library for semantic ui?

@mmahalwy
Copy link
Author

mmahalwy commented Jan 3, 2017

@tarang9211 I might be. Although I need to dive more into RN first.

@dirajkumar
Copy link

@tarang9211 I'm interested. Let me know how can I help?

@malixsys
Copy link

@tarang9211 Me too!

@kosiakMD
Copy link

+one

@brandondrew
Copy link

@levithomason
#790 was a question about whether it is currently possible to use Semantic UI React with React Native, while this issue is a request for comments about the possibility of making that possible.

Maybe you realized that already, and you closed this issue as a way of implicitly saying "we're never going to support anything like this because it's a ridiculous idea that can't work", but it would be nice to have an explicit response, since you're in a better position to evaluate whether it is

  1. theoretically possible
  2. reasonably doable
  3. something you might ever possibly consider supporting
  4. something you would entertain pull requests for, if someone else did the work
  5. etc.

Thanks!

@levithomason
Copy link
Member

levithomason commented Apr 13, 2017

Thanks for the ping. I don't have these answers off hand, but, conversation is warranted. I have no reservations against this endeavor. I just have no need for it either. Open to ideas and PRs if applicable.

@levithomason levithomason reopened this Apr 13, 2017
@GregoryPotdevin
Copy link

I'm currently using React Native Elements for my react native projects, but find react semantic ui's API much better.
I could be interested in building a few react native components that would have the same API and similar look and feel to this project. I won't guarantee 100% coverage and perfectly identical styles (and the style parameters will obviously be different). One example that would be useful is the Card component : https://react.semantic-ui.com/views/card

@levithomason
Copy link
Member

While we're on this topic, I'm curious if there is potential for shared libs here.

Styles

We're toying with JS styles for SUIR in #1579. I've got another private prototype going that is experimenting with this as well. If successful, we'll dramatically reduce the size of the CSS by using optimized atomic styles, make in browser live-theming a reality, and allow overriding theme variables on components at runtime.

React native also makes use of JS style objects for styling. There may be potential here to share these JS styles between libs. In fact, most CSS-in-JS solutions are generic, meaning we could even use it for SUI core. This could theoretically bring total style parity to all implementations.

State machines

Over at SUI core, there is a long-running issue about removing jQuery and allowing more shared code between implementations. Obviously, you can't share logic between a jQuery implementation and a React implementation, however, the states of the components are identical. Also, the Semantic verbiage is identical between implementations.

This got me thinking, could we build finite state machines for each component that describe the current state, transitions, and next states? I hinted at this here Semantic-Org/Semantic-UI#1175 (comment).

Imagine the Dropdown, it has a state (open, closed, search, etc). Given some state, it has a finite number of next states. Each of these states has an associated list of Semantic terms to describe it. Each state also has a finite list of events that it should listen for. If an abstract state machine was coded in pure JS that only described these states, then, it could theoretically be shared between jQuery, React, and React Native implementations.

Each implementation would only have to wire the state machine to the API of choice. No more repeat coding all the logic involved in state management.

Conclusion

If we could share styles organized by Semantic terminology and state machines which orchestrated those styles, we could reduce the coding and maintenance burden between implementations and increase consistency.

@GregoryPotdevin
Copy link

It's always tough to try to maximize what can be shared. This can sometimes lead to more complicated code and less possibilities for the end user.

One approach which may be more effective is to have 2 projects be similar (but with their own specificities), and then you can have the opportunity to build common abstractions on top. If the react and react native version have similar building blocks, it should be fairly straightforward for someone to build customized "higher level" modules that use those building blocks and expose the same API in react and react native. That would kind of embrace how React is built: learn once, write anywhere.

@levithomason
Copy link
Member

This is true as well. Once our experiments are further solidified, I may come back to this and see if it makes sense to share any code. I appreciate the feedback.

@brianespinosa
Copy link
Member

This got me thinking, could we build finite state machines for each component that describe the current state, transitions, and next states? I hinted at this here Semantic-Org/Semantic-UI#1175 (comment).

Really love this idea too.

@levithomason
Copy link
Member

Though I have many priorities ahead of this, I am very interested in it and will undoubtedly run some trials some day. Again, if anyone wants to start something I'd be willing to offer input and reviews. There are a number of FSM libs out there for scaffolding this, some I've seen used for jQuery based UI component states as well.

@ethanyanjiali
Copy link

I'm also quite interested in building a react native lib for semantic ui. As long as the API and component name of these two semantic ui libs are same, developer could switch between reactjs and react native project easily.

@TheGhoul21
Copy link

May I ask what's the progress so far? I'm interested in collaborating with the android portion.

@levithomason
Copy link
Member

I don't believe any work has begun. However, I'd really like to consider moving to CSS in JS for this. I've been testing and liking fela.js.org. It also supports React Native.

I think if we're going to make a native compatible library then we should also make the styles portable without the need for global css.

@brianespinosa
Copy link
Member

@levithomason Interesting. I had not looked at Fela yet. From my reading so far it seems like it would be the most flexible.

What are your thoughts on how these styles would be used in SUIR? We could make the library work with either the compiled CSS from SUI by including the classes, or by not including the classes and including all of the state styles from each component if they have been enabled. There's obviously a lot of work to be done either way to make this happen since it would basically be almost a complete rewrite of SUI styles. And then we'd need to figure out how we handle theming the same way with overrides/variables.

@mmahalwy
Copy link
Author

How about using styled-components? I had intended to start working on this but haven't yet because of time, but because I know the most time suck would be figuring out the CSS to RN now.

@ghost
Copy link

ghost commented Aug 5, 2017

Try shoutem, it gives a semantic ui feel

@ethanyanjiali
Copy link

ethanyanjiali commented Aug 5, 2017 via email

@arkhamRejek
Copy link

Why not use
https://github.com/Khan/aphrodite

It uses a very similar approach that react native does.

@levithomason
Copy link
Member

Linking #1009

@ghost
Copy link

ghost commented Aug 25, 2017

if your want to use their app builder services you have to pay. But tehir react code is free to use

@levithomason
Copy link
Member

Hi folks, closing this issue for housekeeping. We're very much open to collaboration and pull requests to support this effort should a community effort be organized.

@ayaanx3
Copy link

ayaanx3 commented Nov 8, 2017

why bother with react native? I think the idea here is to make semantic ui adaptable for native apps as quickly as possible. Why not build it with nativescript instead of react? I assume it would be a easier and posibly better integration

@thelaith
Copy link

Did you guys ever start something? @mmahalwy @tarang9211 @dirajkumar @malixsys @kosiakMD Would be awesome to check it out.

@brianespinosa
Copy link
Member

@thelaith For an update on this, we need to end up moving to a CSS in JS solution first. There are a number of significant projects to be worked on to complete this. A link to the repo where this work is happening is here: https://github.com/openmastery/semantic-ui-theme. Nothing in that repo is React Native related. It is only for creating a theme editor/builder and then the process of converting to use Fela for the styles will happen after that.

Regarding the progress on that project as a whole, everyone involved has become very busy with other work so it has not moved forward much in the last couple months.

Hopefully this message will shed some light on the tasks needed to be completed before we could support this and where to watch for progress.

@levithomason
Copy link
Member

Insider hint, there is a very real likelihood that I'll be going full time on the CSS in JS solution in 2018. Pending conclusion of my current job shift. Stay tuned.

@thelaith
Copy link

thelaith commented Feb 15, 2018 via email

@tarang9211
Copy link
Contributor

@levithomason Do let us know of your updates.

@levithomason
Copy link
Member

I have accepted the position and will start March 5th. It will take some time for me to relocate and ramp up. I will be on a framework team and it still seems my first task will be creating this framework. Open sourcing it has been discussed and seems to be the direction it will go.

At this point, it is not clear if we'll migrate SUIR or take its API and utilities and create anew. Details still being hashed out. I should have a much clearer picture in late March early April.

@tarang9211
Copy link
Contributor

tarang9211 commented Feb 26, 2018 via email

@tarang9211
Copy link
Contributor

Any updates @levithomason? Would love to be a core maintainer and contributor to this project!

@micimize
Copy link

micimize commented Mar 2, 2018

Looking forward to this, will be a very welcome addition to the react native framework landscape

styled component's css-to-react-native might be helpful, as well as @shoutem/theme. A possible path of least resistance might be to keep pretty much the same core code, change className to styleName, and rework the semantic ui less into a shoutem theme. fela looks really powerful though, hadn't heard of it before.

Semantic UI looks mercifully untethered to the underlying DOM, but some of the utilities used in react-native-render-html may also be useful, or at least handy for reference.

@levithomason
Copy link
Member

Sorry for the lack of additional info, it's a waiting game right now:

Details still being hashed out. I should have a much clearer picture in late March early April.

I agree about SUI being too tightly coupled to the DOM. This is a core engineering issue we'll be assessing.

@soederpop
Copy link
Contributor

I'm interested in helping advance this, possibly could get some corporate sponsorship lined up as well.

@thelaith
Copy link

Love to know what happened so far, I was just thinking about getting started with some React Native again, and then this project came to mind.

@levithomason did you settle in at the new job? :-)

@BjoernRave
Copy link

BjoernRave commented Jan 19, 2019

do you think we could make it work with css-to-react-native
? its what styled components are using to be compatible with react native?

@oleksandrkyselov
Copy link

I'm also really interested, any updates?

@zwass
Copy link

zwass commented Jul 22, 2020

Is there any current movement on React Native?

@Ferezoz
Copy link

Ferezoz commented Jul 22, 2020

@zwass I don't think we will have React Native anytime soon, check this: #3885 (comment)

@zwass
Copy link

zwass commented Jul 22, 2020

Ah, thank you @Ferezoz. Disappointing to see that the project is dead as this looks like by far the best styled UI toolkit I was able to find.

@Ferezoz
Copy link

Ferezoz commented Jul 27, 2020

@zwass it is disappointing but well, let see what the future holds for this cool project.

@layershifter
Copy link
Member

layershifter commented Jul 27, 2020

I don't think that RN will ever happen as it requires a lot of work with CSS styles while at the same time we don't support them in this repo. I don't think that will ever do because of overall complexity and missing resources 😭

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests