Skip to content

Commit

Permalink
chore: example upgrade to rn 0.74.3 (#3570)
Browse files Browse the repository at this point in the history
  • Loading branch information
mfazekas committed Jul 13, 2024
1 parent 0c37ee8 commit 523479c
Show file tree
Hide file tree
Showing 13 changed files with 37 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ data class ViewTagWaiter<V>(

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<Int> = hashSetOf<Int>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
10 changes: 5 additions & 5 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down

0 comments on commit 523479c

Please sign in to comment.