Skip to content

Commit 2ebbd87

Browse files
Copilotanupriya13
andcommitted
Fix dependencies and imports for React Native Windows 0.80.0-preview.1 upgrade
Co-authored-by: anupriya13 <54227869+anupriya13@users.noreply.github.com>
1 parent b16cd89 commit 2ebbd87

9 files changed

Lines changed: 648 additions & 606 deletions

File tree

samples/NativeModuleSample/cpp-lib/example-old/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
"@react-native/babel-preset": "^0.80.2",
2323
"@react-native/metro-config": "^0.80.2",
2424
"@react-native/typescript-config": "^0.80.2",
25-
"@rnx-kit/jest-preset": "^0.1.17"
25+
"@rnx-kit/jest-preset": "^0.1.17",
26+
"@types/react": "^19.1.0"
2627
},
2728
"engines": {
2829
"node": ">=18"

samples/NativeModuleSample/cpp-lib/example-old/src/App.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ import {
1111
DataMarshallingExamples,
1212
CircleMask,
1313
} from 'native-module-sample';
14-
import type { Int32 } from 'react-native/Libraries/Types/CodegenTypes';
14+
15+
type Int32 = number;
1516

1617
/* eslint-disable react-native/no-inline-styles */
1718

samples/NativeModuleSample/cpp-lib/example/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
"@react-native/babel-preset": "^0.80.2",
2323
"@react-native/metro-config": "^0.80.2",
2424
"@react-native/typescript-config": "^0.80.2",
25-
"@rnx-kit/jest-preset": "^0.1.17"
25+
"@rnx-kit/jest-preset": "^0.1.17",
26+
"@types/react": "^19.1.0"
2627
},
2728
"engines": {
2829
"node": ">=18"

samples/NativeModuleSample/cpp-lib/example/src/App.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ import {
1111
DataMarshallingExamples,
1212
CircleMask,
1313
} from 'native-module-sample';
14-
import type { Int32 } from 'react-native/Libraries/Types/CodegenTypes';
14+
15+
type Int32 = number;
1516

1617
/* eslint-disable react-native/no-inline-styles */
1718

samples/NativeModuleSample/cpp-lib/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"registry": "https://registry.npmjs.org/"
5555
},
5656
"devDependencies": {
57+
"@babel/core": "^7.25.2",
5758
"@react-native-community/cli": "19.1.1",
5859
"@react-native/eslint-config": "^0.80.2",
5960
"@types/jest": "^29.5.5",

samples/NativeModuleSample/cpp-lib/src/CircleMaskNativeComponent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License.
33

4-
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
4+
import { codegenNativeComponent } from 'react-native';
55
import type { ViewProps } from 'react-native';
66

77
export interface CircleMaskProps extends ViewProps {}

samples/NativeModuleSample/cpp-lib/src/NativeDataMarshallingExamples.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33

44
import type { TurboModule } from 'react-native';
55
import { TurboModuleRegistry } from 'react-native';
6-
import type { Int32 } from 'react-native/Libraries/Types/CodegenTypes';
6+
7+
export type Int32 = number;
78

89
export type Point = {
910
X: number;

samples/NativeModuleSample/cpp-lib/windows/NativeModuleSample/codegen/NativeDataMarshallingExamplesSpec.g.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(DataMarshallingExam
3333

3434
struct DataMarshallingExamplesSpec : winrt::Microsoft::ReactNative::TurboModuleSpec {
3535
static constexpr auto methods = std::tuple{
36-
Method<void(bool, int, double, std::string) noexcept>{0, L"ExplicitPrimitiveArgs"},
36+
Method<void(bool, double, double, std::string) noexcept>{0, L"ExplicitPrimitiveArgs"},
3737
Method<void(Callback<bool>) noexcept>{1, L"ReturnExplicitBoolean"},
3838
SyncMethod<bool() noexcept>{2, L"ReturnExplicitBooleanSync"},
39-
Method<void(Callback<int>) noexcept>{3, L"ReturnExplicitInteger"},
40-
SyncMethod<int() noexcept>{4, L"ReturnExplicitIntegerSync"},
39+
Method<void(Callback<double>) noexcept>{3, L"ReturnExplicitInteger"},
40+
SyncMethod<double() noexcept>{4, L"ReturnExplicitIntegerSync"},
4141
Method<void(Callback<double>) noexcept>{5, L"ReturnExplicitDouble"},
4242
SyncMethod<double() noexcept>{6, L"ReturnExplicitDoubleSync"},
4343
Method<void(Callback<std::string>) noexcept>{7, L"ReturnExplicitString"},
@@ -64,8 +64,8 @@ struct DataMarshallingExamplesSpec : winrt::Microsoft::ReactNative::TurboModuleS
6464
REACT_SHOW_METHOD_SPEC_ERRORS(
6565
0,
6666
"ExplicitPrimitiveArgs",
67-
" REACT_METHOD(ExplicitPrimitiveArgs) void ExplicitPrimitiveArgs(bool b, int i, double d, std::string s) noexcept { /* implementation */ }\n"
68-
" REACT_METHOD(ExplicitPrimitiveArgs) static void ExplicitPrimitiveArgs(bool b, int i, double d, std::string s) noexcept { /* implementation */ }\n");
67+
" REACT_METHOD(ExplicitPrimitiveArgs) void ExplicitPrimitiveArgs(bool b, double i, double d, std::string s) noexcept { /* implementation */ }\n"
68+
" REACT_METHOD(ExplicitPrimitiveArgs) static void ExplicitPrimitiveArgs(bool b, double i, double d, std::string s) noexcept { /* implementation */ }\n");
6969
REACT_SHOW_METHOD_SPEC_ERRORS(
7070
1,
7171
"ReturnExplicitBoolean",
@@ -79,13 +79,13 @@ struct DataMarshallingExamplesSpec : winrt::Microsoft::ReactNative::TurboModuleS
7979
REACT_SHOW_METHOD_SPEC_ERRORS(
8080
3,
8181
"ReturnExplicitInteger",
82-
" REACT_METHOD(ReturnExplicitInteger) void ReturnExplicitInteger(std::function<void(int)> const & callback) noexcept { /* implementation */ }\n"
83-
" REACT_METHOD(ReturnExplicitInteger) static void ReturnExplicitInteger(std::function<void(int)> const & callback) noexcept { /* implementation */ }\n");
82+
" REACT_METHOD(ReturnExplicitInteger) void ReturnExplicitInteger(std::function<void(double)> const & callback) noexcept { /* implementation */ }\n"
83+
" REACT_METHOD(ReturnExplicitInteger) static void ReturnExplicitInteger(std::function<void(double)> const & callback) noexcept { /* implementation */ }\n");
8484
REACT_SHOW_METHOD_SPEC_ERRORS(
8585
4,
8686
"ReturnExplicitIntegerSync",
87-
" REACT_SYNC_METHOD(ReturnExplicitIntegerSync) int ReturnExplicitIntegerSync() noexcept { /* implementation */ }\n"
88-
" REACT_SYNC_METHOD(ReturnExplicitIntegerSync) static int ReturnExplicitIntegerSync() noexcept { /* implementation */ }\n");
87+
" REACT_SYNC_METHOD(ReturnExplicitIntegerSync) double ReturnExplicitIntegerSync() noexcept { /* implementation */ }\n"
88+
" REACT_SYNC_METHOD(ReturnExplicitIntegerSync) static double ReturnExplicitIntegerSync() noexcept { /* implementation */ }\n");
8989
REACT_SHOW_METHOD_SPEC_ERRORS(
9090
5,
9191
"ReturnExplicitDouble",

0 commit comments

Comments
 (0)