11 comments

[ 3.3 ms ] story [ 38.1 ms ] thread
Nice, maybe if we had more native frameworks of similar calibre to what we have in the realm of web development we could start seeing more new applications going back to native.
I'm confused. This says it's a Swift framework, but it also says you can live-reload code. If you're live-reloading code, then it must be something like JS and not Swift.

Edit: Ok I looked at Reactant itself, it does appear to have you writing Swift. Is the article just wrong about live-reloading code, then? Is it really just live-reloading UI elements while keeping the code the same?

I'm not a native mobile developer, but how are Swift and live-reloading code mutually exclusive?
They’re not mutually exclusive but the main reason that Swift is so performant is because it’s a compiled language rather than an interpreted language like JS. To support live reloading with a compiled language you would either need to support live compilation and re-deployment (difficult) or treat Swift as a scripting language (redundant).
Looks like the live reload is just for the optional XML used to lay out your components. So definitely not full live reload. Seems useful for styling iteration but not so much for logic testing.
You are right, live reloading is just for the UI part. Swift doesn’t have the same dynamism ObjC had, so we can’t simply swap the implementation. We’ve tried Injection4Xcode (hope I got the name right), but it’s limited to ObjC only (or @objc Swift classes).
It’s also a great way to be banned from the App Store since it isn’t allowed to change your app without Apple being able to review it first.
You can't change the binary, but you can change the app. But with Reactant, we compile the XML files containing the UI into native Swift when building in Release mode. We do that to remove any runtime overhead that would be added by parsing the XML and going through it to create the UI/layout.
> This split to XML also allowed us to implement a live UI reloading. It’s something that will save quite a lot of development time as you can see every change in the UI without recompilation and redeployment.

It looks like the Reactant UI is an add-on for Reactant that has you writing XML which is "live reloaded". It's not clear whether or not only the XML is eligible for live reloading or not.

Source: https://docs.reactant.tech/reactant-ui/introduction.html

Any current users that can review how using it feels like?

And whats the difference between this and RxSwift