fix: Rename CachedProp to ReactProp, re-add legacy CachedProp as deprecated - #1517
Merged
Merged
Conversation
…s deprecated The v0.37.0 View props rewrite changed `CachedProp<T>`'s API (immutable shared entry, `get()`/`isProvided()`/`hasSameValue()`), which broke modules whose specs were generated by nitrogen <= 0.36.x - their generated code uses the old mutable API (`.value`, `.isDirty`, 3-arg `fromRawValue(runtime, value, oldProp)`) and no longer compiled against the new core. - Rename the new implementation to `ReactProp<T>` (cpp/views/ReactProp.hpp), and fold its now-single-use private helpers into `fromRawValue` - Re-add `CachedProp<T>` exactly as it shipped in v0.36.5, marked [[deprecated]], so old generated specs compile again (with a warning) - Update nitrogen to emit `ReactProp` and re-generate nitro-test specs
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
This was referenced Aug 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The v0.37.0 View props rewrite changed
CachedProp<T>'s API (immutable shared entry withget()/isProvided()/hasSameValue()), which broke every module whose specs were generated by nitrogen <= 0.36.x: their generated code uses the old mutable API (.value,.isDirty, 3-argfromRawValue(runtime, value, oldProp)) and no longer compiled against the new core. See the VisionCamera CI failure, where the publishedreact-native-nitro-imagefailed withno member named 'isDirty' in 'margelo::nitro::CachedProp<...>'.What
ReactProp<T>(cpp/views/ReactProp.hpp). Since the legacy 3-argfromRawValueoverload no longer needs to live here, its single-use private helpers (fromJSIValue,convertAndCacheJSIValue) are folded into the one publicfromRawValue.CachedProp<T>exactly as it shipped in v0.36.5 (mutablevalue/isDirty,equals, 3-argfromRawValue), with[[deprecated]]on the struct, so specs generated by nitrogen <= 0.36.x compile again - with a deprecation warning nudging authors to re-generate.CppHybridViewComponent.tsto emitReactProp, re-generated the nitro-test specs (pure rename), and addedReactProp.hppto the podspec's public headers (Android'sprepareHeadersglobs all.hppautomatically).Verification
react-native-nitro-image@0.15.1generated C++ (the exact code from the VisionCamera failure) compiles against the new headers with 0 errors, onlyCachedProp is deprecatedwarnings..isDirty/.valueread+write, copy ctor, lambda-in-member-init) compiles in a faithful reproduction TU.HybridTestViewComponent.cpp/HybridRecyclableTestViewComponent.cppcompile cleanly against real RN headers, as does a coexistence TU including bothCachedProp.hppandReactProp.hpp(old + new modules in one app).Note for 0.37.0-beta.1 release notes
Modules that already re-generated specs with
nitrogen@0.37.0-beta.0(which emitted the new API under theCachedPropname) will get hard compile errors against this change and must re-run nitrogen. This is unavoidable intra-beta breakage - theCachedPropname can only bind to one API, and it now belongs to the <= 0.36.x meaning that published modules depend on.🤖 Generated with Claude Code