Hyperapp: React native

Created on 19 Mar 2017  路  10Comments  路  Source: jorgebucaran/hyperapp

Hello,

I know it's a young project but it's a portage on react native its possible in the future?

Discussion Feature

Most helpful comment

I made a demo of a micro rewrite of Hyperapp working on React Native at: https://github.com/brodybits/hyperapp-micro-rewrite-demo-on-react-native

Note that it does not yet deal with side effects such as timers and I/O ref: https://github.com/brodybits/hyperapp-api-demo-on-inferno-and-ultradom/issues/4 _and #672_

All 10 comments

Hi @Gi972. Yes, I think this may be possible in the future. Similar to what Snabbdom did here https://github.com/snabbdom/snabbdom/issues/47.

app({ api })

Where api is an object that exposes an API similar to the DOM functions HyperApp uses to create, append, insert elements, etc.

Ok, good news :-)

Thanks for answer

@Gi972 I think I didn't know what I was talking about. The issue I linked to above has probably got to do more with Electron, not something like React native, which is certainly out of the scope of hyperapp.

I mean, I have no idea what would need to be done to make this work, but if you have any clue, I'd love to know.

Closing for now. 馃憢

Hello @jbucaran,

The idea is to use the same structure when I develop on the web and and the mobile.
the only thing has changed in react native is just the view because is not dom, but keep the logic with the state and the actions from hyperApp it's a good approach I think.

For example, when I create a project I have a structure like this:

     /State
     /Actions
     /Views / Web (React , hyperX)
            / Mobiles (React Native)
            / Electron
            / VR 

So I have separate the concern, and when if in the future a new device appears (example here VR) I need just add a file within templates.

Here is my idea :-)

@Gi972 Yes, that makes sense, but instead of rendering to the DOM using createElement, appendChild, etc., what functions do we call?

I confess that I did not really dig the subject, that's why I asked you the question :-)

I made a demo of a micro rewrite of Hyperapp working on React Native at: https://github.com/brodybits/hyperapp-micro-rewrite-demo-on-react-native

Note that it does not yet deal with side effects such as timers and I/O ref: https://github.com/brodybits/hyperapp-api-demo-on-inferno-and-ultradom/issues/4 _and #672_

Cool !!!

Thanks for that @brodybits ! :+1:

I am working on some experiments with Hyperapp and Tabriss then Nativescript too.

I updated the demo at https://github.com/brodybits/hyperapp-micro-rewrite-demo-on-react-native to support side effects (such as I/O and delay timers) along with some other API changes. It no longer conforms to the Hyperapp 1.x API but I think it demonstrates similar capabilities, with a similar API. No complex middleware needed.

I suspect there is still a better abstraction that can be made here, maybe going in a different direction than the Hyperapp 2.0 API discussed in #672. Maybe similar to Cycle.js, may be ideal to support some kind of Flow Based Programming. My goal is a simple, straightforward solution working on React Native, React-like API on the Web, etc.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rbiggs picture rbiggs  路  4Comments

zaceno picture zaceno  路  3Comments

VictorWinberg picture VictorWinberg  路  3Comments

joshuahiggins picture joshuahiggins  路  4Comments

Mytrill picture Mytrill  路  4Comments