Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Number.h not copied from react-native core (#14331)
## Description ### Type of Change - Bug fix (non-breaking change which fixes an issue) ### Why react-native-windows currently maintains its own forked C++ TurboModule bridging files. For untouched stuff we copy JSI and TurboModule files from core react-native in `Layout-MSRN-Headers.ps1`. However, this script misses to copy `Number.h`. This causes compilation error when trying to import `react/bridging/Bridging.h`, which would be the case for example when using codegen to generate C++ TurboModule (JSI) bindings (note: this is for C++ JSI TurboModules, not react-native-windows's TurboModule system). ``` PS C:\Users\CocoT1\Projects\rn77> yarn example windows [...] Time Elapsed 00:00:00.61 ✔ Restoring NuGet packages ✔ Auto-linking... Success: No auto-linking changes necessary. (69ms) ✔ Found Solution: C:\Users\CocoT1\Projects\rn77\example\windows\rn77Example.sln ℹ Build configuration: Debug ℹ Build platform: x64 ✖ Building Solution: Generating Code... ✖ Build failed with message 4:7>C:\Users\CocoT1\.nuget\packages\microsoft.reactnative.cxx\0.77.0-fabric\tools\Microsoft.ReactNative.Cxx\ReactCommon\react\bridging\Bridging.h(18,10): error C1083: Cannot open include file: 'react/bridging/Number.h': No such file or directory [C:\Users\CocoT1\Projects\rn77\example\windows\rn77Example\rn77Example.vcxproj]. Check your build configuration. ``` ### What I'm changing the `Layout-MSRN-Headers.ps1` script to also copy `Number.h`. I think this should be enough for the nuget the contain to file, but I'm no expert here. ## Testing Monkeypatched by copying over Number.h to the microsoft.reactnative.cxx nuget (`C:\Users\CocoT1\.nuget\packages\microsoft.reactnative.cxx\0.77.0-fabric\tools\Microsoft.ReactNative.Cxx\ReactCommon\react\bridging\`). Works all good. I don't know how to run the `Layout-MSRN-Headers.ps1` script locally. Here's a create-react-native-library project: https://github.com/hsjoberg/rnw-cxx-turbomodule Note: it will fail to build unless you copy Number.h over to the nuget cache as explained earlier.
- Loading branch information