ohanhi / elm-native-ui

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

Leverage new RN JS Navigation #11

Closed tlvenn closed 7 years ago

tlvenn commented 8 years ago

Facebook is working on a revamp of the JS Navigator and the preview is available here: https://github.com/ericvicenti/navigation-rfc

@ohanhi I believe this would solve the major blocker with the current implementation of the Navigator.

ohanhi commented 8 years ago

Oh wow. I will have to look into this. Thank you very much, @tlvenn!

tlvenn commented 8 years ago

Well I am glad I could be of help and thank you, @paulyoung and @staltz for this awesome project !

ohanhi commented 8 years ago

Update: this is actually moving along nicely. NavigationExperimental is now in RN master branch, and there's some improvements to it already in progress: https://github.com/facebook/react-native/pull/5912

mk commented 8 years ago

We tried updating react native to the current master in order to leverage the new navigation in https://github.com/elm-native-ui/elm-native-ui/compare/master...mk:navigation-experimental but it seems changes to the require polyfill are currently breaking Elm.

We had to move the F2 etc functions of the generated elm.js up a level to get it to work, see https://github.com/elm-native-ui/elm-native-ui/commit/16db2a046e4a1529177b3aa3c1d54c0acc326d45

ohanhi commented 8 years ago

@mk Interestingly, the anonymous function has always been there and it works under RN 0.14. But now that I am trying to upgrade to 0.21.0-rc, I am facing the same issue as you did: Can't find variable: F2. So strange.

kommen commented 8 years ago

@ohanhi Yeah, I was really surprised by that as well. But what do you mean with "has always been there"? As far as I saw, the anonymous function in the processed version of elm.js gets wrapped one more time additionally after upgrading RN.

Sorry for just providing screenshots here, but I found these in my scrap notes when I was digging into the issue.

Before upgrading RN: screen shot 2016-02-09 at 17 26 26

After upgrading RN: screen shot 2016-02-09 at 17 26 16

This is from compiled index.ios.bundle which gets served from the react packager (prettified version).

ohanhi commented 8 years ago

@kommen Where did you get that twice-wrapped file from? I can't see double (function() { rows in the compiled elm.js or in DevTools.

Edit: this was further discussed on the Elm Slack.

ohanhi commented 8 years ago

The undefined functions issue was circumvented in https://github.com/elm-native-ui/elm-native-ui/pull/14 Our master is now using React Native 0.21.0-rc with https://github.com/elm-native-ui/elm-native-ui/pull/19

ohanhi commented 7 years ago

With #44 and #49, I'd say this is now done!