Browse Source

update demo

iou90 5 years ago
parent
commit
e771167c66

+ 14
- 1
demo/.flowconfig View File

@@ -30,6 +30,19 @@ node_modules/react-native/flow-github/
30 30
 emoji=true
31 31
 
32 32
 module.system=haste
33
+module.system.haste.use_name_reducers=true
34
+# get basename
35
+module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1'
36
+# strip .js or .js.flow suffix
37
+module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1'
38
+# strip .ios suffix
39
+module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1'
40
+module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
41
+module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
42
+module.system.haste.paths.blacklist=.*/__tests__/.*
43
+module.system.haste.paths.blacklist=.*/__mocks__/.*
44
+module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
45
+module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/Libraries/.*
33 46
 
34 47
 munge_underscores=true
35 48
 
@@ -51,4 +64,4 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
51 64
 suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
52 65
 
53 66
 [version]
54
-^0.67.0
67
+^0.75.0

+ 0
- 12
demo/__tests__/App.js View File

@@ -1,12 +0,0 @@
1
-import 'react-native';
2
-import React from 'react';
3
-import App from '../App';
4
-
5
-// Note: test renderer must be required after react-native.
6
-import renderer from 'react-test-renderer';
7
-
8
-it('renders correctly', () => {
9
-  const tree = renderer.create(
10
-    <App />
11
-  );
12
-});

+ 5
- 5
demo/android/app/build.gradle View File

@@ -94,13 +94,13 @@ def enableSeparateBuildPerCPUArchitecture = false
94 94
 def enableProguardInReleaseBuilds = false
95 95
 
