Skip to content

Commit

Permalink
[RN 0.40] Update iOS header imports and JS SyntheticEvent import for …
Browse files Browse the repository at this point in the history
…RN 0.40

React Native 0.40 (coming soon) changes the way its iOS headers should be imported. The headers are now under a directory called "React" that is in the compiler's include path, hence the new import style. On the JS side, RN 0.40 now peer-depends on React 15.4.x which moved SyntheticEvent from `react/lib` to deep inside `react-native`, so update that import as well.

Test Plan: Follow the setup instructions (https://github.com/airbnb/react-native-maps/blob/master/docs/examples-setup.md) and run the explorer app (notably verify that it compiles).
  • Loading branch information
ide committed Jan 5, 2017
1 parent 1e71a21 commit d274eb4
Show file tree
Hide file tree
Showing 58 changed files with 146 additions and 148 deletions.
3 changes: 2 additions & 1 deletion example/examples/EventListener.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import React, { PropTypes } from 'react';
import SyntheticEvent from 'react/lib/SyntheticEvent';
import {
StyleSheet,
View,
Text,
Dimensions,
ScrollView,
} from 'react-native';
// eslint-disable-next-line max-len
import SyntheticEvent from 'react-native/Libraries/Renderer/src/renderers/shared/stack/event/SyntheticEvent';
import MapView from 'react-native-maps';
import PriceMarker from './PriceMarker';

Expand Down
2 changes: 1 addition & 1 deletion example/ios/AirMapsExplorer/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#import "AppDelegate.h"

#import "RCTRootView.h"
#import <React/RCTRootView.h>

#import <GoogleMaps/GoogleMaps.h>

Expand Down
4 changes: 2 additions & 2 deletions example/ios/AirMapsExplorerTests/AirMapsExplorerTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#import <UIKit/UIKit.h>
#import <XCTest/XCTest.h>

#import "RCTLog.h"
#import "RCTRootView.h"
#import <React/RCTLog.h>
#import <React/RCTRootView.h>

#define TIMEOUT_SECONDS 240
#define TEXT_TO_LOOK_FOR @"Welcome to React Native!"
Expand Down
6 changes: 3 additions & 3 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"dev": "concurrently 'npm run watch' 'npm run packager'"
},
"dependencies": {
"react": "^15.3.1",
"react-native": "^0.35.0",
"react-native-maps": "../"
"react": "~15.4.1",
"react-native": "^0.40.0",
"react-native-maps": "file:../"
},
"devDependencies": {
"concurrently": "^2.2.0",
Expand Down
2 changes: 1 addition & 1 deletion ios/AirGoogleMaps/AIRGMSMarker.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//

#import <GoogleMaps/GoogleMaps.h>
#import "UIView+React.h"
#import <React/UIView+React.h>

@class AIRGoogleMapMarker;

Expand Down
4 changes: 2 additions & 2 deletions ios/AirGoogleMaps/AIRGoogleMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
//

#import <UIKit/UIKit.h>
#import "RCTComponent.h"
#import <React/RCTComponent.h>
#import <React/RCTConvert+MapKit.h>
#import <GoogleMaps/GoogleMaps.h>
#import <MapKit/MapKit.h>
#import "RCTConvert+MapKit.h"
#import "AIRGMSMarker.h"

@interface AIRGoogleMap : GMSMapView
Expand Down
4 changes: 2 additions & 2 deletions ios/AirGoogleMaps/AIRGoogleMap.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#import "AIRGoogleMapUrlTile.h"
#import <GoogleMaps/GoogleMaps.h>
#import <MapKit/MapKit.h>
#import "RCTConvert+MapKit.h"
#import "UIView+React.h"
#import <React/RCTConvert+MapKit.h>
#import <React/UIView+React.h>

id regionAsJSON(MKCoordinateRegion region) {
return @{
Expand Down
2 changes: 1 addition & 1 deletion ios/AirGoogleMaps/AIRGoogleMapCallout.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//

#import <UIKit/UIKit.h>
#import "RCTView.h"
#import <React/RCTView.h>

@interface AIRGoogleMapCallout : UIView
@property (nonatomic, assign) BOOL tooltip;
Expand Down
6 changes: 3 additions & 3 deletions ios/AirGoogleMaps/AIRGoogleMapCallout.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
//

#import "AIRGoogleMapCallout.h"
#import "RCTUtils.h"
#import "RCTView.h"
#import "RCTBridge.h"
#import <React/RCTUtils.h>
#import <React/RCTView.h>
#import <React/RCTBridge.h>

@implementation AIRGoogleMapCallout
@end
2 changes: 1 addition & 1 deletion ios/AirGoogleMaps/AIRGoogleMapCalloutManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by Gil Birman on 9/6/16.
//
//
#import "RCTViewManager.h"
#import <React/RCTViewManager.h>

@interface AIRGoogleMapCalloutManager : RCTViewManager

Expand Down
2 changes: 1 addition & 1 deletion ios/AirGoogleMaps/AIRGoogleMapCalloutManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#import "AIRGoogleMapCalloutManager.h"
#import "AIRGoogleMapCallout.h"
#import "RCTView.h"
#import <React/RCTView.h>

@implementation AIRGoogleMapCalloutManager
RCT_EXPORT_MODULE()
Expand Down
2 changes: 1 addition & 1 deletion ios/AirGoogleMaps/AIRGoogleMapCircle.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#import <UIKit/UIKit.h>
#import "AIRGoogleMapCircle.h"
#import <GoogleMaps/GoogleMaps.h>
#import "RCTUtils.h"
#import <React/RCTUtils.h>

@implementation AIRGoogleMapCircle

Expand Down
2 changes: 1 addition & 1 deletion ios/AirGoogleMaps/AIRGoogleMapCircleManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Created by Nick Italiano on 10/24/16.
//

#import "RCTViewManager.h"
#import <React/RCTViewManager.h>

@interface AIRGoogleMapCircleManager : RCTViewManager

Expand Down
4 changes: 2 additions & 2 deletions ios/AirGoogleMaps/AIRGoogleMapCircleManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

#import "AIRGoogleMapCircleManager.h"
#import "AIRGoogleMapCircle.h"
#import "RCTBridge.h"
#import "UIView+React.h"
#import <React/RCTBridge.h>
#import <React/UIView+React.h>

@interface AIRGoogleMapCircleManager()

Expand Down
2 changes: 1 addition & 1 deletion ios/AirGoogleMaps/AIRGoogleMapManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by Gil Birman on 9/1/16.
//

#import "RCTViewManager.h"
#import <React/RCTViewManager.h>

@interface AIRGoogleMapManager : RCTViewManager

Expand Down
18 changes: 9 additions & 9 deletions ios/AirGoogleMaps/AIRGoogleMapManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@


#import "AIRGoogleMapManager.h"
#import "RCTViewManager.h"
#import "RCTBridge.h"
#import "RCTUIManager.h"
#import "RCTConvert+CoreLocation.h"
#import "RCTConvert+MapKit.h"
#import <React/RCTViewManager.h>
#import <React/RCTBridge.h>
#import <React/RCTUIManager.h>
#import <React/RCTConvert+CoreLocation.h>
#import <React/RCTConvert+MapKit.h>
#import <React/RCTEventDispatcher.h>
#import <React/RCTViewManager.h>
#import <React/RCTConvert.h>
#import <React/UIView+React.h>
#import "RCTConvert+GMSMapViewType.h"
#import "RCTEventDispatcher.h"
#import "AIRGoogleMap.h"
#import "UIView+React.h"
#import "AIRMapMarker.h"
#import "RCTViewManager.h"
#import "RCTConvert.h"
#import "AIRMapPolyline.h"
#import "AIRMapPolygon.h"
#import "AIRMapCircle.h"
Expand Down
2 changes: 1 addition & 1 deletion ios/AirGoogleMaps/AIRGoogleMapMarker.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
//

#import <GoogleMaps/GoogleMaps.h>
#import <React/RCTBridge.h>
#import "AIRGMSMarker.h"
#import "RCTBridge.h"
#import "AIRGoogleMap.h"
#import "AIRGoogleMapCallout.h"

Expand Down
8 changes: 4 additions & 4 deletions ios/AirGoogleMaps/AIRGoogleMapMarker.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

#import "AIRGoogleMapMarker.h"
#import <GoogleMaps/GoogleMaps.h>
#import <React/RCTImageLoader.h>
#import <React/RCTUtils.h>
#import "AIRGMSMarker.h"
#import "AIRGoogleMapCallout.h"
#import "RCTImageLoader.h"
#import "RCTUtils.h"
#import "DummyView.h"

CGRect unionRect(CGRect a, CGRect b) {
Expand Down Expand Up @@ -186,14 +186,14 @@ - (void)setImageSrc:(NSString *)imageSrc
if (_iconImageView) [_iconImageView removeFromSuperview];
return;
}

if (!_iconImageView) {
// prevent glitch with marker (cf. https://github.com/airbnb/react-native-maps/issues/738)
UIImageView *empyImageView = [[UIImageView alloc] init];
_iconImageView = empyImageView;
[self iconViewInsertSubview:_iconImageView atIndex:0];
}

_reloadImageCancellationBlock = [_bridge.imageLoader loadImageWithURLRequest:[RCTConvert NSURLRequest:_imageSrc]
size:self.bounds.size
scale:RCTScreenScale()
Expand Down
2 changes: 1 addition & 1 deletion ios/AirGoogleMaps/AIRGoogleMapMarkerManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by Gil Birman on 9/2/16.
//

#import "RCTViewManager.h"
#import <React/RCTViewManager.h>

@interface AIRGoogleMapMarkerManager : RCTViewManager

Expand Down
4 changes: 2 additions & 2 deletions ios/AirGoogleMaps/AIRGoogleMapMarkerManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#import "AIRGoogleMapMarkerManager.h"
#import "AIRGoogleMapMarker.h"
#import <MapKit/MapKit.h>
#import "RCTConvert+MapKit.h"
#import "RCTUIManager.h"
#import <React/RCTConvert+MapKit.h>
#import <React/RCTUIManager.h>

@implementation AIRGoogleMapMarkerManager

Expand Down
2 changes: 1 addition & 1 deletion ios/AirGoogleMaps/AIRGoogleMapPolygonManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Created by Nick Italiano on 10/22/16.
//

#import "RCTViewManager.h"
#import <React/RCTViewManager.h>

@interface AIRGoogleMapPolygonManager : RCTViewManager

Expand Down
12 changes: 6 additions & 6 deletions ios/AirGoogleMaps/AIRGoogleMapPolygonManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
//
#import "AIRGoogleMapPolygonManager.h"

#import "RCTBridge.h"
#import "RCTConvert.h"
#import "RCTConvert+CoreLocation.h"
#import <React/RCTBridge.h>
#import <React/RCTConvert.h>
#import <React/RCTConvert+CoreLocation.h>
#import <React/RCTEventDispatcher.h>
#import <React/RCTViewManager.h>
#import <React/UIView+React.h>
#import "RCTConvert+MoreMapKit.h"
#import "RCTEventDispatcher.h"
#import "UIView+React.h"
#import "RCTViewManager.h"
#import "AIRGoogleMapPolygon.h"

@interface AIRGoogleMapPolygonManager()
Expand Down
2 changes: 1 addition & 1 deletion ios/AirGoogleMaps/AIRGoogleMapPolyline.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#import "AIRGoogleMapMarker.h"
#import "AIRGoogleMapMarkerManager.h"
#import <GoogleMaps/GoogleMaps.h>
#import "RCTUtils.h"
#import <React/RCTUtils.h>

@implementation AIRGoogleMapPolyline

Expand Down
2 changes: 1 addition & 1 deletion ios/AirGoogleMaps/AIRGoogleMapPolylineManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Created by Nick Italiano on 10/22/16.
//

#import "RCTViewManager.h"
#import <React/RCTViewManager.h>

@interface AIRGoogleMapPolylineManager : RCTViewManager

Expand Down
12 changes: 6 additions & 6 deletions ios/AirGoogleMaps/AIRGoogleMapPolylineManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@

#import "AIRGoogleMapPolylineManager.h"

#import "RCTBridge.h"
#import "RCTConvert.h"
#import "RCTConvert+CoreLocation.h"
#import <React/RCTBridge.h>
#import <React/RCTConvert.h>
#import <React/RCTConvert+CoreLocation.h>
#import <React/RCTEventDispatcher.h>
#import <React/RCTViewManager.h>
#import <React/UIView+React.h>
#import "RCTConvert+MoreMapKit.h"
#import "RCTEventDispatcher.h"
#import "UIView+React.h"
#import "RCTViewManager.h"
#import "AIRGoogleMapPolyline.h"

@interface AIRGoogleMapPolylineManager()
Expand Down
2 changes: 1 addition & 1 deletion ios/AirGoogleMaps/AIRGoogleMapUrlTileManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//

#import <Foundation/Foundation.h>
#import "RCTViewManager.h"
#import <React/RCTViewManager.h>

@interface AIRGoogleMapUrlTileManager : RCTViewManager
@end
2 changes: 1 addition & 1 deletion ios/AirGoogleMaps/RCTConvert+GMSMapViewType.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#import <Foundation/Foundation.h>
#import <GoogleMaps/GoogleMaps.h>
#import "RCTConvert.h"
#import <React/RCTConvert.h>

@interface RCTConvert (GMSMapViewType)

Expand Down
2 changes: 1 addition & 1 deletion ios/AirGoogleMaps/RCTConvert+GMSMapViewType.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#import "RCTConvert+GMSMapViewType.h"
#import <GoogleMaps/GoogleMaps.h>
#import "RCTConvert.h"
#import <React/RCTConvert.h>

@implementation RCTConvert (GMSMapViewType)
RCT_ENUM_CONVERTER(GMSMapViewType,
Expand Down
4 changes: 2 additions & 2 deletions ios/AirMaps/AIRMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#import <MapKit/MapKit.h>
#import <UIKit/UIKit.h>

#import "RCTConvert+MapKit.h"
#import "RCTComponent.h"
#import <React/RCTConvert+MapKit.h>
#import <React/RCTComponent.h>
#import "SMCalloutView.h"

extern const CLLocationDegrees AIRMapDefaultSpan;
Expand Down
4 changes: 2 additions & 2 deletions ios/AirMaps/AIRMap.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

#import "AIRMap.h"

#import "RCTEventDispatcher.h"
#import <React/RCTEventDispatcher.h>
#import <React/UIView+React.h>
#import "AIRMapMarker.h"
#import "UIView+React.h"
#import "AIRMapPolyline.h"
#import "AIRMapPolygon.h"
#import "AIRMapCircle.h"
Expand Down
2 changes: 1 addition & 1 deletion ios/AirMaps/AIRMapCallout.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//

#import <Foundation/Foundation.h>
#import "RCTView.h"
#import <React/RCTView.h>


@interface AIRMapCallout : RCTView
Expand Down
2 changes: 1 addition & 1 deletion ios/AirMaps/AIRMapCalloutManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Copyright (c) 2015 Facebook. All rights reserved.
//

#import "RCTViewManager.h"
#import <React/RCTViewManager.h>


@interface AIRMapCalloutManager : RCTViewManager
Expand Down
Loading

0 comments on commit d274eb4

Please sign in to comment.