File tree Expand file tree Collapse file tree 11 files changed +191
-45915
lines changed Expand file tree Collapse file tree 11 files changed +191
-45915
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 20
20
"release:publish" : " ./.github/scripts/setup-ci-git-user.sh && changeset publish"
21
21
},
22
22
"devDependencies" : {
23
+ "@babel/plugin-transform-runtime" : " ^7.24.7" ,
23
24
"@changesets/cli" : " ^2.27.7" ,
24
25
"concurrently" : " ^8.2.2" ,
25
26
"eslint" : " ^8.54.0" ,
41
42
"ts-node" : " ^10.9.1" ,
42
43
"recursive-readdir/minimatch" : " ^3.0.5" ,
43
44
"serve-handler/minimatch" : " ^3.0.5"
45
+ },
46
+ "dependencies" : {
47
+ "@babel/runtime" : " ^7.25.0"
44
48
}
45
49
}
Original file line number Diff line number Diff line change 1
1
module . exports = {
2
2
presets : [ "module:@react-native/babel-preset" ] ,
3
+ plugins : [ "@babel/plugin-transform-runtime" ]
3
4
} ;
Original file line number Diff line number Diff line change 1
1
module . exports = {
2
2
presets : [ "module:@react-native/babel-preset" ] ,
3
+ plugins : [ "@babel/plugin-transform-runtime" ]
3
4
} ;
Original file line number Diff line number Diff line change 8
8
ScrollView ,
9
9
StyleSheet ,
10
10
Text ,
11
+ TurboModuleRegistry ,
11
12
View ,
12
13
} from "react-native" ;
13
14
import type { TestStep , TestValue } from "./tests" ;
@@ -130,7 +131,7 @@ function Functional(): JSX.Element {
130
131
} )
131
132
. then ( async ( ) => {
132
133
const AsyncStorageTestSupport =
133
- NativeModules [ "AsyncStorageTestSupport" ] ;
134
+ TurboModuleRegistry . get ( "AsyncStorageTestSupport" ) ;
134
135
135
136
for ( const [ currentName , test ] of Object . entries ( tests ) ) {
136
137
const name = currentName + " with delegate" ;
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import {
14
14
StyleSheet ,
15
15
Text ,
16
16
TextInput ,
17
+ TurboModuleRegistry ,
17
18
View ,
18
19
} from "react-native" ;
19
20
@@ -175,22 +176,22 @@ function Merge(): JSX.Element {
175
176
testID = "setDelegate_button"
176
177
title = "Set native delegate"
177
178
disabled = {
178
- ! NativeModules [ " AsyncStorageTestSupport" ] ||
179
- ! NativeModules [ " AsyncStorageTestSupport" ] . test_setDelegate
179
+ ! TurboModuleRegistry . get ( ' AsyncStorageTestSupport' ) ||
180
+ ! TurboModuleRegistry . get ( ' AsyncStorageTestSupport' ) ? .test_setDelegate
180
181
}
181
182
onPress = { ( ) =>
182
- NativeModules [ " AsyncStorageTestSupport" ] . test_setDelegate ( ( ) => { } )
183
+ TurboModuleRegistry . get ( ' AsyncStorageTestSupport' ) ? .test_setDelegate ( ( ) => { } )
183
184
}
184
185
/>
185
186
< Button
186
187
testID = "unsetDelegate_button"
187
188
title = "Unset native delegate"
188
189
disabled = {
189
- ! NativeModules [ " AsyncStorageTestSupport" ] ||
190
- ! NativeModules [ " AsyncStorageTestSupport" ] . test_unsetDelegate
190
+ TurboModuleRegistry . get ( ' AsyncStorageTestSupport' ) ||
191
+ TurboModuleRegistry . get ( ' AsyncStorageTestSupport' ) ? .test_unsetDelegate
191
192
}
192
193
onPress = { ( ) =>
193
- NativeModules [ " AsyncStorageTestSupport" ] . test_unsetDelegate (
194
+ TurboModuleRegistry . get ( ' AsyncStorageTestSupport' ) ? .test_unsetDelegate (
194
195
( ) => { }
195
196
)
196
197
}
Original file line number Diff line number Diff line change @@ -32,6 +32,9 @@ const config = {
32
32
/ .* \. P r o j e c t I m p o r t s \. z i p / ,
33
33
] ) ,
34
34
//
35
+ extraNodeModules : {
36
+ "@react-native-async-storage/async-storage" : __dirname ,
37
+ } ,
35
38
} ,
36
39
transformer : {
37
40
getTransformOptions : async ( ) => ( {
Original file line number Diff line number Diff line change 73
73
},
74
74
"devDependencies" : {
75
75
"@babel/core" : " ^7.20.0" ,
76
+ "@babel/plugin-transform-runtime" : " ^7.24.7" ,
76
77
"@babel/preset-env" : " ^7.20.0" ,
77
78
"@react-native/babel-preset" : " ^0.74.1" ,
78
79
"@react-native/metro-config" : " ^0.73.3" ,
79
80
"@rnx-kit/jest-preset" : " ^0.1.16" ,
80
81
"@rnx-kit/metro-config" : " ^1.3.15" ,
82
+ "@types/babel__plugin-transform-runtime" : " ^7" ,
81
83
"@types/lodash" : " ^4.14.184" ,
82
84
"@types/mocha" : " ^10.0.1" ,
83
85
"@types/react" : " ^18.0.0" ,
Original file line number Diff line number Diff line change 1
- import { NativeModules } from "react-native" ;
1
+ import { NativeModules , TurboModuleRegistry } from "react-native" ;
2
2
3
3
export function shouldFallbackToLegacyNativeModule ( ) : boolean {
4
4
const expoConstants =
5
- NativeModules [ " NativeUnimoduleProxy" ] ?. modulesConstants ?. ExponentConstants ;
5
+ TurboModuleRegistry . get ( ' NativeUnimoduleProxy' ) ?. getConstants ( ) ?. modulesConstants ?. ExponentConstants ;
6
6
7
7
if ( expoConstants ) {
8
8
/**
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ namespace winrt::ReactNativeAsyncStorage::implementation
14
14
15
15
void ReactPackageProvider::CreatePackage (IReactPackageBuilder const &packageBuilder) noexcept
16
16
{
17
- AddAttributedModules (packageBuilder);
17
+ AddAttributedModules (packageBuilder, true );
18
18
}
19
19
20
20
} // namespace winrt::ReactNativeAsyncStorage::implementation
You can’t perform that action at this time.
0 commit comments