From 523479c37f716820b915b6c2ce70efcf1b15bd04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikl=C3=B3s=20Fazekas?= Date: Sat, 13 Jul 2024 17:54:02 +0200 Subject: [PATCH] chore: example upgrade to rn 0.74.3 (#3570) --- .../components/mapview/NativeMapViewModule.kt | 8 ------ .../styles/sources/RNMBXShapeSourceModule.kt | 4 +-- .../rnmapbox/rnmbx/utils/ViewTagResolver.kt | 2 +- .../rnmbx/NativeMapViewModuleSpec.java | 26 +++++++++---------- .../rnmbx/NativeRNMBXCameraModuleSpec.java | 2 +- ...ngeLineOffsetsShapeAnimatorModuleSpec.java | 8 +++--- .../rnmbx/NativeRNMBXImageModuleSpec.java | 2 +- ...RNMBXMovePointShapeAnimatorModuleSpec.java | 4 +-- .../NativeRNMBXPointAnnotationModuleSpec.java | 2 +- .../NativeRNMBXShapeSourceModuleSpec.java | 6 ++--- .../rnmbx/NativeRNMBXTileStoreModuleSpec.java | 2 +- .../rnmbx/NativeRNMBXViewportModuleSpec.java | 6 ++--- example/package.json | 10 +++---- 13 files changed, 37 insertions(+), 45 deletions(-) diff --git a/android/src/main/java/com/rnmapbox/rnmbx/components/mapview/NativeMapViewModule.kt b/android/src/main/java/com/rnmapbox/rnmbx/components/mapview/NativeMapViewModule.kt index ef529ef14..41158020f 100644 --- a/android/src/main/java/com/rnmapbox/rnmbx/components/mapview/NativeMapViewModule.kt +++ b/android/src/main/java/com/rnmapbox/rnmbx/components/mapview/NativeMapViewModule.kt @@ -152,14 +152,6 @@ class NativeMapViewModule(context: ReactApplicationContext, val viewTagResolver: } } - public fun setHandledMapChangedEvents( - viewRef: Double?, - events: ReadableArray, - promise: Promise - ) { - setHandledMapChangedEvents(viewRef?.toInt(), events, promise) - } - override fun clearData(viewRef: ViewRefTag?, promise: Promise) { withMapViewOnUIThread(viewRef, promise) { it.clearData(createCommandResponse(promise)) diff --git a/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXShapeSourceModule.kt b/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXShapeSourceModule.kt index 63984974e..03c18298c 100644 --- a/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXShapeSourceModule.kt +++ b/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXShapeSourceModule.kt @@ -44,8 +44,8 @@ class RNMBXShapeSourceModule(reactContext: ReactApplicationContext?, private val override fun getClusterLeaves( viewRef: ViewRefTag?, featureJSON: String, - number: Int, - offset: Int, + number: Double, + offset: Double, promise: Promise ) { withShapeSourceOnUIThread(viewRef, promise) { diff --git a/android/src/main/java/com/rnmapbox/rnmbx/utils/ViewTagResolver.kt b/android/src/main/java/com/rnmapbox/rnmbx/utils/ViewTagResolver.kt index 07bac4da4..f45cc25da 100644 --- a/android/src/main/java/com/rnmapbox/rnmbx/utils/ViewTagResolver.kt +++ b/android/src/main/java/com/rnmapbox/rnmbx/utils/ViewTagResolver.kt @@ -16,7 +16,7 @@ data class ViewTagWaiter( const val LOG_TAG = "ViewTagResolver" -typealias ViewRefTag = Int +typealias ViewRefTag = Double // see https://github.com/rnmapbox/maps/pull/3074 open class ViewTagResolver(val context: ReactApplicationContext) { private val createdViews: HashSet = hashSetOf() diff --git a/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeMapViewModuleSpec.java b/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeMapViewModuleSpec.java index 3081071d0..5014f4c73 100644 --- a/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeMapViewModuleSpec.java +++ b/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeMapViewModuleSpec.java @@ -37,53 +37,53 @@ public NativeMapViewModuleSpec(ReactApplicationContext reactContext) { @ReactMethod @DoNotStrip - public abstract void takeSnap(@Nullable Integer viewRef, boolean writeToDisk, Promise promise); + public abstract void takeSnap(@Nullable Double viewRef, boolean writeToDisk, Promise promise); @ReactMethod @DoNotStrip - public abstract void queryTerrainElevation(@Nullable Integer viewRef, ReadableArray coordinates, Promise promise); + public abstract void queryTerrainElevation(@Nullable Double viewRef, ReadableArray coordinates, Promise promise); @ReactMethod @DoNotStrip - public abstract void setSourceVisibility(@Nullable Integer viewRef, boolean visible, String sourceId, String sourceLayerId, Promise promise); + public abstract void setSourceVisibility(@Nullable Double viewRef, boolean visible, String sourceId, String sourceLayerId, Promise promise); @ReactMethod @DoNotStrip - public abstract void getCenter(@Nullable Integer viewRef, Promise promise); + public abstract void getCenter(@Nullable Double viewRef, Promise promise); @ReactMethod @DoNotStrip - public abstract void getCoordinateFromView(@Nullable Integer viewRef, ReadableArray atPoint, Promise promise); + public abstract void getCoordinateFromView(@Nullable Double viewRef, ReadableArray atPoint, Promise promise); @ReactMethod @DoNotStrip - public abstract void getPointInView(@Nullable Integer viewRef, ReadableArray atCoordinate, Promise promise); + public abstract void getPointInView(@Nullable Double viewRef, ReadableArray atCoordinate, Promise promise); @ReactMethod @DoNotStrip - public abstract void getZoom(@Nullable Integer viewRef, Promise promise); + public abstract void getZoom(@Nullable Double viewRef, Promise promise); @ReactMethod @DoNotStrip - public abstract void getVisibleBounds(@Nullable Integer viewRef, Promise promise); + public abstract void getVisibleBounds(@Nullable Double viewRef, Promise promise); @ReactMethod @DoNotStrip - public abstract void queryRenderedFeaturesAtPoint(@Nullable Integer viewRef, ReadableArray atPoint, ReadableArray withFilter, ReadableArray withLayerIDs, Promise promise); + public abstract void queryRenderedFeaturesAtPoint(@Nullable Double viewRef, ReadableArray atPoint, ReadableArray withFilter, ReadableArray withLayerIDs, Promise promise); @ReactMethod @DoNotStrip - public abstract void queryRenderedFeaturesInRect(@Nullable Integer viewRef, ReadableArray withBBox, ReadableArray withFilter, ReadableArray withLayerIDs, Promise promise); + public abstract void queryRenderedFeaturesInRect(@Nullable Double viewRef, ReadableArray withBBox, ReadableArray withFilter, ReadableArray withLayerIDs, Promise promise); @ReactMethod @DoNotStrip - public abstract void setHandledMapChangedEvents(@Nullable Integer viewRef, ReadableArray events, Promise promise); + public abstract void setHandledMapChangedEvents(@Nullable Double viewRef, ReadableArray events, Promise promise); @ReactMethod @DoNotStrip - public abstract void clearData(@Nullable Integer viewRef, Promise promise); + public abstract void clearData(@Nullable Double viewRef, Promise promise); @ReactMethod @DoNotStrip - public abstract void querySourceFeatures(@Nullable Integer viewRef, String sourceId, ReadableArray withFilter, ReadableArray withSourceLayerIDs, Promise promise); + public abstract void querySourceFeatures(@Nullable Double viewRef, String sourceId, ReadableArray withFilter, ReadableArray withSourceLayerIDs, Promise promise); } diff --git a/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXCameraModuleSpec.java b/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXCameraModuleSpec.java index eb62c2ffb..4cdf8937e 100644 --- a/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXCameraModuleSpec.java +++ b/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXCameraModuleSpec.java @@ -37,5 +37,5 @@ public NativeRNMBXCameraModuleSpec(ReactApplicationContext reactContext) { @ReactMethod @DoNotStrip - public abstract void updateCameraStop(@Nullable Integer viewRef, ReadableMap stop, Promise promise); + public abstract void updateCameraStop(@Nullable Double viewRef, ReadableMap stop, Promise promise); } diff --git a/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXChangeLineOffsetsShapeAnimatorModuleSpec.java b/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXChangeLineOffsetsShapeAnimatorModuleSpec.java index 85b2a2ce1..2e04b9b05 100644 --- a/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXChangeLineOffsetsShapeAnimatorModuleSpec.java +++ b/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXChangeLineOffsetsShapeAnimatorModuleSpec.java @@ -36,17 +36,17 @@ public NativeRNMBXChangeLineOffsetsShapeAnimatorModuleSpec(ReactApplicationConte @ReactMethod @DoNotStrip - public abstract void create(int tag, ReadableArray coordinates, double startOffset, double endOffset, Promise promise); + public abstract void create(double tag, ReadableArray coordinates, double startOffset, double endOffset, Promise promise); @ReactMethod @DoNotStrip - public abstract void setLineString(int tag, ReadableArray coordinates, double startOffset, double endOffset, Promise promise); + public abstract void setLineString(double tag, ReadableArray coordinates, double startOffset, double endOffset, Promise promise); @ReactMethod @DoNotStrip - public abstract void setStartOffset(int tag, double offset, double duration, Promise promise); + public abstract void setStartOffset(double tag, double offset, double duration, Promise promise); @ReactMethod @DoNotStrip - public abstract void setEndOffset(int tag, double offset, double duration, Promise promise); + public abstract void setEndOffset(double tag, double offset, double duration, Promise promise); } diff --git a/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXImageModuleSpec.java b/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXImageModuleSpec.java index 4dcd1ddf9..756e43661 100644 --- a/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXImageModuleSpec.java +++ b/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXImageModuleSpec.java @@ -36,5 +36,5 @@ public NativeRNMBXImageModuleSpec(ReactApplicationContext reactContext) { @ReactMethod @DoNotStrip - public abstract void refresh(@Nullable Integer viewRef, Promise promise); + public abstract void refresh(@Nullable Double viewRef, Promise promise); } diff --git a/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXMovePointShapeAnimatorModuleSpec.java b/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXMovePointShapeAnimatorModuleSpec.java index bc368a525..4b52b8b16 100644 --- a/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXMovePointShapeAnimatorModuleSpec.java +++ b/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXMovePointShapeAnimatorModuleSpec.java @@ -36,9 +36,9 @@ public NativeRNMBXMovePointShapeAnimatorModuleSpec(ReactApplicationContext react @ReactMethod @DoNotStrip - public abstract void create(int tag, ReadableArray coordinate, Promise promise); + public abstract void create(double tag, ReadableArray coordinate, Promise promise); @ReactMethod @DoNotStrip - public abstract void moveTo(int tag, ReadableArray coordinate, double duration, Promise promise); + public abstract void moveTo(double tag, ReadableArray coordinate, double duration, Promise promise); } diff --git a/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXPointAnnotationModuleSpec.java b/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXPointAnnotationModuleSpec.java index 7a07946f2..060701ff6 100644 --- a/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXPointAnnotationModuleSpec.java +++ b/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXPointAnnotationModuleSpec.java @@ -36,5 +36,5 @@ public NativeRNMBXPointAnnotationModuleSpec(ReactApplicationContext reactContext @ReactMethod @DoNotStrip - public abstract void refresh(@Nullable Integer viewRef, Promise promise); + public abstract void refresh(@Nullable Double viewRef, Promise promise); } diff --git a/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXShapeSourceModuleSpec.java b/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXShapeSourceModuleSpec.java index a72efaca3..f0b8de373 100644 --- a/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXShapeSourceModuleSpec.java +++ b/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXShapeSourceModuleSpec.java @@ -36,13 +36,13 @@ public NativeRNMBXShapeSourceModuleSpec(ReactApplicationContext reactContext) { @ReactMethod @DoNotStrip - public abstract void getClusterExpansionZoom(@Nullable Integer viewRef, String featureJSON, Promise promise); + public abstract void getClusterExpansionZoom(@Nullable Double viewRef, String featureJSON, Promise promise); @ReactMethod @DoNotStrip - public abstract void getClusterLeaves(@Nullable Integer viewRef, String featureJSON, int number, int offset, Promise promise); + public abstract void getClusterLeaves(@Nullable Double viewRef, String featureJSON, double number, double offset, Promise promise); @ReactMethod @DoNotStrip - public abstract void getClusterChildren(@Nullable Integer viewRef, String featureJSON, Promise promise); + public abstract void getClusterChildren(@Nullable Double viewRef, String featureJSON, Promise promise); } diff --git a/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXTileStoreModuleSpec.java b/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXTileStoreModuleSpec.java index c6a364b5d..cf95bc7f2 100644 --- a/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXTileStoreModuleSpec.java +++ b/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXTileStoreModuleSpec.java @@ -41,5 +41,5 @@ public NativeRNMBXTileStoreModuleSpec(ReactApplicationContext reactContext) { @ReactMethod @DoNotStrip - public abstract void setOption(int tag, String key, String domain, ReadableMap value, Promise promise); + public abstract void setOption(double tag, String key, String domain, ReadableMap value, Promise promise); } diff --git a/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXViewportModuleSpec.java b/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXViewportModuleSpec.java index dc9425fd7..2b565c4bf 100644 --- a/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXViewportModuleSpec.java +++ b/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXViewportModuleSpec.java @@ -37,13 +37,13 @@ public NativeRNMBXViewportModuleSpec(ReactApplicationContext reactContext) { @ReactMethod @DoNotStrip - public abstract void getState(@Nullable Integer viewRef, Promise promise); + public abstract void getState(@Nullable Double viewRef, Promise promise); @ReactMethod @DoNotStrip - public abstract void transitionTo(@Nullable Integer viewRef, ReadableMap state, ReadableMap transition, Promise promise); + public abstract void transitionTo(@Nullable Double viewRef, ReadableMap state, ReadableMap transition, Promise promise); @ReactMethod @DoNotStrip - public abstract void idle(@Nullable Integer viewRef, Promise promise); + public abstract void idle(@Nullable Double viewRef, Promise promise); } diff --git a/example/package.json b/example/package.json index e41dd767e..022426729 100644 --- a/example/package.json +++ b/example/package.json @@ -37,7 +37,7 @@ "moment": "^2.24.0", "prop-types": "^15.7.2", "react": "18.2.0", - "react-native": "0.74.2", + "react-native": "0.74.3", "react-native-safe-area-context": "4.10.4", "react-native-screens": "3.31.1", "react-native-vector-icons": "9.2.0", @@ -56,10 +56,10 @@ "@babel/plugin-transform-private-methods": "^7.23.3", "@babel/preset-env": "^7.20.0", "@babel/runtime": "^7.20.0", - "@react-native/babel-preset": "^0.74.2", - "@react-native/eslint-config": "^0.74.1", - "@react-native/metro-config": "^0.74.2", - "@react-native/typescript-config": "^0.74.1", + "@react-native/babel-preset": "^0.74.85", + "@react-native/eslint-config": "^0.74.85", + "@react-native/metro-config": "^0.74.85", + "@react-native/typescript-config": "^0.74.85", "@types/react": "^18.2.45", "@types/react-test-renderer": "^18.0.0", "babel-jest": "^29.6.3",