|
| 1 | +--- |
| 2 | +title: Two pathways |
| 3 | +description: NativeScript is your development runtime, not your production runtime. Write SwiftUI and develop it live, or write TypeScript and compile the release to native code. |
| 4 | +contributors: |
| 5 | + - NathanWalker |
| 6 | +--- |
| 7 | + |
| 8 | +NativeScript has always run your app on a JavaScript runtime with direct access to every platform API. It now offers |
| 9 | +two pathways that keep that development experience and ship **no JavaScript runtime at all**: |
| 10 | + |
| 11 | +| | 1. SwiftUI, live | 2. TypeScript, compiled | |
| 12 | +| --- | --- | --- | |
| 13 | +| **You write** | SwiftUI, in an Xcode project | TypeScript with `@nativescript/core` and the framework you like (Angular, Vue, React, Svelte, Solid, plain TypeScript) | |
| 14 | +| **While developing** | NativeScript runs your SwiftUI views live: each save is on screen in about 0.15–0.5 s, state kept | `ns run`: the JavaScript runtime with HMR, Chrome DevTools and the whole npm ecosystem, exactly as today | |
| 15 | +| **What ships** | Your Swift, built by Xcode as usual | Your app compiled to Swift (iOS) and Kotlin (Android) by `ns build --compiled` | |
| 16 | +| **Platforms** | iOS; Android live development, rendered by Jetpack Compose | iOS and Android | |
| 17 | +| **Status** | [Preview](/guide/swiftui-live) | [Preview](/guide/publishing/compiled) | |
| 18 | + |
| 19 | +Both rest on the same idea: **develop live, ship native.** The development runtime gives you instant feedback; the |
| 20 | +release is the native code a platform developer would have shipped. |
| 21 | + |
| 22 | +## Which one fits |
| 23 | + |
| 24 | +- **You know SwiftUI, or you are starting an iOS-first app in Swift**: take [SwiftUI, live](/guide/swiftui-live). |
| 25 | + You keep Xcode, Swift and your project as they are; NativeScript only shortens the edit-to-screen loop. |
| 26 | +- **You know web development, or you already have a NativeScript app**: take |
| 27 | + [TypeScript, compiled](/guide/publishing/compiled). Nothing changes while you develop. The release build is |
| 28 | + compiled instead of bundled. |
| 29 | + |
| 30 | +The two meet at the release: both ship native code with no engine inside, and both are checked the same way, |
| 31 | +pixel by pixel against the build they replace. |
| 32 | + |
| 33 | +## The JavaScript runtime is not going anywhere |
| 34 | + |
| 35 | +A release on the JavaScript runtime (`ns build --release`) remains the default and is fully supported. Compiled |
| 36 | +releases are opt-in, per build or per platform, and you can switch back with `--no-compiled` at any time. See |
| 37 | +[Publishing](/guide/publishing/). |
0 commit comments