Development runs through the bytecode VM so saves hot-reload in milliseconds.
Release is different: flux build compiles the same IR to idiomatic native
source and ships no VM, no patch protocol, and no shadow tree. This guide
walks the release path per platform.
Generate the native sources
Section titled “Generate the native sources”Run the build from your project root and pick the platform:
flux build iosEmits platforms/ios/Generated/main.swift.
flux build androidEmits platforms/android/Generated/main.kt.
Both targets use --root <path> if you build a project elsewhere, matching
flux dev.
What the output looks like
Section titled “What the output looks like”For the canonical counter (see the
counter walkthrough) the emitted code is the
plain native equivalent of your .flux:
compo Counterbecomesstruct Counter: View(SwiftUI) and@Composable fun Counter()(Compose).state countbecomes@State private var count: Int = 0andvar count by remember { mutableStateOf<Int>(0) }.Column gap: 8.0becomesVStack(spacing:)andColumn(verticalArrangement = spacedBy(8.dp)).
There is no interpreter in the shipped app — the generated code is ordinary SwiftUI and Compose that you review, version, and compile like any other native source.
Hand the sources to the toolchain
Section titled “Hand the sources to the toolchain”If xcodebuild or gradle is present on your machine, flux build suggests
the next build step after emitting the sources. Otherwise, compile them in
your app target like any other generated source:
- iOS — add the generated Swift files to your app target and build with Xcode as usual.
- Android — include the generated Kotlin files in your module’s source set and build with Gradle.
Why dev and release stay equivalent
Section titled “Why dev and release stay equivalent”Both execution tiers consume the same Reactive Tree IR. A parity harness
(flux-parity) captures traces from dev-VM execution and from release
codegen output and proves their equivalence in CI — the two paths are
verified, not assumed. See Dev vs release for
the reasoning and the current platform status.
Next steps
Section titled “Next steps”- Formatting and CI gates to keep generated input canonical.
- Project status for what is verified today.