96 96
 android {
97
-    compileSdkVersion 26
98
-    buildToolsVersion "27.0.3"
97
+    compileSdkVersion rootProject.ext.compileSdkVersion
98
+    buildToolsVersion rootProject.ext.buildToolsVersion
99 99
 
100 100
     defaultConfig {
101 101
         applicationId "com.demo"
102
-        minSdkVersion 16
103
-        targetSdkVersion 26
102
+        minSdkVersion rootProject.ext.minSdkVersion
103
+        targetSdkVersion rootProject.ext.targetSdkVersion
104 104
         versionCode 1
105 105
         versionName "1.0"
106 106
         ndk {
@@ -139,7 +139,7 @@ android {
139 139
 dependencies {
140 140
     compile project(':react-native-autoheight-webview')
141 141
     compile fileTree(dir: "libs", include: ["*.jar"])
142
-    compile "com.android.support:appcompat-v7:26.1.0"
142
+    compile "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
143 143
     compile "com.facebook.react:react-native:+"  // From node_modules
144 144
 }
145 145
 

+ 0
- 53
demo/android/app/proguard-rules.pro View File

@@ -15,56 +15,3 @@
15 15
 #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 16
 #   public *;
17 17
 #}
18
-
19
-# Disabling obfuscation is useful if you collect stack traces from production crashes
20
-# (unless you are using a system that supports de-obfuscate the stack traces).
21
--dontobfuscate
22
-
23
-# React Native
24
-
25
-# Keep our interfaces so they can be used by other ProGuard rules.
26
-# See http://sourceforge.net/p/proguard/bugs/466/
27
--keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip
28
--keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters
29
--keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip
30
-
31
-# Do not strip any method/class that is annotated with @DoNotStrip
32
--keep @com.facebook.proguard.annotations.DoNotStrip class *
33
--keep @com.facebook.common.internal.DoNotStrip class *
34
--keepclassmembers class * {
35
-    @com.facebook.proguard.annotations.DoNotStrip *;
36
-    @com.facebook.common.internal.DoNotStrip *;
37
-}
38
-
39
--keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * {
40
-  void set*(***);
41
-  *** get*();
42
-}
43
-
44
--keep class * extends com.facebook.react.bridge.JavaScriptModule { *; }
45
--keep class * extends com.facebook.react.bridge.NativeModule { *; }
46
--keepclassmembers,includedescriptorclasses class * { native <methods>; }
47
--keepclassmembers class *  { @com.facebook.react.uimanager.UIProp <fields>; }
48
--keepclassmembers class *  { @com.facebook.react.uimanager.annotations.ReactProp <methods>; }
49
--keepclassmembers class *  { @com.facebook.react.uimanager.annotations.ReactPropGroup <methods>; }
50
-
51
--dontwarn com.facebook.react.**
52
-
53
-# TextLayoutBuilder uses a non-public Android constructor within StaticLayout.
54
-# See libs/proxy/src/main/java/com/facebook/fbui/textlayoutbuilder/proxy for details.
55
--dontwarn android.text.StaticLayout
56
-
57
-# okhttp
58
-
59
--keepattributes Signature
60
--keepattributes *Annotation*
61
--keep class okhttp3.** { *; }
62
--keep interface okhttp3.** { *; }
63
--dontwarn okhttp3.**
64
-
65
-# okio
66
-
67
--keep class sun.misc.Unsafe { *; }
68
--dontwarn java.nio.file.*
69
--dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
70
--dontwarn okio.**

+ 1
- 1
demo/android/app/src/main/AndroidManifest.xml View File

@@ -8,7 +8,7 @@
8 8
       android:name=".MainApplication"
9 9
       android:label="@string/app_name"
10 10
       android:icon="@mipmap/ic_launcher"
11
-      android:allowBackup="true"
11
+      android:allowBackup="false"
12 12
       android:theme="@style/AppTheme">
13 13
       <activity
14 14
         android:name=".MainActivity"

BIN
demo/android/app/src/main/res/mipmap-hdpi/ic_launcher.png View File


BIN
demo/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png View File


BIN
demo/android/app/src/main/res/mipmap-mdpi/ic_launcher.png View File


BIN
demo/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png View File


BIN
demo/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png View File


BIN
demo/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png View File


BIN
demo/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png View File


BIN
demo/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png View File


BIN
demo/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png View File


BIN
demo/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png View File


+ 11
- 2
demo/android/build.gradle View File

@@ -7,9 +7,10 @@ buildscript {
7 7
             url 'https://maven.google.com/'
8 8
             name 'Google'
9 9
         }
10
+        google()
10 11
     }
11 12
     dependencies {
12
-        classpath 'com.android.tools.build:gradle:2.2.3'
13
+        classpath 'com.android.tools.build:gradle:3.1.3'
13 14
 
14 15
         // NOTE: Do not place your application dependencies here; they belong
15 16
         // in the individual module build.gradle files
@@ -29,4 +30,12 @@ allprojects {
29 30
             name 'Google'
30 31
         }
31 32
     }
32
-}
33
+}
34
+
35
+ext {
36
+    buildToolsVersion = "27.0.3"
37
+    minSdkVersion = 16
38
+    compileSdkVersion = 26
39
+    targetSdkVersion = 26
40
+    supportLibVersion = "26.1.0"
41
+}

+ 2
- 1
demo/android/gradle/wrapper/gradle-wrapper.properties View File

@@ -1,5 +1,6 @@
1
+#Wed Jul 25 15:22:06 CST 2018
1 2
 distributionBase=GRADLE_USER_HOME
2 3
 distributionPath=wrapper/dists
3 4
 zipStoreBase=GRADLE_USER_HOME
4 5
 zipStorePath=wrapper/dists
5
-distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
6
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

+ 5
- 1
demo/index.js View File

@@ -1,7 +1,11 @@
1
+/** @format */
2
+
1 3
 'use strict'
2 4
 
3 5
 import { AppRegistry } from 'react-native';
4 6
 
5 7
 import Explorer from './App';
6 8
 
7
-AppRegistry.registerComponent('demo', () => Explorer);
9
+import {name as appName} from './app.json';
10
+
11
+AppRegistry.registerComponent(appName, () => Explorer);

+ 5
- 58
demo/ios/demo.xcodeproj/project.pbxproj View File

@@ -343,8 +343,6 @@
343 343
 		78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = "<group>"; };
