You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 23ca2ef
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+7-6Lines changed: 7 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,8 +23,9 @@ Either is welcome. A clean, deterministic repro is often more valuable than a gu
23
23
The React Native repository is a Bun monorepo with a pinned `packages/react-native-nitro-modules/nitro/` submodule from [margelo/nitro](https://github.com/margelo/nitro):
24
24
25
25
-[apps/example/](apps/example) — React Native example app that hosts the runtime test harness.
26
+
-[packages/react-native-nitro-modules/nitro/packages/nitro-core/](https://github.com/margelo/nitro/tree/core-split/packages/nitro-core) - shared JS/TS definitions and runtime helpers, published from `nitro`.
26
27
-[packages/react-native-nitro-modules/nitro/packages/nitrogen/](https://github.com/margelo/nitro/tree/core-split/packages/nitrogen) - the `nitrogen` code generator, maintained in `nitro`.
27
-
-[packages/react-native-nitro-modules/](packages/react-native-nitro-modules) - the published React Native package and its CocoaPods, Gradle, and CMake configuration. Its implementation is staged from `packages/react-native-nitro-modules/nitro/packages/react-native-nitro-modules/`.
28
+
-[packages/react-native-nitro-modules/](packages/react-native-nitro-modules) - the published React Native package and its CocoaPods, Gradle, and CMake configuration. Its native sources are staged from `packages/react-native-nitro-modules/nitro/packages/react-native-nitro-modules/`; its RN-specific JS is maintained here. Shared JS/TS comes from `nitro-core`.
28
29
-[packages/react-native-nitro-test/](packages/react-native-nitro-test) — a Nitro module full of specs used as compile-time and runtime tests.
29
30
-[packages/react-native-nitro-test-external/](packages/react-native-nitro-test-external) — a second Nitro module used to cover cross-module behavior.
30
31
-[packages/template/](packages/template) - the `npx nitrogen init` React Native library template. It stays here with the CocoaPods/Gradle/CMake integration and React Native dependencies it configures.
@@ -40,7 +41,7 @@ We use **Bun** as the package manager and task runner. Don't use `npm`, `yarn`,
40
41
bun bootstrap # initialize the pinned core submodule, install, and build
41
42
bun bootstrap:ios # also install Bundler dependencies and example app Pods
42
43
bun sync-core # refresh staged implementation sources
43
-
bun run build # stage sources and build nitro, nitrogen, and the test modules
44
+
bun run build # stage native sources and build core, RN, Nitrogen, and tests
44
45
bun specs # regenerate nitrogen output for react-native-nitro-test
45
46
bun lint-all # run all linters (JS/TS, C++, Swift, Kotlin)
46
47
```
@@ -49,7 +50,7 @@ bun lint-all # run all linters (JS/TS, C++, Swift, Kotlin)
49
50
50
51
The `packages/react-native-nitro-modules/nitro/` gitlink records the exact Nitro commit used by this repository. This repository develops on `main`; the submodule's development branch in `nitro` is `core-split`. Ordinary builds and `git submodule update --init --recursive` use the recorded commit. Do not use `git submodule update --remote` in builds.
51
52
52
-
Edit the runtime implementation in `packages/react-native-nitro-modules/nitro/packages/react-native-nitro-modules/`. The wrapper's `cpp/`, `ios/`, `android/src/`, and `src/`directories are generated by `bun sync-core` and ignored by Git. The staging command owns only those directories and the additional shared files listed in `scripts/sync-core.mjs`. Keep handwritten package and build configuration outside them. Nitrogen is used directly from `packages/react-native-nitro-modules/nitro/packages/nitrogen/` and is not copied into the wrapper.
53
+
Edit native sources in `packages/react-native-nitro-modules/nitro/packages/react-native-nitro-modules/` and shared JS/TS in `packages/react-native-nitro-modules/nitro/packages/nitro-core/`. The wrapper's `cpp/`, `ios/`, and `android/src/`directories are generated by `bun sync-core` and ignored by Git. The wrapper maintains `src/` for RN bootstrap, views, worklets, and shared API re-exports. The staging command owns only those directories and the additional shared files listed in `scripts/sync-core.mjs`. Keep handwritten package and build configuration outside them. Nitrogen is used directly from `packages/react-native-nitro-modules/nitro/packages/nitrogen/` and is not copied into the wrapper.
53
54
54
55
To update the pinned core:
55
56
@@ -59,11 +60,11 @@ To update the pinned core:
59
60
4. If the core version changed, run `bun update-core-version`. Run `bun install`, `bun specs`, and the relevant native checks, then commit the core pin, version/lockfile changes, and any intended generated test bindings here. Push the wrapper commit after the core commit is available remotely.
60
61
5. On another checkout, run `git submodule update --init --recursive` followed by `bun install` after pulling the wrapper commit.
61
62
62
-
Prepare version changes in the standalone `nitro` repository with `bun version:set VERSION`. This updates the shared runtime, Nitrogen, its runtime dependency, and native `NITRO_VERSION`. Build Nitrogen and refresh the core lockfile before committing. Publish `nitrogen`through the `nitro`release workflow, then use the final pushed core commit when updating the wrapper as described above. Nitrogen's existing semver dependency on `react-native-nitro-modules` still applies, so coordinate matching package versions in both repositories.
63
+
Prepare version changes in the standalone `nitro` repository with `bun version:set VERSION`. This updates `nitro-core`, Nitrogen, its core dependency, the native source manifest, and embedded JS/native versions. Build Nitrogen and refresh the core lockfile before committing. Publish `nitro-core` followed by `nitrogen`from the `nitro`repository, then use the final pushed core commit when updating the wrapper as described above. Nitrogen depends on `nitro-core` with a compatible semver range. The RN package depends on the exact core version to match its native runtime. All three packages use the coordinated release version.
63
64
64
-
`bun update-core-version` copies the authoritative version into the wrapper and test packages. Inspect real `npm pack` tarballs from both package directories and run the native consumer checks before publishing. In this repository, `bun release` checks the existing version and publishes only `react-native-nitro-modules` through `npm publish`; it does not bump versions with release-it.
65
+
`bun update-core-version` copies the authoritative version into the wrapper and test packages. Inspect real `npm pack` tarballs for `nitro-core`, `nitrogen`, and the RN package and run the native consumer checks before publishing. In this repository, `bun release` checks the existing version and publishes only `react-native-nitro-modules` through `npm publish`; it does not bump versions with release-it.
65
66
66
-
The runtime tarball includes staged implementation files and needs no core checkout or Git access when installed from npm.
67
+
The RN tarball includes staged native files and its own JS integration. Shared JS is installed through its `nitro-core` dependency. Neither package needs a core checkout or Git access when installed from npm.
67
68
68
69
## You don't need to ship a fix — a clean repro is enough
Copy file name to clipboardExpand all lines: packages/react-native-nitro-modules/README.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,6 +22,8 @@ npm i react-native-nitro-modules
22
22
cd ios && pod install
23
23
```
24
24
25
+
The package re-exports the shared `nitro-core` API and installs it into the React Native runtime. Existing imports from `react-native-nitro-modules` remain supported.
26
+
25
27
### Inside a nitro module library
26
28
27
29
If you are building a nitro module yourself, add [react-native-nitro-modules](https://npmjs.org/react-native-nitro-modules) as a `peerDependency` into your library's `package.json`:
@@ -212,7 +214,7 @@ The following C++ / JS types are supported out of the box:
0 commit comments