Commit c0be76e
authored
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.1 parent 990994b commit c0be76e
File tree
2 files changed
+8
-0
lines changed- change
- vnext/Scripts/Tfs
2 files changed
+8
-0
lines changedLines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| 111 | + | |
111 | 112 | | |
112 | 113 | | |
113 | 114 | | |
| |||
0 commit comments