344 344
 		832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = "<group>"; };
345 345
 		ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTBlob.xcodeproj; path = "../node_modules/react-native/Libraries/Blob/RCTBlob.xcodeproj"; sourceTree = "<group>"; };
346
-		B22DCF12CF304549B28FD63C /* demo.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = demo.xcodeproj; path = "../node_modules/react-native-autoheight-webview/demo/ios/demo.xcodeproj"; sourceTree = "<group>"; };
347
-		F6205ED3CE4F403ABCC50D34 /* libRCTActionSheet.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRCTActionSheet.a; sourceTree = "<group>"; };
348 346
 /* End PBXFileReference section */
349 347
 
350 348
 /* Begin PBXFrameworksBuildPhase section */
@@ -373,7 +371,6 @@
373 371
 				832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */,
374 372
 				00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */,
375 373
 				139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */,
376
-				4015A12E66A247F0B2F6AE09 /* libRCTActionSheet.a in Frameworks */,
377 374
 			);
378 375
 			runOnlyForDeploymentPostprocessing = 0;
379 376
 		};
@@ -527,14 +524,6 @@
527 524
 			name = Frameworks;
528 525
 			sourceTree = "<group>";
529 526
 		};
530
-		376DEA3F2043F3BA000FE890 /* Recovered References */ = {
531
-			isa = PBXGroup;
532
-			children = (
533
-				F6205ED3CE4F403ABCC50D34 /* libRCTActionSheet.a */,
534
-			);
535
-			name = "Recovered References";
536
-			sourceTree = "<group>";
537
-		};
538 527
 		5E91572E1DD0AC6500FF2AA8 /* Products */ = {
539 528
 			isa = PBXGroup;
540 529
 			children = (
@@ -568,7 +557,6 @@
568 557
 				832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */,
569 558
 				00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */,
570 559
 				139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */,
571
-				B22DCF12CF304549B28FD63C /* demo.xcodeproj */,
572 560
 			);
573 561
 			name = Libraries;
574 562
 			sourceTree = "<group>";
@@ -590,7 +578,6 @@
590 578
 				00E356EF1AD99517003FC87E /* demoTests */,
591 579
 				83CBBA001A601CBA00E9B192 /* Products */,
592 580
 				2D16E6871FA4F8E400B85C8A /* Frameworks */,
593
-				376DEA3F2043F3BA000FE890 /* Recovered References */,
594 581
 			);
595 582
 			indentWidth = 2;
596 583
 			sourceTree = "<group>";
@@ -698,7 +685,7 @@
698 685
 		83CBB9F71A601CBA00E9B192 /* Project object */ = {
699 686
 			isa = PBXProject;
700 687
 			attributes = {
701
-				LastUpgradeCheck = 610;
688
+				LastUpgradeCheck = 0610;
702 689
 				ORGANIZATIONNAME = Facebook;
703 690
 				TargetAttributes = {
704 691
 					00E356ED1AD99517003FC87E = {
@@ -1185,17 +1172,9 @@
1185 1172
 					"DEBUG=1",
1186 1173
 					"$(inherited)",
1187 1174
 				);
1188
-				HEADER_SEARCH_PATHS = (
1189
-					"$(inherited)",
1190
-					"$(SRCROOT)/../node_modules/react-native-autoheight-webview/demo/ios/demo",
1191
-				);
1192 1175
 				INFOPLIST_FILE = demoTests/Info.plist;
1193
-				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
1176
+				IPHONEOS_DEPLOYMENT_TARGET = 9.0;
1194 1177
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
1195
-				LIBRARY_SEARCH_PATHS = (
1196
-					"$(inherited)",
1197
-					"\"$(SRCROOT)/$(TARGET_NAME)\"",
1198
-				);
1199 1178
 				OTHER_LDFLAGS = (
1200 1179
 					"-ObjC",
1201 1180
 					"-lc++",
@@ -1210,17 +1189,9 @@
1210 1189
 			buildSettings = {
1211 1190
 				BUNDLE_LOADER = "$(TEST_HOST)";
1212 1191
 				COPY_PHASE_STRIP = NO;
1213
-				HEADER_SEARCH_PATHS = (
1214
-					"$(inherited)",
1215
-					"$(SRCROOT)/../node_modules/react-native-autoheight-webview/demo/ios/demo",
1216
-				);
1217 1192
 				INFOPLIST_FILE = demoTests/Info.plist;
1218
-				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
1193
+				IPHONEOS_DEPLOYMENT_TARGET = 9.0;
1219 1194
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
1220
-				LIBRARY_SEARCH_PATHS = (
1221
-					"$(inherited)",
1222
-					"\"$(SRCROOT)/$(TARGET_NAME)\"",
1223
-				);
1224 1195
 				OTHER_LDFLAGS = (
1225 1196
 					"-ObjC",
1226 1197
 					"-lc++",
@@ -1236,10 +1207,6 @@
1236 1207
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
1237 1208
 				CURRENT_PROJECT_VERSION = 1;
1238 1209
 				DEAD_CODE_STRIPPING = NO;
1239
-				HEADER_SEARCH_PATHS = (
1240
-					"$(inherited)",
1241
-					"$(SRCROOT)/../node_modules/react-native-autoheight-webview/demo/ios/demo",
1242
-				);
1243 1210
 				INFOPLIST_FILE = demo/Info.plist;
1244 1211
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
1245 1212
 				OTHER_LDFLAGS = (
@@ -1257,10 +1224,6 @@
1257 1224
 			buildSettings = {
1258 1225
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
1259 1226
 				CURRENT_PROJECT_VERSION = 1;
1260
-				HEADER_SEARCH_PATHS = (
1261
-					"$(inherited)",
1262
-					"$(SRCROOT)/../node_modules/react-native-autoheight-webview/demo/ios/demo",
1263
-				);
1264 1227
 				INFOPLIST_FILE = demo/Info.plist;
1265 1228
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
1266 1229
 				OTHER_LDFLAGS = (
@@ -1285,16 +1248,8 @@
1285 1248
 				DEBUG_INFORMATION_FORMAT = dwarf;
1286 1249
 				ENABLE_TESTABILITY = YES;
1287 1250
 				GCC_NO_COMMON_BLOCKS = YES;
1288
-				HEADER_SEARCH_PATHS = (
1289
-					"$(inherited)",
1290
-					"$(SRCROOT)/../node_modules/react-native-autoheight-webview/demo/ios/demo",
1291
-				);
1292 1251
 				INFOPLIST_FILE = "demo-tvOS/Info.plist";
1293 1252
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
1294
-				LIBRARY_SEARCH_PATHS = (
1295
-					"$(inherited)",
1296
-					"\"$(SRCROOT)/$(TARGET_NAME)\"",
1297
-				);
1298 1253
 				OTHER_LDFLAGS = (
1299 1254
 					"-ObjC",
1300 1255
 					"-lc++",
@@ -1319,16 +1274,8 @@
1319 1274
 				COPY_PHASE_STRIP = NO;
1320 1275
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
1321 1276
 				GCC_NO_COMMON_BLOCKS = YES;
1322
-				HEADER_SEARCH_PATHS = (
1323
-					"$(inherited)",
1324
-					"$(SRCROOT)/../node_modules/react-native-autoheight-webview/demo/ios/demo",
1325
-				);
1326 1277
 				INFOPLIST_FILE = "demo-tvOS/Info.plist";
1327 1278
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
1328
-				LIBRARY_SEARCH_PATHS = (
1329
-					"$(inherited)",
1330
-					"\"$(SRCROOT)/$(TARGET_NAME)\"",
1331
-				);
1332 1279
 				OTHER_LDFLAGS = (
1333 1280
 					"-ObjC",
1334 1281
 					"-lc++",
@@ -1425,7 +1372,7 @@
1425 1372
 				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
1426 1373
 				GCC_WARN_UNUSED_FUNCTION = YES;
1427 1374
 				GCC_WARN_UNUSED_VARIABLE = YES;
1428
-				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
1375
+				IPHONEOS_DEPLOYMENT_TARGET = 9.0;
1429 1376
 				MTL_ENABLE_DEBUG_INFO = YES;
1430 1377
 				ONLY_ACTIVE_ARCH = YES;
1431 1378
 				SDKROOT = iphoneos;
@@ -1460,7 +1407,7 @@
1460 1407
 				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
1461 1408
 				GCC_WARN_UNUSED_FUNCTION = YES;
1462 1409
 				GCC_WARN_UNUSED_VARIABLE = YES;
1463
-				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
1410
+				IPHONEOS_DEPLOYMENT_TARGET = 9.0;
1464 1411
 				MTL_ENABLE_DEBUG_INFO = NO;
1465 1412
 				SDKROOT = iphoneos;
1466 1413
 				VALIDATE_PRODUCT = YES;

+ 14
- 15
demo/ios/demo/Info.plist View File

@@ -24,21 +24,6 @@
24 24
 	<string>1</string>
25 25
 	<key>LSRequiresIPhoneOS</key>
26 26
 	<true/>
27
-	<key>NSAppTransportSecurity</key>
28
-	<dict>
29
-		<key>NSAllowsArbitraryLoads</key>
30
-		<true/>
31
-		<key>NSExceptionDomains</key>
32
-		<dict>
33
-			<key>localhost</key>
34
-			<dict>
35
-				<key>NSExceptionAllowsInsecureHTTPLoads</key>
36
-				<true/>
37
-			</dict>
38
-		</dict>
39
-	</dict>
40
-	<key>NSLocationWhenInUseUsageDescription</key>
41
-	<string></string>
42 27
 	<key>UILaunchStoryboardName</key>
43 28
 	<string>LaunchScreen</string>
44 29
 	<key>UIRequiredDeviceCapabilities</key>
@@ -53,5 +38,19 @@
53 38
 	</array>
54 39
 	<key>UIViewControllerBasedStatusBarAppearance</key>
55 40
 	<false/>
41
+	<key>NSLocationWhenInUseUsageDescription</key>
42
+	<string></string>
43
+	<key>NSAppTransportSecurity</key>
44
+	<!--See http://ste.vn/2015/06/10/configuring-app-transport-security-ios-9-osx-10-11/ -->
45
+	<dict>
46
+		<key>NSExceptionDomains</key>
47
+		<dict>
48
+			<key>localhost</key>
49
+			<dict>
50
+				<key>NSExceptionAllowsInsecureHTTPLoads</key>
51
+				<true/>
52
+			</dict>
53
+		</dict>
54
+	</dict>
56 55
 </dict>
57 56
 </plist>

+ 4213
- 5023
demo/package-lock.json
File diff suppressed because it is too large
View File


+ 5
- 5
demo/package.json View File

@@ -7,14 +7,14 @@
7 7
     "test": "jest"
8 8
   },
9 9
   "dependencies": {
10
-    "react": "^16.4.1",
11
-    "react-native": "^0.56.0",
10
+    "react": "16.4.1",
11
+    "react-native": "0.56.0",
12 12
     "react-native-autoheight-webview": "../"
13 13
   },
14 14
   "devDependencies": {
15
-    "babel-jest": "21.2.0",
16
-    "babel-preset-react-native": "^5.0.1",
17
-    "jest": "21.2.1",
15
+    "babel-jest": "23.4.0",
16
+    "babel-preset-react-native": "5.0.2",
17
+    "jest": "23.4.1",
18 18
     "react-test-renderer": "16.4.1"
19 19
   },
20 20
   "jest": {

+ 0
- 5082
demo/yarn.lock
File diff suppressed because it is too large
View File


+ 0
- 1099
yarn.lock
File diff suppressed because it is too large
View File