From 47b4a36ecc49490315faf83269a3584cc3b1db42 Mon Sep 17 00:00:00 2001 From: Nikolai R Kristiansen Date: Mon, 17 Jul 2017 22:16:14 +0200 Subject: [PATCH] Bump RN to 0.46 +deps - Fix npm test (jest) - Remove material-kit for now --- .babelrc | 4 +- .flowconfig | 8 +- __tests__/index.android.js | 4 +- __tests__/index.ios.js | 4 +- android/app/build.gradle | 12 +- android/app/proguard-rules.pro | 4 + .../main/java/com/dusken/MainApplication.java | 4 +- android/settings.gradle | 2 - index.android.js | 2 +- index.ios.js | 2 +- ios/Dusken.xcodeproj/project.pbxproj | 29 +- ios/DuskenTests/DuskenTests.m | 2 +- package.json | 23 +- src/modules/login/Login.js | 43 +- yarn.lock | 1580 ++++++++++------- 15 files changed, 1054 insertions(+), 669 deletions(-) diff --git a/.babelrc b/.babelrc index 8df53fe..a9ce136 100644 --- a/.babelrc +++ b/.babelrc @@ -1,3 +1,3 @@ { -"presets": ["react-native"] -} \ No newline at end of file + "presets": ["react-native"] +} diff --git a/.flowconfig b/.flowconfig index dcd5fd6..1dd3eff 100644 --- a/.flowconfig +++ b/.flowconfig @@ -26,8 +26,6 @@ emoji=true module.system=haste -experimental.strict_type_args=true - munge_underscores=true 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' @@ -36,12 +34,12 @@ suppress_type=$FlowIssue suppress_type=$FlowFixMe suppress_type=$FixMe -suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(4[0-0]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) -suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(4[0-0]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ +suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(4[0-7]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) +suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(4[0-7]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError unsafe.enable_getters_and_setters=true [version] -^0.40.0 +^0.47.0 diff --git a/__tests__/index.android.js b/__tests__/index.android.js index b49b908..403ca78 100644 --- a/__tests__/index.android.js +++ b/__tests__/index.android.js @@ -1,12 +1,12 @@ import 'react-native'; import React from 'react'; -import Index from '../index.android.js'; +import App from '../index.android.js'; // Note: test renderer must be required after react-native. import renderer from 'react-test-renderer'; it('renders correctly', () => { const tree = renderer.create( - + ); }); diff --git a/__tests__/index.ios.js b/__tests__/index.ios.js index ba7c5b5..975ca79 100644 --- a/__tests__/index.ios.js +++ b/__tests__/index.ios.js @@ -1,12 +1,12 @@ import 'react-native'; import React from 'react'; -import Index from '../index.ios.js'; +import App from '../index.ios.js'; // Note: test renderer must be required after react-native. import renderer from 'react-test-renderer'; it('renders correctly', () => { const tree = renderer.create( - + ); }); diff --git a/android/app/build.gradle b/android/app/build.gradle index f1a11c9..40916bf 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -33,6 +33,13 @@ import com.android.build.OutputFile * // bundleInPaidRelease: true, * // bundleInBeta: true, * + * // whether to disable dev mode in custom build variants (by default only disabled in release) + * // for example: to disable dev mode in the staging build type (if configured) + * devDisabledInStaging: true, + * // The configuration property can be in the following formats + * // 'devDisabledIn${productFlavor}${buildType}' + * // 'devDisabledIn${buildType}' + * * // the root of your project, i.e. where "package.json" lives * root: "../../", * @@ -58,7 +65,7 @@ import com.android.build.OutputFile * inputExcludes: ["android/**", "ios/**"], * * // override which node gets called and with what additional arguments - * nodeExecutableAndArgs: ["node"] + * nodeExecutableAndArgs: ["node"], * * // supply additional arguments to the packager * extraPackagerArgs: [] @@ -84,7 +91,7 @@ def enableProguardInReleaseBuilds = false android { compileSdkVersion 23 - buildToolsVersion "23.0.1" + buildToolsVersion "23.0.2" defaultConfig { applicationId "com.dusken" @@ -126,7 +133,6 @@ android { } dependencies { - compile project(':react-native-material-kit') compile fileTree(dir: "libs", include: ["*.jar"]) compile "com.android.support:appcompat-v7:23.0.1" compile "com.facebook.react:react-native:+" // From node_modules diff --git a/android/app/proguard-rules.pro b/android/app/proguard-rules.pro index 48361a9..6e8516c 100644 --- a/android/app/proguard-rules.pro +++ b/android/app/proguard-rules.pro @@ -50,6 +50,10 @@ -dontwarn com.facebook.react.** +# TextLayoutBuilder uses a non-public Android constructor within StaticLayout. +# See libs/proxy/src/main/java/com/facebook/fbui/textlayoutbuilder/proxy for details. +-dontwarn android.text.StaticLayout + # okhttp -keepattributes Signature diff --git a/android/app/src/main/java/com/dusken/MainApplication.java b/android/app/src/main/java/com/dusken/MainApplication.java index 6020c9b..84b8bc6 100644 --- a/android/app/src/main/java/com/dusken/MainApplication.java +++ b/android/app/src/main/java/com/dusken/MainApplication.java @@ -3,7 +3,6 @@ package com.dusken; import android.app.Application; import com.facebook.react.ReactApplication; -import com.github.xinthink.rnmk.ReactMaterialKitPackage; import com.facebook.react.ReactInstanceManager; import com.facebook.react.ReactNativeHost; import com.facebook.react.ReactPackage; @@ -24,8 +23,7 @@ public class MainApplication extends Application implements ReactApplication { @Override protected List getPackages() { return Arrays.asList( - new MainReactPackage(), - new ReactMaterialKitPackage() + new MainReactPackage() ); } }; diff --git a/android/settings.gradle b/android/settings.gradle index 6dad1e5..12e8dd8 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -1,5 +1,3 @@ rootProject.name = 'Dusken' -include ':react-native-material-kit' -project(':react-native-material-kit').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-material-kit/android') include ':app' diff --git a/index.android.js b/index.android.js index 5de4715..0576fff 100644 --- a/index.android.js +++ b/index.android.js @@ -7,7 +7,7 @@ import duskenApp from "./src/reducers"; let store = createStore(duskenApp); -class App extends Component { +export default class App extends Component { render() { return ( diff --git a/index.ios.js b/index.ios.js index 5de4715..0576fff 100644 --- a/index.ios.js +++ b/index.ios.js @@ -7,7 +7,7 @@ import duskenApp from "./src/reducers"; let store = createStore(duskenApp); -class App extends Component { +export default class App extends Component { render() { return ( diff --git a/ios/Dusken.xcodeproj/project.pbxproj b/ios/Dusken.xcodeproj/project.pbxproj index 6ec8410..d6e13b6 100644 --- a/ios/Dusken.xcodeproj/project.pbxproj +++ b/ios/Dusken.xcodeproj/project.pbxproj @@ -35,7 +35,6 @@ 2DCD954D1E0B4F2C00145EB5 /* DuskenTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* DuskenTests.m */; }; 5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */; }; 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; - D4A3DCAB98524B2A9E641E38 /* libRCTMaterialKit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 24CEE28BE13A496CB7E58C9F /* libRCTMaterialKit.a */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -255,8 +254,6 @@ 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAnimation.xcodeproj; path = "../node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj"; sourceTree = ""; }; 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = ""; }; 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = ""; }; - 1816E6C5FE584A80980C19AF /* RCTMaterialKit.xcodeproj */ = {isa = PBXFileReference; name = "RCTMaterialKit.xcodeproj"; path = "../node_modules/react-native-material-kit/iOS/RCTMaterialKit.xcodeproj"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; }; - 24CEE28BE13A496CB7E58C9F /* libRCTMaterialKit.a */ = {isa = PBXFileReference; name = "libRCTMaterialKit.a"; path = "libRCTMaterialKit.a"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -283,7 +280,6 @@ 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */, 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */, 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */, - D4A3DCAB98524B2A9E641E38 /* libRCTMaterialKit.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -450,7 +446,6 @@ 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */, 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */, 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */, - 1816E6C5FE584A80980C19AF /* RCTMaterialKit.xcodeproj */, ); name = Libraries; sourceTree = ""; @@ -878,7 +873,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "export NODE_BINARY=node\n../node_modules/react-native/packager/react-native-xcode.sh"; + shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh"; }; 2D02E4CB1E0B4B27006451C7 /* Bundle React Native Code And Images */ = { isa = PBXShellScriptBuildPhase; @@ -892,7 +887,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "export NODE_BINARY=node\n../node_modules/react-native/packager/react-native-xcode.sh"; + shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh"; }; /* End PBXShellScriptBuildPhase section */ @@ -978,7 +973,9 @@ TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Dusken.app/Dusken"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", - "\"$(SRCROOT)/$(TARGET_NAME)\"", + ); + HEADER_SEARCH_PATHS = ( + "$(inherited)", ); }; name = Debug; @@ -999,7 +996,9 @@ TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Dusken.app/Dusken"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", - "\"$(SRCROOT)/$(TARGET_NAME)\"", + ); + HEADER_SEARCH_PATHS = ( + "$(inherited)", ); }; name = Release; @@ -1019,6 +1018,9 @@ ); PRODUCT_NAME = Dusken; VERSIONING_SYSTEM = "apple-generic"; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + ); }; name = Debug; }; @@ -1036,6 +1038,9 @@ ); PRODUCT_NAME = Dusken; VERSIONING_SYSTEM = "apple-generic"; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + ); }; name = Release; }; @@ -1062,6 +1067,9 @@ SDKROOT = appletvos; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.2; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + ); }; name = Debug; }; @@ -1088,6 +1096,9 @@ SDKROOT = appletvos; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.2; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + ); }; name = Release; }; diff --git a/ios/DuskenTests/DuskenTests.m b/ios/DuskenTests/DuskenTests.m index de81b8c..540e314 100644 --- a/ios/DuskenTests/DuskenTests.m +++ b/ios/DuskenTests/DuskenTests.m @@ -37,7 +37,7 @@ - (void)testRendersWelcomeScreen { - UIViewController *vc = [[[[UIApplication sharedApplication] delegate] window] rootViewController]; + UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController]; NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; BOOL foundElement = NO; diff --git a/package.json b/package.json index 678e512..4ebb101 100644 --- a/package.json +++ b/package.json @@ -7,19 +7,22 @@ "test": "jest" }, "dependencies": { - "react": "16.0.0-alpha.6", - "react-native": "0.43.3", - "react-native-material-kit": "^0.4.1", - "react-redux": "^5.0.2", - "redux": "^3.6.0" + "prop-types": "^15.5.10", + "react": "16.0.0-alpha.12", + "react-native": "0.46.3", + "react-redux": "^5.0.5", + "redux": "^3.7.2" }, "devDependencies": { - "babel-jest": "18.0.0", - "babel-preset-react-native": "1.9.1", - "jest": "18.1.0", - "react-test-renderer": "~15.4.0-rc.4" + "babel-jest": "20.0.3", + "babel-preset-react-native": "1.9.2", + "jest": "20.0.4", + "react-test-renderer": "16.0.0-alpha.12" }, "jest": { - "preset": "react-native" + "preset": "react-native", + "transformIgnorePatterns": [ + "node_modules/(?!react-native|tcomb-form-native|apsl-react-native-button,react-native-device-info|react-clone-referenced-element)" + ] } } diff --git a/src/modules/login/Login.js b/src/modules/login/Login.js index d993147..5ec50c8 100644 --- a/src/modules/login/Login.js +++ b/src/modules/login/Login.js @@ -1,6 +1,5 @@ import React, { Component } from 'react'; -import { Image, StyleSheet, Text, View } from 'react-native'; -import { MKButton, MKColor, MKTextField } from 'react-native-material-kit'; +import {Button, Image, StyleSheet, Text, TextInput, View} from 'react-native'; import { loginStart } from "../../actions"; @@ -12,9 +11,7 @@ export default class Login extends Component { } } componentWillReceiveProps(nextProps) { - console.log("IN Login.componentWillReceiveProps"); - console.log(nextProps); - if(this.state.loggedIn != nextProps.loggedIn) { + if(this.state.loggedIn !== nextProps.loggedIn) { this.setState({ loggedIn: nextProps.loggedIn }) @@ -26,32 +23,29 @@ export default class Login extends Component { }; return ( - Chateau Neuf - The Norwegian Student Society + The Norwegian Student Society + Chateau Neuf - - - - Log in - + +