gt-react-native 0.0.1-alpha.5 → 0.0.1-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/main/java/com/gtreactnative/GtReactNativePackage.kt +4 -3
- package/android/src/newarch/com/gtreactnative/GtReactNativeModule.kt +0 -1
- package/ios/GtReactNative.mm +1 -1
- package/lib/module/NativeGtReactNative.js +2 -3
- package/lib/module/NativeGtReactNative.js.map +1 -1
- package/lib/typescript/src/NativeGtReactNative.d.ts +1 -1
- package/lib/typescript/src/NativeGtReactNative.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/NativeGtReactNative.ts +3 -4
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
package com.gtreactnative
|
|
2
2
|
|
|
3
|
-
import com.facebook.react.
|
|
3
|
+
import com.facebook.react.TurboReactPackage
|
|
4
4
|
import com.facebook.react.bridge.NativeModule
|
|
5
5
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
6
6
|
import com.facebook.react.module.model.ReactModuleInfo
|
|
7
7
|
import com.facebook.react.module.model.ReactModuleInfoProvider
|
|
8
8
|
import java.util.HashMap
|
|
9
9
|
|
|
10
|
-
class GtReactNativePackage :
|
|
10
|
+
class GtReactNativePackage : TurboReactPackage() {
|
|
11
11
|
override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? {
|
|
12
12
|
return if (name == GtReactNativeModule.NAME) {
|
|
13
13
|
GtReactNativeModule(reactContext)
|
|
@@ -19,13 +19,14 @@ class GtReactNativePackage : BaseReactPackage() {
|
|
|
19
19
|
override fun getReactModuleInfoProvider(): ReactModuleInfoProvider {
|
|
20
20
|
return ReactModuleInfoProvider {
|
|
21
21
|
val moduleInfos: MutableMap<String, ReactModuleInfo> = HashMap()
|
|
22
|
+
val isTurboModule = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
|
|
22
23
|
moduleInfos[GtReactNativeModule.NAME] = ReactModuleInfo(
|
|
23
24
|
GtReactNativeModule.NAME,
|
|
24
25
|
GtReactNativeModule.NAME,
|
|
25
26
|
false, // canOverrideExistingModule
|
|
26
27
|
false, // needsEagerInit
|
|
27
28
|
false, // isCxxModule
|
|
28
|
-
|
|
29
|
+
isTurboModule // isTurboModule
|
|
29
30
|
)
|
|
30
31
|
moduleInfos
|
|
31
32
|
}
|
|
@@ -3,7 +3,6 @@ package com.gtreactnative
|
|
|
3
3
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
4
4
|
import com.facebook.react.bridge.WritableArray
|
|
5
5
|
import com.facebook.react.module.annotations.ReactModule
|
|
6
|
-
import com.facebook.fbreact.specs.NativeGtReactNativeSpec
|
|
7
6
|
|
|
8
7
|
@ReactModule(name = GtReactNativeModuleImpl.NAME)
|
|
9
8
|
class GtReactNativeModule(reactContext: ReactApplicationContext) :
|
package/ios/GtReactNative.mm
CHANGED
|
@@ -89,7 +89,7 @@ RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(getNativeLocales) {
|
|
|
89
89
|
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(nativeStoreGet:(NSString *)key) {
|
|
90
90
|
return [self nativeStoreGetImpl:key];
|
|
91
91
|
}
|
|
92
|
-
|
|
92
|
+
t
|
|
93
93
|
RCT_EXPORT_METHOD(nativeStoreSet:(NSString *)key value:(NSString *)value) {
|
|
94
94
|
[self nativeStoreSetImpl:key value:value];
|
|
95
95
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { TurboModuleRegistry
|
|
4
|
-
|
|
5
|
-
export default TurboModuleRegistry.getEnforcing('GtReactNative') ?? NativeModules.GtReactNative;
|
|
3
|
+
import { TurboModuleRegistry } from 'react-native';
|
|
4
|
+
export default TurboModuleRegistry.getEnforcing('GtReactNative');
|
|
6
5
|
//# sourceMappingURL=NativeGtReactNative.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TurboModuleRegistry","
|
|
1
|
+
{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeGtReactNative.ts"],"mappings":";;AACA,SAASA,mBAAmB,QAAQ,cAAc;AAQlD,eAAeA,mBAAmB,CAACC,YAAY,CAAO,eAAe,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeGtReactNative.d.ts","sourceRoot":"","sources":["../../../src/NativeGtReactNative.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"NativeGtReactNative.d.ts","sourceRoot":"","sources":["../../../src/NativeGtReactNative.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvC,gBAAgB,IAAI,MAAM,EAAE,CAAC;IAC7B,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC3C,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CAClD;;AAED,wBAAuE"}
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import type { TurboModule } from 'react-native';
|
|
2
|
+
import { TurboModuleRegistry } from 'react-native';
|
|
3
3
|
export interface Spec extends TurboModule {
|
|
4
4
|
multiply(a: number, b: number): number;
|
|
5
5
|
getNativeLocales(): string[];
|
|
@@ -7,5 +7,4 @@ export interface Spec extends TurboModule {
|
|
|
7
7
|
nativeStoreSet(key: string, value: string): void;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
export default TurboModuleRegistry.getEnforcing<Spec>('GtReactNative') ?? NativeModules.GtReactNative;
|
|
10
|
+
export default TurboModuleRegistry.getEnforcing<Spec>('GtReactNative');
|