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.
@@ -1,13 +1,13 @@
1
1
  package com.gtreactnative
2
2
 
3
- import com.facebook.react.BaseReactPackage
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 : BaseReactPackage() {
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
- true // isTurboModule
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) :
@@ -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, NativeModules } from 'react-native';
4
- // Try TurboModule first, fallback to legacy NativeModule
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","NativeModules","getEnforcing","GtReactNative"],"sourceRoot":"../../src","sources":["NativeGtReactNative.ts"],"mappings":";;AAAA,SAASA,mBAAmB,EAAoBC,aAAa,QAAQ,cAAc;AASnF;AACA,eAAeD,mBAAmB,CAACE,YAAY,CAAO,eAAe,CAAC,IAAID,aAAa,CAACE,aAAa","ignoreList":[]}
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,4 +1,4 @@
1
- import { type TurboModule } from 'react-native';
1
+ import type { TurboModule } from 'react-native';
2
2
  export interface Spec extends TurboModule {
3
3
  multiply(a: number, b: number): number;
4
4
  getNativeLocales(): string[];
@@ -1 +1 @@
1
- {"version":3,"file":"NativeGtReactNative.d.ts","sourceRoot":"","sources":["../../../src/NativeGtReactNative.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,WAAW,EAAiB,MAAM,cAAc,CAAC;AAEpF,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;;AAGD,wBAAsG"}
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,6 +1,6 @@
1
1
  {
2
2
  "name": "gt-react-native",
3
- "version": "0.0.1-alpha.5",
3
+ "version": "0.0.1-alpha.6",
4
4
  "description": "An i18n package for React Native",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
@@ -1,5 +1,5 @@
1
- import { TurboModuleRegistry, type TurboModule, NativeModules } from 'react-native';
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
- // Try TurboModule first, fallback to legacy NativeModule
11
- export default TurboModuleRegistry.getEnforcing<Spec>('GtReactNative') ?? NativeModules.GtReactNative;
10
+ export default TurboModuleRegistry.getEnforcing<Spec>('GtReactNative');