diff --git a/.babelrc b/.babelrc index 92b807c0..1380d479 100644 --- a/.babelrc +++ b/.babelrc @@ -38,7 +38,7 @@ "transform-react-inline-elements" ] }, - "docs-native-development": { + "development": { "presets": ["react-native"] } } diff --git a/.flowconfig b/.flowconfig index f56848d2..466bb117 100644 --- a/.flowconfig +++ b/.flowconfig @@ -15,8 +15,6 @@ # Ignore react and fbjs where there are overlaps, but don't ignore # anything that react-native relies on .*/node_modules/fbjs/lib/Map.js -.*/node_modules/fbjs/lib/fetch.js -.*/node_modules/fbjs/lib/ExecutionEnvironment.js .*/node_modules/fbjs/lib/ErrorUtils.js # Flow has a built-in definition for the 'react' module which we prefer to use @@ -48,6 +46,9 @@ # Ignore BUCK generated folders .*\.buckd/ +# Ignore RNPM +.*/local-cli/rnpm/.* + .*/node_modules/is-my-json-valid/test/.*\.json .*/node_modules/iconv-lite/encodings/tables/.*\.json .*/node_modules/y18n/test/.*\.json @@ -79,18 +80,20 @@ module.system=haste esproposal.class_static_fields=enable esproposal.class_instance_fields=enable +experimental.strict_type_args=true + munge_underscores=true module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub' -module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\)$' -> 'RelativeImageStub' +module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub' suppress_type=$FlowIssue suppress_type=$FlowFixMe suppress_type=$FixMe -suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(2[0-3]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) -suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(2[0-3]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ +suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(2[0-6]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) +suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(2[0-6]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy [version] -0.23.0 +^0.26.0 diff --git a/.gitignore b/.gitignore index ac6298fc..3a9917f2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,6 @@ docs/dist lib/ - # OSX # .DS_Store @@ -28,6 +27,7 @@ project.xcworkspace # Android/IJ # +*.iml .idea .gradle local.properties diff --git a/android/app/build.gradle b/android/app/build.gradle index 6258e62f..5539152a 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -55,7 +55,13 @@ import com.android.build.OutputFile * // date; if you have any other folders that you want to ignore for performance reasons (gradle * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ * // for example, you might want to remove it from here. - * inputExcludes: ["android/**", "ios/**"] + * inputExcludes: ["android/**", "ios/**"], + * + * // override which node gets called and with what additional arguments + * nodeExecutableAndArgs: ["node"] + * + * // supply additional arguments to the packager + * extraPackagerArgs: [] * ] */ diff --git a/android/app/proguard-rules.pro b/android/app/proguard-rules.pro index 347a13ce..48361a90 100644 --- a/android/app/proguard-rules.pro +++ b/android/app/proguard-rules.pro @@ -26,11 +26,14 @@ # See http://sourceforge.net/p/proguard/bugs/466/ -keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip -keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters +-keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip # Do not strip any method/class that is annotated with @DoNotStrip -keep @com.facebook.proguard.annotations.DoNotStrip class * +-keep @com.facebook.common.internal.DoNotStrip class * -keepclassmembers class * { @com.facebook.proguard.annotations.DoNotStrip *; + @com.facebook.common.internal.DoNotStrip *; } -keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * { @@ -51,9 +54,9 @@ -keepattributes Signature -keepattributes *Annotation* --keep class com.squareup.okhttp.** { *; } --keep interface com.squareup.okhttp.** { *; } --dontwarn com.squareup.okhttp.** +-keep class okhttp3.** { *; } +-keep interface okhttp3.** { *; } +-dontwarn okhttp3.** # okio diff --git a/android/build.gradle b/android/build.gradle index 403a0075..fcba4c58 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -18,7 +18,7 @@ allprojects { jcenter() maven { // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm - url "$projectDir/../../node_modules/react-native/android" + url "$rootDir/../node_modules/react-native/android" } } } diff --git a/docs/src/Demo/Demo2.js b/docs/src/Demo/Demo2.js index 70b10e85..70bf22fa 100644 --- a/docs/src/Demo/Demo2.js +++ b/docs/src/Demo/Demo2.js @@ -1,7 +1,9 @@ -import React, {Component} from 'react'; -import Tabs from 'material-ui/lib/tabs/tabs'; -import Tab from 'material-ui/lib/tabs/tab'; +import React from 'react'; +import Tabs from 'material-ui/Tabs/Tabs'; +import Tab from 'material-ui/Tabs/Tab'; import SwipeableViews from 'react-swipeable-views'; +import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider'; +import getMuiTheme from 'material-ui/styles/getMuiTheme'; const styles = { slideContainer: { @@ -24,7 +26,7 @@ const styles = { }; -class Demo2 extends Component { +class Demo2 extends React.Component { state = { index: 0, }; @@ -47,28 +49,30 @@ class Demo2 extends Component { } = this.state; return ( -
- - - - - - -
- slide n°1 -
-
- slide n°2 -
-
- slide n°3 -
-
-
+ +
+ + + + + + +
+ slide n°1 +
+
+ slide n°2 +
+
+ slide n°3 +
+
+
+
); } } diff --git a/ios/SwipeableViewsDocs.xcodeproj/project.pbxproj b/ios/SwipeableViewsDocs.xcodeproj/project.pbxproj index 3a96fc2d..b8349c4f 100644 --- a/ios/SwipeableViewsDocs.xcodeproj/project.pbxproj +++ b/ios/SwipeableViewsDocs.xcodeproj/project.pbxproj @@ -20,6 +20,7 @@ 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; + 140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; 146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; /* End PBXBuildFile section */ @@ -133,6 +134,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -575,10 +577,6 @@ isa = XCBuildConfiguration; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; - FRAMEWORK_SEARCH_PATHS = ( - "$(SDKROOT)/Developer/Library/Frameworks", - "$(inherited)", - ); GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", @@ -596,10 +594,6 @@ buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; COPY_PHASE_STRIP = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(SDKROOT)/Developer/Library/Frameworks", - "$(inherited)", - ); INFOPLIST_FILE = SwipeableViewsDocsTests/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 8.2; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; @@ -620,7 +614,10 @@ ); INFOPLIST_FILE = "SwipeableViewsDocs/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - OTHER_LDFLAGS = "-ObjC"; + OTHER_LDFLAGS = ( + "-ObjC", + "-lc++", + ); PRODUCT_NAME = SwipeableViewsDocs; }; name = Debug; @@ -636,7 +633,10 @@ ); INFOPLIST_FILE = "SwipeableViewsDocs/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - OTHER_LDFLAGS = "-ObjC"; + OTHER_LDFLAGS = ( + "-ObjC", + "-lc++", + ); PRODUCT_NAME = SwipeableViewsDocs; }; name = Release; diff --git a/ios/SwipeableViewsDocs/AppDelegate.m b/ios/SwipeableViewsDocs/AppDelegate.m index b8cfbc70..972df7b3 100644 --- a/ios/SwipeableViewsDocs/AppDelegate.m +++ b/ios/SwipeableViewsDocs/AppDelegate.m @@ -47,6 +47,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( moduleName:@"SwipeableViewsDocs" initialProperties:nil launchOptions:launchOptions]; + rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; UIViewController *rootViewController = [UIViewController new]; diff --git a/ios/SwipeableViewsDocs/Info.plist b/ios/SwipeableViewsDocs/Info.plist index 91963b26..e98ebb00 100644 --- a/ios/SwipeableViewsDocs/Info.plist +++ b/ios/SwipeableViewsDocs/Info.plist @@ -38,11 +38,17 @@ NSLocationWhenInUseUsageDescription - NSAppTransportSecurity - - - NSAllowsArbitraryLoads - - + NSAppTransportSecurity + + + NSExceptionDomains + + localhost + + NSTemporaryExceptionAllowsInsecureHTTPLoads + + + + diff --git a/package.json b/package.json index b94b6bd3..21293c72 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "build": "rm -rf lib && mkdir lib && NODE_ENV=release babel src --out-dir lib", "docs:browser:development": "cd docs && NODE_ENV=docs-browser-development babel-node webpack.js --dev", "docs:browser:production": "cd docs && NODE_ENV=docs-browser-production babel-node webpack.js", - "docs:native:development": "NODE_ENV=docs-native-development ./node_modules/react-native/packager/packager.sh start --reset-cache", + "docs:native:development": "NODE_ENV=docs-native-development node node_modules/react-native/local-cli/cli.js start --reset-cache --verbose", "prepublish": "npm run build" }, "repository": { @@ -69,14 +69,14 @@ "jsdom": "^9.2.1", "less": "^2.7.1", "less-loader": "^2.2.1", - "material-ui": "^0.14.0", + "material-ui": "^0.15.0", "minimist": "^1.2.0", "mocha": "^2.5.3", - "react": "^0.14.0", + "react": "^15.1.0", "react-addons-test-utils": "^15.1.0", "react-dom": "^0.14.0", "react-motion": "^0.4.4", - "react-native": "^0.25.1", + "react-native": "^0.28.0", "react-native-button": "^1.5.0", "react-transform-catch-errors": "^1.0.0", "react-transform-hmr": "^1.0.1",