ohanhi / elm-native-ui

[CLOSED] Experiment: mobile apps in Elm using React Native.
BSD 3-Clause "New" or "Revised" License
1.54k stars 76 forks source link

Generate Elements, Properties and Handlers from react-docgen #31

Closed mk closed 8 years ago

mk commented 8 years ago

We're using the json output of react-docgen to generate Elements, Properties and Handlers.elm for the most common components (currently Text, Image, ActivityIndicator, MapView, Picker, ProgressBarAndroid, ProgressView, RefreshControl, ScrollView, SegmentedControl, Slider, StatusBar, Switch, SwitchAndroid, Switch, TabBar, ActivityIndicator, TextInput, Toolbar and View).

This also makes all enum properties safe on compile time.

We've used this fork to build Hangman in elm-native-ui: https://github.com/mk/hangman You can also find the slides on the talk we gave on how this works at https://speakerdeck.com/mkvlr/building-hangman-in-elm-native-ui

Next up will be doing the same for Style.elm.

ohanhi commented 8 years ago

This is pretty darn great! I had a little bad luck trying this out on the weekend (React Native and npm acting up), but I'm trying my best to get this merged as soon as possible!

mk commented 8 years ago

This also seems to be my main issue when working on elm-native-ui at the moment as well. I'm spending quite a bit of time removing and recreating `node_modules/. I don't really have experience with React Native so I'm not sure if that's normal.

ohanhi commented 8 years ago

Sadly, it is.

abinayasudhir commented 8 years ago

@ohanhi @mk I am working on the Elements, Handlers and Properties. I have used a lot of code from this pull request.

Its available here

https://github.com/AtomicITS/elm-native-ui/pull/30

Will complete the rest of the stuff and then send you a pull request.

If you have any suggestions please let me know.

Thanks in Advance

abinayasudhir commented 8 years ago

@ohanhi @mk My Objective is to complete UIExplorer for at least Android components before this weekend. Lets see how it goes.

https://github.com/abinayasudhir/NativeUIExplorer

eeue56 commented 8 years ago

Can someone explain the problem with node_modules to me? Maybe I can fix it.

ohanhi commented 8 years ago

@eeue56 No, the problem is that npm and/or react-native get things mangled up at random. So sometimes you just need to rm -rf node_modules && npm install.