Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,8 @@ We use the following code generators, but check yarn generate for more:
```
are generated. So instead of editing the code between the comments you need to edit the `codepart-*` file and run
`yarn generate` again
- `android/src/main/old-arch/` is java code generated by react-native codegen from `src/specs`

Also new architecture `codegen` by `react-native` generates a bunch of code from `src/specs`
React Native's new architecture `codegen` generates code from `src/specs`

### Documentation generation

Expand Down
21 changes: 1 addition & 20 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@ def safeExtGet(prop, fallback) {
}


def isNewArchitectureEnabled() {
// To opt-in for the New Architecture, you can either:
// - Set `newArchEnabled` to true inside the `gradle.properties` file
// - Invoke gradle with `-newArchEnabled=true`
// - Set an environment variable `ORG_GRADLE_PROJECT_newArchEnabled=true`
return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true"
}

def getCoroutinesVersion(kotlinVersion) {
return kotlinVersion >= '1.9' ? '1.8.0' : '1.6.4'
Expand Down Expand Up @@ -50,9 +43,7 @@ buildscript {
}
}

if (isNewArchitectureEnabled()) {
apply plugin: 'com.facebook.react'
}
apply plugin: 'com.facebook.react'
apply plugin: 'com.android.library'

if (safeExtGet("RNMapboxMapsImpl", defaultMapboxMapsImpl) == "mapbox") {
Expand Down Expand Up @@ -236,15 +227,6 @@ Please upgrade to Mapbox v11.x or use @rnmapbox/maps 10.2.x
throw new GradleException(msg)
}

if (!isNewArchitectureEnabled()) {
def msg = """
❌ ERROR: Old React Native Architecture is no longer supported as of @rnmapbox/maps 10.3.0
Please enable New Architecture (newArchEnabled=true) or use @rnmapbox/maps 10.2.x
"""
logger.error(msg)
throw new GradleException(msg)
}

compileSdkVersion safeExtGet("compileSdkVersion", 28)
buildToolsVersion safeExtGet("buildToolsVersion", '28.0.3')

Expand All @@ -253,7 +235,6 @@ Please enable New Architecture (newArchEnabled=true) or use @rnmapbox/maps 10.2.
targetSdkVersion safeExtGet('targetSdkVersion', 26)
versionCode 1
versionName "1.0"
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
}

compileOptions {
Expand Down
19 changes: 9 additions & 10 deletions android/src/main/java/com/rnmapbox/rnmbx/RNMBXPackage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ class RNMBXPackage : TurboReactPackage() {
resetViewTagResolver()
return ReactModuleInfoProvider {
val moduleInfos: MutableMap<String, ReactModuleInfo> = HashMap()
val isTurboModule = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
moduleInfos[RNMBXModule.REACT_CLASS] = ReactModuleInfo(
RNMBXModule.REACT_CLASS,
RNMBXModule.REACT_CLASS,
Expand All @@ -194,7 +193,7 @@ class RNMBXPackage : TurboReactPackage() {
false, // needsEagerInit
true, // hasConstants
false, // isCxxModule
isTurboModule // isTurboModule
true // isTurboModule
)
moduleInfos[RNMBXOfflineModule.REACT_CLASS] = ReactModuleInfo(
RNMBXOfflineModule.REACT_CLASS,
Expand Down Expand Up @@ -248,7 +247,7 @@ class RNMBXPackage : TurboReactPackage() {
false, // needsEagerInit
false, // hasConstants
false, // isCxxModule
isTurboModule // isTurboModule
true // isTurboModule
)
moduleInfos[RNMBXViewportModule.NAME] = ReactModuleInfo(
RNMBXViewportModule.NAME,
Expand All @@ -257,7 +256,7 @@ class RNMBXPackage : TurboReactPackage() {
false, // needsEagerInit
false, // hasConstants
false, // isCxxModule
isTurboModule // isTurboModule
true // isTurboModule
)
moduleInfos[RNMBXCameraModule.NAME] = ReactModuleInfo(
RNMBXCameraModule.NAME,
Expand All @@ -266,7 +265,7 @@ class RNMBXPackage : TurboReactPackage() {
false, // needsEagerInit
false, // hasConstants
false, // isCxxModule
isTurboModule // isTurboModule
true // isTurboModule
)
moduleInfos[RNMBXShapeSourceModule.NAME] = ReactModuleInfo(
RNMBXShapeSourceModule.NAME,
Expand All @@ -275,7 +274,7 @@ class RNMBXPackage : TurboReactPackage() {
false, // needsEagerInit
false, // hasConstants
false, // isCxxModule
isTurboModule // isTurboModule
true // isTurboModule
)
moduleInfos[RNMBXImageModule.NAME] = ReactModuleInfo(
RNMBXImageModule.NAME,
Expand All @@ -284,7 +283,7 @@ class RNMBXPackage : TurboReactPackage() {
false, // needsEagerInit
false, // hasConstants
false, // isCxxModule
isTurboModule // isTurboModule
true // isTurboModule
)
moduleInfos[RNMBXPointAnnotationModule.NAME] = ReactModuleInfo(
RNMBXPointAnnotationModule.NAME,
Expand All @@ -293,7 +292,7 @@ class RNMBXPackage : TurboReactPackage() {
false, // needsEagerInit
false, // hasConstants
false, // isCxxModule
isTurboModule // isTurboModule
true // isTurboModule
)
moduleInfos[RNMBXMovePointShapeAnimatorModule.NAME] = ReactModuleInfo(
RNMBXMovePointShapeAnimatorModule.NAME,
Expand All @@ -302,7 +301,7 @@ class RNMBXPackage : TurboReactPackage() {
false,
false,
false,
isTurboModule
true // isTurboModule
)
moduleInfos[RNMBXChangeLineOffsetsShapeAnimatorModule.NAME] = ReactModuleInfo(
RNMBXChangeLineOffsetsShapeAnimatorModule.NAME,
Expand All @@ -311,7 +310,7 @@ class RNMBXPackage : TurboReactPackage() {
false,
false,
false,
isTurboModule
true // isTurboModule
)
moduleInfos
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@ import com.facebook.react.bridge.Promise
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.bridge.ReactMethod
import com.facebook.react.module.annotations.ReactModule
import com.facebook.react.uimanager.UIManagerHelper
import com.facebook.react.uimanager.common.UIManagerType
import com.rnmapbox.rnmbx.BuildConfig
import com.rnmapbox.rnmbx.NativeRNMBXShapeSourceModuleSpec
import com.rnmapbox.rnmbx.components.mapview.RNMBXMapView
import com.rnmapbox.rnmbx.utils.ViewRefTag
import com.rnmapbox.rnmbx.utils.ViewTagResolver

Expand Down
45 changes: 0 additions & 45 deletions android/src/main/java/com/rnmapbox/rnmbx/events/EventEmitter.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import com.facebook.react.module.annotations.ReactModule
import com.rnmapbox.rnmbx.NativeRNMBXLocationModuleSpec
import com.rnmapbox.rnmbx.location.LocationManager.OnUserLocationChange
import com.rnmapbox.rnmbx.events.LocationEvent
import com.rnmapbox.rnmbx.events.EventEmitter
import com.rnmapbox.rnmbx.location.LocationManager.Companion.getInstance
import java.lang.Exception

Expand Down Expand Up @@ -58,14 +57,7 @@ class RNMBXLocationModule(reactContext: ReactApplicationContext) :
mLastLocation = location
if (changed && (location != null) && shouldSendLocationEvent()) {
val locationEvent = LocationEvent(location)

if(mEventEmitterCallback != null){
emitOnLocationUpdate(locationEvent.toJSON())
}else {
// Emmit event for old architecture
val emitter = EventEmitter.getModuleEmitter(reactApplicationContext)
emitter?.emit(LOCATION_UPDATE, locationEvent.payload)
}
emitOnLocationUpdate(locationEvent.toJSON())
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import com.facebook.react.bridge.UIManager
import com.facebook.react.uimanager.IllegalViewOperationException
import com.facebook.react.uimanager.UIManagerHelper
import com.facebook.react.uimanager.common.UIManagerType
import com.rnmapbox.rnmbx.BuildConfig

data class ViewTagWaiter<V>(
val fn: (V) -> Unit,
Expand Down Expand Up @@ -59,12 +58,7 @@ open class ViewTagResolver(val context: ReactApplicationContext) {
}

private val manager : UIManager
get() =
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
UIManagerHelper.getUIManager(context, UIManagerType.FABRIC)!!
} else {
UIManagerHelper.getUIManager(context, UIManagerType.DEFAULT)!!
}
get() = UIManagerHelper.getUIManager(context, UIManagerType.FABRIC)!!

// calls on UiQueueThread with resolved view
fun <V>withViewResolved(viewTag: Int, reject: Promise? = null, fn: (V) -> Unit) {
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading