Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrate whole library to new arch #3048

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
212f67b
Setup fabricexample app
j-piasecki Aug 24, 2023
0e5b78b
Enable new architecture
j-piasecki Aug 24, 2023
d8e5ae1
Basic ios setup
j-piasecki Aug 24, 2023
f40bfa7
Some iOS progress:
j-piasecki Aug 25, 2023
0147706
Use one view manager?
j-piasecki Aug 28, 2023
5785b88
Update spec
j-piasecki Aug 28, 2023
09bb480
Start android
j-piasecki Aug 28, 2023
81130bf
Convert dynamic position to dict
j-piasecki Aug 28, 2023
08fceb5
Set iOS props
j-piasecki Aug 28, 2023
287c7e2
Update spec
j-piasecki Aug 29, 2023
a05160a
Update Android event emitter
j-piasecki Aug 29, 2023
585dbf4
iOS events shenanigans
j-piasecki Aug 29, 2023
e89206a
Use module instead of native commands on new arch
j-piasecki Aug 30, 2023
2ae8842
Implement all methods
j-piasecki Aug 30, 2023
d07804f
I've figured it out :)
j-piasecki Aug 30, 2023
329af5e
Begin android module
j-piasecki Aug 31, 2023
d02bdb1
Make android commands work
j-piasecki Sep 1, 2023
1bae7b1
Update Android module to resolve promises with data
j-piasecki Sep 1, 2023
b06a4b8
Remove command name from module calls
j-piasecki Sep 1, 2023
0a23822
Reject promises when error is present
j-piasecki Sep 1, 2023
2f8dcf4
I aimed a little to high in the code
j-piasecki Sep 1, 2023
7dd5fe7
Reject promise when map view cannot be found
j-piasecki Sep 1, 2023
6d9d8e0
feat: old arch also working
WoLewicki Sep 1, 2023
fc23bfd
Update gitignore
j-piasecki Sep 1, 2023
a95fe4f
Fixes after rebase
j-piasecki Sep 4, 2023
fb96e20
Add helper for decoding event payload
j-piasecki Sep 4, 2023
cf70036
Revert whitespace changes
j-piasecki Sep 4, 2023
1b3922f
Support for TextureMapView
j-piasecki Sep 4, 2023
55a11e8
Support old architecture on Android
j-piasecki Sep 4, 2023
174ebcc
feat: simpler new arch interoop
WoLewicki Sep 5, 2023
7808343
Clean up the simpler interop and make iOS compile
j-piasecki Sep 5, 2023
66e6ccd
Fix lint & tests
j-piasecki Sep 5, 2023
d6a9c2f
Support MarkerView on the new arch on Android
j-piasecki Sep 6, 2023
e36a7d3
Add specs for the old arch
j-piasecki Sep 6, 2023
9204b47
Support MarkerView on the new arch on iOS
j-piasecki Sep 6, 2023
f0366f6
feat: add all examples to fabricexample
WoLewicki Sep 7, 2023
96c57e6
feat: add ios atmosphere
WoLewicki Sep 7, 2023
82a637d
fix: some problems with atmosphere
WoLewicki Sep 8, 2023
dcd033d
fix: clean up atmosphere
WoLewicki Sep 8, 2023
bdf3b7a
feat: migrate terrain
WoLewicki Sep 8, 2023
568c3e2
feat: migrate all layers
WoLewicki Sep 8, 2023
103d39f
fix: dispatch mapview methods on uimanager queue
WoLewicki Sep 13, 2023
80bcf4c
feat: migrate RasterSource
WoLewicki Sep 13, 2023
393a98f
fix: make uimanager find RasterSource
WoLewicki Sep 13, 2023
636ff62
fix: make fabric utils a private header so swift compiles and move ut…
WoLewicki Sep 13, 2023
e65c1ba
chore: merge current main
WoLewicki Sep 13, 2023
b2e7363
feat: add ios image
WoLewicki Sep 7, 2023
0e22dcf
feat: camera impl on ios
WoLewicki Sep 5, 2023
2de630e
fix: proper image import
WoLewicki Sep 13, 2023
ff461c7
feat: cherry-pick camera
WoLewicki Sep 13, 2023
90fe94a
feat: migrate Callout
WoLewicki Sep 13, 2023
3ed44df
fix: migrate js callout component
WoLewicki Sep 13, 2023
6ebfd0d
feat: migrate ImageSource
WoLewicki Sep 13, 2023
64e60b8
feat: migrate Light
WoLewicki Sep 13, 2023
2910429
feat: migrate NativeUserLocation
WoLewicki Sep 13, 2023
7797be2
feat: migrate RasterDemSource
WoLewicki Sep 13, 2023
022b515
feat: migrate Images
WoLewicki Sep 14, 2023
02425bb
feat: migrate VectorSource
WoLewicki Sep 14, 2023
ece3031
fix: small fix for MapView
WoLewicki Sep 15, 2023
643e7b1
feat: migrate PointAnnotation with adding a module for its method
WoLewicki Sep 15, 2023
ae89d39
feat: migrate ShapeSource with adding module for its methods
WoLewicki Sep 15, 2023
47ebfc7
fix: get rid of the need to use modular headers
WoLewicki Sep 19, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,51 @@ import com.facebook.react.uimanager.annotations.ReactProp
import com.facebook.react.bridge.ReadableMap
import com.facebook.react.common.MapBuilder
import com.facebook.react.uimanager.ThemedReactContext
import com.facebook.react.uimanager.ViewManagerDelegate
import com.facebook.react.viewmanagers.MBXMapViewManagerDelegate
import com.facebook.react.viewmanagers.MBXMarkerViewManagerDelegate
import com.facebook.react.viewmanagers.MBXMarkerViewManagerInterface
import com.mapbox.maps.ScreenCoordinate
import com.mapbox.maps.viewannotation.OnViewAnnotationUpdatedListener
import com.mapbox.maps.viewannotation.ViewAnnotationManager
import com.mapbox.rctmgl.components.mapview.RCTMGLMapView
import com.mapbox.rctmgl.components.mapview.RCTMGLMapViewManager

class RCTMGLMarkerViewManager(reactApplicationContext: ReactApplicationContext) :
AbstractEventEmitter<RCTMGLMarkerView?>(reactApplicationContext) {
AbstractEventEmitter<RCTMGLMarkerView>(reactApplicationContext), MBXMarkerViewManagerInterface<RCTMGLMarkerView> {
private val mDelegate: ViewManagerDelegate<RCTMGLMarkerView>

init {
mDelegate = MBXMarkerViewManagerDelegate<RCTMGLMarkerView, RCTMGLMarkerViewManager>(this)
}

override fun getDelegate(): ViewManagerDelegate<RCTMGLMarkerView> {
return mDelegate
}

override fun getName(): String {
return REACT_CLASS
}

@ReactProp(name = "coordinate")
fun setCoordinate(markerView: RCTMGLMarkerView, geoJSONStr: String?) {
override fun setCoordinate(markerView: RCTMGLMarkerView, geoJSONStr: String?) {
markerView.setCoordinate(toPointGeometry(geoJSONStr))
}

@ReactProp(name = "anchor")
fun setAnchor(markerView: RCTMGLMarkerView, map: ReadableMap) {
markerView.setAnchor(map.getDouble("x").toFloat(), map.getDouble("y").toFloat())
override fun setAnchor(markerView: RCTMGLMarkerView, map: ReadableMap?) {
if (map != null) {
markerView.setAnchor(map.getDouble("x").toFloat(), map.getDouble("y").toFloat())
}
}

@ReactProp(name = "allowOverlap")
fun setAllowOverlap(markerView: RCTMGLMarkerView, allowOverlap: Boolean) {
override fun setAllowOverlap(markerView: RCTMGLMarkerView, allowOverlap: Boolean) {
markerView.setAllowOverlap(allowOverlap)
}

@ReactProp(name = "isSelected")
fun setIsSelected(markerView: RCTMGLMarkerView, isSelected: Boolean) {
override fun setIsSelected(markerView: RCTMGLMarkerView, isSelected: Boolean) {
markerView.setIsSelected(isSelected)
}

Expand All @@ -50,7 +67,7 @@ class RCTMGLMarkerViewManager(reactApplicationContext: ReactApplicationContext)
}

companion object {
const val REACT_CLASS = "RCTMGLMarkerView"
const val REACT_CLASS = "MBXMarkerView"

fun markerViewContainerSizeFixer(mapView: RCTMGLMapView, viewAnnotationManager: ViewAnnotationManager) {
// see https://github.com/rnmapbox/maps/issues/2376
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* This file should be updated after modifying `MBXMarkerViewNativeComponent.ts`.
*
* @generated by codegen project: GeneratePropsJavaDelegate.js
*/

package com.facebook.react.viewmanagers;

import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.uimanager.BaseViewManagerDelegate;
import com.facebook.react.uimanager.BaseViewManagerInterface;

public class MBXMarkerViewManagerDelegate<T extends View, U extends BaseViewManagerInterface<T> & MBXMarkerViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
public MBXMarkerViewManagerDelegate(U viewManager) {
super(viewManager);
}
@Override
public void setProperty(T view, String propName, @Nullable Object value) {
switch (propName) {
case "coordinate":
mViewManager.setCoordinate(view, value == null ? null : (String) value);
break;
case "anchor":
mViewManager.setAnchor(view, (ReadableMap) value);
break;
case "allowOverlap":
mViewManager.setAllowOverlap(view, value == null ? false : (boolean) value);
break;
case "isSelected":
mViewManager.setIsSelected(view, value == null ? false : (boolean) value);
break;
default:
super.setProperty(view, propName, value);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* This file should be updated after modifying `MBXMarkerViewNativeComponent.ts`.
*
* @generated by codegen project: GeneratePropsJavaInterface.js
*/

package com.facebook.react.viewmanagers;

import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.bridge.ReadableMap;

public interface MBXMarkerViewManagerInterface<T extends View> {
void setCoordinate(T view, @Nullable String value);
void setAnchor(T view, @Nullable ReadableMap value);
void setAllowOverlap(T view, boolean value);
void setIsSelected(T view, boolean value);
}
9 changes: 0 additions & 9 deletions docs/Images.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,6 @@ any of the `Images` component of the Map.



### id

```tsx
string
```
FIX ME NO DESCRIPTION



### children

```tsx
Expand Down
7 changes: 0 additions & 7 deletions docs/docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -2114,13 +2114,6 @@
"default": "none",
"description": "Gets called when a Layer is trying to render an image whose key is not present in\nany of the `Images` component of the Map.\n*signature:*`(imageKey:string) => void`"
},
{
"name": "id",
"required": false,
"type": "string",
"default": "none",
"description": "FIX ME NO DESCRIPTION"
},
{
"name": "children",
"required": false,
Expand Down
13 changes: 6 additions & 7 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -426,15 +426,14 @@ PODS:
- React-perflogger (= 0.71.7)
- RNCAsyncStorage (1.19.2):
- React-Core

- rnmapbox-maps (10.0.14):
- MapboxMaps (~> 10.16.0)
- rnmapbox-maps (10.0.13-rc.1):
- MapboxMaps (~> 10.15.0)
- React
- React-Core
- rnmapbox-maps/DynamicLibrary (= 10.0.14)
- rnmapbox-maps/DynamicLibrary (= 10.0.13-rc.1)
- Turf
- rnmapbox-maps/DynamicLibrary (10.0.14):
- MapboxMaps (~> 10.16.0)
- rnmapbox-maps/DynamicLibrary (10.0.13-rc.1):
- MapboxMaps (~> 10.15.0)
- React
- React-Core
- Turf
Expand Down Expand Up @@ -676,7 +675,7 @@ SPEC CHECKSUMS:
React-runtimeexecutor: c5c89f8f543842dd864b63ded1b0bbb9c9445328
ReactCommon: dbfbe2f7f3c5ce4ce44f43f2fd0d5950d1eb67c5
RNCAsyncStorage: f57e929cd7757f2cb3dd8186d123c09e8281a1ad
rnmapbox-maps: c778f0cb59634946d44dfaa354de4e63552d10ff
rnmapbox-maps: 52784eea1f6d2d4e19c5040e600ac351beba3c33
RNScreens: b21dc57dfa2b710c30ec600786a3fc223b1b92e7
RNSVG: d7d7bc8229af3842c9cfc3a723c815a52cdd1105
RNVectorIcons: fcc2f6cb32f5735b586e66d14103a74ce6ad61f8
Expand Down
2 changes: 1 addition & 1 deletion fabricexample/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import {AppRegistry} from 'react-native';

import App from './App';
import App from './src/App';
import {name as appName} from './app.json';

AppRegistry.registerComponent(appName, () => App);
4 changes: 1 addition & 3 deletions fabricexample/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require Pod::Executable.execute_command('node', ['-p',
{paths: [process.argv[1]]},
)', __dir__]).strip

platform :ios, min_ios_version_supported
platform :ios, '13.4'
prepare_react_native_project!

# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.
Expand All @@ -30,8 +30,6 @@ end

ENV['RCT_NEW_ARCH_ENABLED'] = '1'

use_modular_headers!

target 'fabricexample' do
config = use_native_modules!

Expand Down
Loading