Preview: packages are not published yet.
Learn · board 3
From a React project to one native dependency
Everything that needs a JavaScript toolchain happens once, on the React side. What reaches the native app is a versioned binary with a typed API. Follow one release from the first command to the first call.
step 7 / 7
your app
engine
content
facade
$ bun run nuib check contract ok
$ bun run nuib package engine · content · facade
$ bun run nuib publish XCFramework + AAR
swift PointsHistory.viewController(userId: "42")
- 1bun run nuib check reads every registerSurface call and its props, compares the contract with the last published one and says which version level the change needs.
- 2bun run nuib package builds the engine: the runtime, the renderer and the native code of the library. The native app never sees it.
- 3Then the content: your React project compiled to bytecode, with its assets (bundled images on Android only for now). Also hidden.
- 4And the facade: one Swift type and one Kotlin type per surface, with props as typed parameters. This is the only part the native team reads.
- 5bun run nuib publish stores the three as one versioned artifact per platform in a registry directory. It refuses a contract break that comes without a major version bump.
- 6The native team adds one dependency. No JavaScript, C++ or bundler on their machines.
- 7A surface is a typed call. If a later release removes a prop, the native app stops compiling at that line instead of failing at run time.
- Previous board: boot in stages
- Do it: package and publish
- Next board: a call in each direction