Skip to content

feat: Upgrade Nitro to 0.37 for View improvements - #166

Merged
mrousavy merged 6 commits into
mainfrom
feat/nitro-0.37
Aug 20, 2026
Merged

feat: Upgrade Nitro to 0.37 for View improvements#166
mrousavy merged 6 commits into
mainfrom
feat/nitro-0.37

Conversation

@mrousavy

@mrousavy mrousavy commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Updates react-native-nitro-modules and nitrogen to 0.37.0, regenerates specs and reinstalls Pods.

The regenerated view code picks up Nitro 0.37's View improvements:

  • props are now diffed against the last state applied to that specific view instance instead of a global cached state (updateViewProps(view, newState, oldState))
  • state is reset on drop/recycle, so recycled views get all props re-applied
  • ViewComponentDescriptor / ViewPropsHolderState moved into NitroModules instead of being emitted per-view
  • CachedProp<T> in generated view props is renamed to ReactProp<T> (CachedProp remains a deprecated alias upstream; no hand-written code referenced it)

Same change as margelo/react-native-vision-camera#4164.

Verified green on the betas along the way (0.37.0-beta.0 -> beta.1 -> 0.37.0); 0.37.0 generates specs byte-identical to beta.1, so the final bump is version pins and lockfiles only.

Note on pre-release peer resolution (resolved)

While this PR was on the betas, peerDependencies of "*" did not match the pre-release (semver excludes pre-releases from ranges), so bun installed a nested stable 0.36.5 copy under each workspace package. Metro then bundled 0.36.5 JS against 0.37.0-beta native code and Nitro's "installed twice" guard fired in the harness tests.

That was worked around with a root overrides pin, then fixed properly in #170 by marking the peer dependency optional - the override has since been removed. Now that 0.37.0 is a stable release the range matches again anyway, but the optional peer keeps future pre-release testing working.

peerDependencies "*" doesn't match prereleases per semver, so bun
auto-installed a nested 0.36.5 copy under each workspace package.
Metro bundled that 0.36.5 JS while native built against 0.37.0-beta.0,
tripping Nitro's "installed twice" version guard in the harness tests.
Nitrogen 0.37.0-beta.1 renames CachedProp<T> to ReactProp<T> in generated
view props, so specs were re-generated. CachedProp remains as a deprecated
alias upstream and no hand-written code referenced it.

Also drops the react-native-nitro-modules override again - now that #170
marks the peer dependency as optional, bun no longer installs a second
stable copy alongside the pre-release, so the workaround is redundant.
0.37.0 stable generates identical specs to 0.37.0-beta.1, so there is no
codegen delta - only the version pins and lockfiles change.
@mrousavy
mrousavy merged commit 6739706 into main Aug 20, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant