Преглед на файлове

remove createJSModules method in AutoHeightWebViewPackage.java to support react native 0.47; bump version to 0.3.2; Update README.md;

iou90 преди 7 години
родител
ревизия
6c33490611

+ 7
- 3
README.md Целия файл

@@ -1,11 +1,15 @@
1 1
 # react-native-autoheight-webview
2 2
 An auto height webview for React Native.
3 3
 
4
-Cause of moving View.propTypes to ViewPropTypes in React Naitve 0.44 (https://github.com/facebook/react-native/releases) and PropTypes has been moved to a separate package in React 16 (https://facebook.github.io/react/blog/2017/04/07/react-v15.5.0.html#migrating-from-react.proptypes), please install react-native-autoheight-webview 0.2.3 for the project with rn version lower than 0.44.
4
+Cause of removing unused createJSModules calls in React Naitve 0.47 (https://github.com/facebook/react-native/releases/tag/v0.47.2), please install react-native-autoheight-webview 0.3.1 for the project with 0.44 <= rn < 0.47.
5 5
 
6
-`npm install react-native-autoheight-webview --save`
6
+Cause of moving View.propTypes to ViewPropTypes in React Naitve 0.44 (https://github.com/facebook/react-native/releases/tag/v0.44.3) and PropTypes has been moved to a separate package in React 16 (https://facebook.github.io/react/blog/2017/04/07/react-v15.5.0.html#migrating-from-react.proptypes), please install react-native-autoheight-webview 0.2.3 for the project with rn < 0.44.
7 7
 
8
-`npm install react-native-autoheight-webview@0.2.3 --save` (if the project with rn version lower than 0.44)
8
+`npm install react-native-autoheight-webview --save` (rn >= 0.47)
9
+
10
+`npm install react-native-autoheight-webview@0.3.1 --save` (0.44 <= rn < 0.47)
11
+
12
+`npm install react-native-autoheight-webview@0.2.3 --save` (rn < 0.44)
9 13
 
10 14
 ## android
11 15
 `react-native link react-native-autoheight-webview`

+ 0
- 5
android/src/main/java/com/dscj/autoheightwebview/AutoHeightWebViewPackage.java Целия файл

@@ -22,9 +22,4 @@ public class AutoHeightWebViewPackage implements ReactPackage {
22 22
                 new AutoHeightWebViewManager()
23 23
         );
24 24
     }
25
-
26
-    @Override
27
-    public List<Class<? extends JavaScriptModule>> createJSModules() {
28
-        return Arrays.asList();
29
-    }
30 25
 }

+ 3
- 5
demo/.flowconfig Целия файл

@@ -26,8 +26,6 @@ emoji=true
26 26
 
27 27
 module.system=haste
28 28
 
29
-experimental.strict_type_args=true
30
-
31 29
 munge_underscores=true
32 30
 
33 31
 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
36 34
 suppress_type=$FlowFixMe
37 35
 suppress_type=$FixMe
38 36
 
39
-suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(4[0-5]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
40
-suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(4[0-5]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
37
+suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(4[0-9]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
38
+suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(4[0-9]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
41 39
 suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
42 40
 suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
43 41
 
44 42
 unsafe.enable_getters_and_setters=true
45 43
 
46 44
 [version]
47
-^0.45.0
45
+^0.49.1

+ 8
- 1
demo/android/app/build.gradle Целия файл

@@ -33,6 +33,13 @@ import com.android.build.OutputFile
33 33
  *   // bundleInPaidRelease: true,
34 34
  *   // bundleInBeta: true,
35 35
  *
36
+ *   // whether to disable dev mode in custom build variants (by default only disabled in release)
37
+ *   // for example: to disable dev mode in the staging build type (if configured)
38
+ *   devDisabledInStaging: true,
39
+ *   // The configuration property can be in the following formats
40
+ *   //         'devDisabledIn${productFlavor}${buildType}'
41
+ *   //         'devDisabledIn${buildType}'
42
+ *
36 43
  *   // the root of your project, i.e. where "package.json" lives
37 44
  *   root: "../../",
38 45
  *
@@ -58,7 +65,7 @@ import com.android.build.OutputFile
58 65
  *   inputExcludes: ["android/**", "ios/**"],
59 66
  *
60 67
  *   // override which node gets called and with what additional arguments
61
- *   nodeExecutableAndArgs: ["node"]
68
+ *   nodeExecutableAndArgs: ["node"],
62 69
  *
63 70
  *   // supply additional arguments to the packager
64 71
  *   extraPackagerArgs: []

+ 4
- 0
demo/android/app/proguard-rules.pro Целия файл

@@ -50,6 +50,10 @@
50 50
 
51 51
 -dontwarn com.facebook.react.**
52 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
+
53 57
 # okhttp
54 58
 
55 59
 -keepattributes Signature

+ 7
- 44
demo/ios/demo.xcodeproj/project.pbxproj Целия файл

@@ -25,7 +25,7 @@
25 25
 		2D02E4BC1E0B4A80006451C7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
26 26
 		2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
27 27
 		2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
28
-		2D02E4C21E0B4AEC006451C7 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157351DD0AC6500FF2AA8 /* libRCTAnimation.a */; };
28
+		2D02E4C21E0B4AEC006451C7 /* libRCTAnimation-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157351DD0AC6500FF2AA8 /* libRCTAnimation-tvOS.a */; };
29 29
 		2D02E4C31E0B4AEC006451C7 /* libRCTImage-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E841DF850E9000B6D8A /* libRCTImage-tvOS.a */; };
30 30
 		2D02E4C41E0B4AEC006451C7 /* libRCTLinking-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E881DF850E9000B6D8A /* libRCTLinking-tvOS.a */; };
31 31
 		2D02E4C51E0B4AEC006451C7 /* libRCTNetwork-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E8C1DF850E9000B6D8A /* libRCTNetwork-tvOS.a */; };
@@ -109,20 +109,6 @@
109 109
 			remoteGlobalIDString = 2D02E47A1E0B4A5D006451C7;
110 110
 			remoteInfo = "demo-tvOS";
111 111
 		};
112
-		374FFF7E1F59B02A00B97131 /* PBXContainerItemProxy */ = {
113
-			isa = PBXContainerItemProxy;
114
-			containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
115
-			proxyType = 2;
116
-			remoteGlobalIDString = 139D7ECE1E25DB7D00323FB7;
117
-			remoteInfo = "third-party";
118
-		};
119
-		374FFF801F59B02A00B97131 /* PBXContainerItemProxy */ = {
120
-			isa = PBXContainerItemProxy;
121
-			containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
122
-			proxyType = 2;
123
-			remoteGlobalIDString = 139D7E881E25C6D100323FB7;
124
-			remoteInfo = "double-conversion";
125
-		};
126 112
 		3DAD3E831DF850E9000B6D8A /* PBXContainerItemProxy */ = {
127 113
 			isa = PBXContainerItemProxy;
128 114
 			containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */;
@@ -303,7 +289,7 @@
303 289
 			buildActionMask = 2147483647;
304 290
 			files = (
305 291
 				2D02E4C91E0B4AEC006451C7 /* libReact.a in Frameworks */,
306
-				2D02E4C21E0B4AEC006451C7 /* libRCTAnimation.a in Frameworks */,
292
+				2D02E4C21E0B4AEC006451C7 /* libRCTAnimation-tvOS.a in Frameworks */,
307 293
 				2D02E4C31E0B4AEC006451C7 /* libRCTImage-tvOS.a in Frameworks */,
308 294
 				2D02E4C41E0B4AEC006451C7 /* libRCTLinking-tvOS.a in Frameworks */,
309 295
 				2D02E4C51E0B4AEC006451C7 /* libRCTNetwork-tvOS.a in Frameworks */,
@@ -425,8 +411,6 @@
425 411
 				3DAD3EAB1DF850E9000B6D8A /* libcxxreact.a */,
426 412
 				3DAD3EAD1DF850E9000B6D8A /* libjschelpers.a */,
427 413
 				3DAD3EAF1DF850E9000B6D8A /* libjschelpers.a */,
428
-				374FFF7F1F59B02A00B97131 /* libthird-party.a */,
429
-				374FFF811F59B02A00B97131 /* libdouble-conversion.a */,
430 414
 			);
431 415
 			name = Products;
432 416
 			sourceTree = "<group>";
@@ -435,7 +419,7 @@
435 419
 			isa = PBXGroup;
436 420
 			children = (
437 421
 				5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */,
438
-				5E9157351DD0AC6500FF2AA8 /* libRCTAnimation.a */,
422
+				5E9157351DD0AC6500FF2AA8 /* libRCTAnimation-tvOS.a */,
439 423
 			);
440 424
 			name = Products;
441 425
 			sourceTree = "<group>";
@@ -587,9 +571,6 @@
587 571
 						CreatedOnToolsVersion = 6.2;
588 572
 						TestTargetID = 13B07F861A680F5B00A75B9A;
589 573
 					};
590
-					13B07F861A680F5B00A75B9A = {
591
-						ProvisioningStyle = Manual;
592
-					};
593 574
 					2D02E47A1E0B4A5D006451C7 = {
594 575
 						CreatedOnToolsVersion = 8.2.1;
595 576
 						ProvisioningStyle = Automatic;
@@ -725,20 +706,6 @@
725 706
 			remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */;
726 707
 			sourceTree = BUILT_PRODUCTS_DIR;
727 708
 		};
728
-		374FFF7F1F59B02A00B97131 /* libthird-party.a */ = {
729
-			isa = PBXReferenceProxy;
730
-			fileType = archive.ar;
731
-			path = "libthird-party.a";
732
-			remoteRef = 374FFF7E1F59B02A00B97131 /* PBXContainerItemProxy */;
733
-			sourceTree = BUILT_PRODUCTS_DIR;
734
-		};
735
-		374FFF811F59B02A00B97131 /* libdouble-conversion.a */ = {
736
-			isa = PBXReferenceProxy;
737
-			fileType = archive.ar;
738
-			path = "libdouble-conversion.a";
739
-			remoteRef = 374FFF801F59B02A00B97131 /* PBXContainerItemProxy */;
740
-			sourceTree = BUILT_PRODUCTS_DIR;
741
-		};
742 709
 		3DAD3E841DF850E9000B6D8A /* libRCTImage-tvOS.a */ = {
743 710
 			isa = PBXReferenceProxy;
744 711
 			fileType = archive.ar;
@@ -837,10 +804,10 @@
837 804
 			remoteRef = 5E9157321DD0AC6500FF2AA8 /* PBXContainerItemProxy */;
838 805
 			sourceTree = BUILT_PRODUCTS_DIR;
839 806
 		};
840
-		5E9157351DD0AC6500FF2AA8 /* libRCTAnimation.a */ = {
807
+		5E9157351DD0AC6500FF2AA8 /* libRCTAnimation-tvOS.a */ = {
841 808
 			isa = PBXReferenceProxy;
842 809
 			fileType = archive.ar;
843
-			path = libRCTAnimation.a;
810
+			path = "libRCTAnimation-tvOS.a";
844 811
 			remoteRef = 5E9157341DD0AC6500FF2AA8 /* PBXContainerItemProxy */;
845 812
 			sourceTree = BUILT_PRODUCTS_DIR;
846 813
 		};
@@ -907,7 +874,7 @@
907 874
 			);
908 875
 			runOnlyForDeploymentPostprocessing = 0;
909 876
 			shellPath = /bin/sh;
910
-			shellScript = "export NODE_BINARY=node\n../node_modules/react-native/packager/react-native-xcode.sh";
877
+			shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh";
911 878
 		};
912 879
 		2D02E4CB1E0B4B27006451C7 /* Bundle React Native Code And Images */ = {
913 880
 			isa = PBXShellScriptBuildPhase;
@@ -921,7 +888,7 @@
921 888
 			);
922 889
 			runOnlyForDeploymentPostprocessing = 0;
923 890
 			shellPath = /bin/sh;
924
-			shellScript = "export NODE_BINARY=node\n../node_modules/react-native/packager/react-native-xcode.sh";
891
+			shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh";
925 892
 		};
926 893
 /* End PBXShellScriptBuildPhase section */
927 894
 
@@ -1031,7 +998,6 @@
1031 998
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
1032 999
 				CURRENT_PROJECT_VERSION = 1;
1033 1000
 				DEAD_CODE_STRIPPING = NO;
1034
-				DEVELOPMENT_TEAM = "";
1035 1001
 				INFOPLIST_FILE = demo/Info.plist;
1036 1002
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
1037 1003
 				OTHER_LDFLAGS = (
@@ -1040,7 +1006,6 @@
1040 1006
 					"-lc++",
1041 1007
 				);
1042 1008
 				PRODUCT_NAME = demo;
1043
-				PROVISIONING_PROFILE_SPECIFIER = "";
1044 1009
 				VERSIONING_SYSTEM = "apple-generic";
1045 1010
 			};
1046 1011
 			name = Debug;
@@ -1050,7 +1015,6 @@
1050 1015
 			buildSettings = {
1051 1016
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
1052 1017
 				CURRENT_PROJECT_VERSION = 1;
1053
-				DEVELOPMENT_TEAM = "";
1054 1018
 				INFOPLIST_FILE = demo/Info.plist;
1055 1019
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
1056 1020
 				OTHER_LDFLAGS = (
@@ -1059,7 +1023,6 @@
1059 1023
 					"-lc++",
1060 1024
 				);
1061 1025
 				PRODUCT_NAME = demo;
1062
-				PROVISIONING_PROFILE_SPECIFIER = "";
1063 1026
 				VERSIONING_SYSTEM = "apple-generic";
1064 1027
 			};
1065 1028
 			name = Release;

+ 9
- 2
demo/ios/demo/Info.plist Целия файл

@@ -41,9 +41,16 @@
41 41
 	<key>NSLocationWhenInUseUsageDescription</key>
42 42
 	<string></string>
43 43
 	<key>NSAppTransportSecurity</key>
44
+	<!--See http://ste.vn/2015/06/10/configuring-app-transport-security-ios-9-osx-10-11/ -->
44 45
 	<dict>
45
-		<key>NSAllowsArbitraryLoads</key>
46
-		<true/>
46
+		<key>NSExceptionDomains</key>
47
+		<dict>
48
+			<key>localhost</key>
49
+			<dict>
50
+				<key>NSExceptionAllowsInsecureHTTPLoads</key>
51
+				<true/>
52
+			</dict>
53
+		</dict>
47 54
 	</dict>
48 55
 </dict>
49 56
 </plist>

+ 22
- 22
demo/package.json Целия файл

@@ -1,23 +1,23 @@
1 1
 {
2
-  "name": "demo",
3
-  "version": "0.0.1",
4
-  "private": true,
5
-  "scripts": {
6
-    "start": "node node_modules/react-native/local-cli/cli.js start",
7
-    "test": "jest"
8
-  },
9
-  "dependencies": {
10
-    "react": "16.0.0-alpha.12",
11
-    "react-native": "0.45.1",
12
-    "react-native-autoheight-webview": "../"
13
-  },
14
-  "devDependencies": {
15
-    "babel-jest": "19.0.0",
16
-    "babel-preset-react-native": "1.9.1",
17
-    "jest": "19.0.2",
18
-    "react-test-renderer": "16.0.0-alpha.6"
19
-  },
20
-  "jest": {
21
-    "preset": "react-native"
22
-  }
23
-}
2
+	"name": "demo",
3
+	"version": "0.0.1",
4
+	"private": true,
5
+	"scripts": {
6
+		"start": "node node_modules/react-native/local-cli/cli.js start",
7
+		"test": "jest"
8
+	},
9
+	"dependencies": {
10
+		"react": "16.0.0-alpha.12",
11
+		"react-native": "0.47.2",
12
+		"react-native-autoheight-webview": "../"
13
+	},
14
+	"devDependencies": {
15
+		"babel-jest": "20.0.3",
16
+		"babel-preset-react-native": "3.0.2",
17
+		"jest": "20.0.4",
18
+		"react-test-renderer": "16.0.0-alpha.12"
19
+	},
20
+	"jest": {
21
+		"preset": "react-native"
22
+	}
23
+}

+ 1547
- 1147
demo/yarn.lock
Файловите разлики са ограничени, защото са твърде много
Целия файл


+ 1
- 1
package.json Целия файл

@@ -1,6 +1,6 @@
1 1
 {
2 2
   "name": "react-native-autoheight-webview",
3
-  "version": "0.3.1",
3
+  "version": "0.3.2",
4 4
   "description": "An auto height webview for React Native",
5 5
   "main": "autoHeightWebView",
6 6
   "files": [