Procházet zdrojové kódy

Upgrade NPM dependencies/packages: ESLint

j8
Lyubo Marinov před 7 roky
rodič
revize
d8bc26a8ea

+ 73
- 68
package-lock.json Zobrazit soubor

@@ -1033,7 +1033,7 @@
1033 1033
       "resolved": "https://registry.npmjs.org/@atlassian/eslint-config-atlassian-fecq/-/eslint-config-atlassian-fecq-2.0.3.tgz",
1034 1034
       "integrity": "sha1-dloGlEPAPus735qYWNID+AF2XZ4=",
1035 1035
       "requires": {
1036
-        "eslint": "4.11.0",
1036
+        "eslint": "4.12.1",
1037 1037
         "prompt": "0.2.14",
1038 1038
         "strip-json-comments": "1.0.4"
1039 1039
       },
@@ -1075,9 +1075,9 @@
1075 1075
       "integrity": "sha1-NTL991fwUR9oj2wvoltUqM7y3xo="
1076 1076
     },
1077 1077
     "@babel/code-frame": {
1078
-      "version": "7.0.0-beta.32",
1079
-      "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0-beta.32.tgz",
1080
-      "integrity": "sha512-EVq4T1a2GviKiQ75OfxNrGPPhJyXzg9jjORuuwhloZbFdrhT4FHa73sv9OFWBwX7rl2b6bxBVmfxrBQYWYz9tA==",
1078
+      "version": "7.0.0-beta.31",
1079
+      "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0-beta.31.tgz",
1080
+      "integrity": "sha512-yd7CkUughvHQoEahQqcMdrZw6o/6PwUxiRkfZuVDVHCDe77mysD/suoNyk5mK6phTnRW1kyIbPHyCJgxw++LXg==",
1081 1081
       "dev": true,
1082 1082
       "requires": {
1083 1083
         "chalk": "2.3.0",
@@ -1086,65 +1086,66 @@
1086 1086
       }
1087 1087
     },
1088 1088
     "@babel/helper-function-name": {
1089
-      "version": "7.0.0-beta.32",
1090
-      "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.32.tgz",
1091
-      "integrity": "sha512-ysfIt7p72xm5fjSJsv7fMVN/j+EwIdqu8/MJjt6TqB4wM2r6rFRi0ujBTWDkLGQkRB/P5uDV8qcFCHAHnNzmsg==",
1089
+      "version": "7.0.0-beta.31",
1090
+      "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.31.tgz",
1091
+      "integrity": "sha512-c+DAyp8LMm2nzSs2uXEuxp4LYGSUYEyHtU3fU57avFChjsnTmmpWmXj2dv0yUxHTEydgVAv5fIzA+4KJwoqWDA==",
1092 1092
       "dev": true,
1093 1093
       "requires": {
1094
-        "@babel/helper-get-function-arity": "7.0.0-beta.32",
1095
-        "@babel/template": "7.0.0-beta.32",
1096
-        "@babel/types": "7.0.0-beta.32"
1094
+        "@babel/helper-get-function-arity": "7.0.0-beta.31",
1095
+        "@babel/template": "7.0.0-beta.31",
1096
+        "@babel/traverse": "7.0.0-beta.31",
1097
+        "@babel/types": "7.0.0-beta.31"
1097 1098
       }
1098 1099
     },
1099 1100
     "@babel/helper-get-function-arity": {
1100
-      "version": "7.0.0-beta.32",
1101
-      "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.32.tgz",
1102
-      "integrity": "sha512-bm7lIlizycJQY5SJ3HXWJV4XjSrOt1onzrDcOxUo9FEnKRZDEr/zfi5ar2s5tvvZvve/jGHwZKVKekRw2cjPCQ==",
1101
+      "version": "7.0.0-beta.31",
1102
+      "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.31.tgz",
1103
+      "integrity": "sha512-m7rVVX/dMLbbB9NCzKYRrrFb0qZxgpmQ4Wv6y7zEsB6skoJHRuXVeb/hAFze79vXBbuD63ci7AVHXzAdZSk9KQ==",
1103 1104
       "dev": true,
1104 1105
       "requires": {
1105
-        "@babel/types": "7.0.0-beta.32"
1106
+        "@babel/types": "7.0.0-beta.31"
1106 1107
       }
1107 1108
     },
1108 1109
     "@babel/template": {
1109
-      "version": "7.0.0-beta.32",
1110
-      "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.0.0-beta.32.tgz",
1111
-      "integrity": "sha512-DB9sLgX2mfE29vjAkxHlzLyWr31EO9HaYoAM/UsPSsL70Eudl0i25URwIfQT6S6ckeVFnFP1t6PhERVeV4EAHA==",
1110
+      "version": "7.0.0-beta.31",
1111
+      "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.0.0-beta.31.tgz",
1112
+      "integrity": "sha512-97IRmLvoDhIDSQkqklVt3UCxJsv0LUEVb/0DzXWtc8Lgiyxj567qZkmTG9aR21CmcJVVIvq2Y/moZj4oEpl5AA==",
1112 1113
       "dev": true,
1113 1114
       "requires": {
1114
-        "@babel/code-frame": "7.0.0-beta.32",
1115
-        "@babel/types": "7.0.0-beta.32",
1116
-        "babylon": "7.0.0-beta.32",
1115
+        "@babel/code-frame": "7.0.0-beta.31",
1116
+        "@babel/types": "7.0.0-beta.31",
1117
+        "babylon": "7.0.0-beta.31",
1117 1118
         "lodash": "4.17.4"
1118 1119
       },
1119 1120
       "dependencies": {
1120 1121
         "babylon": {
1121
-          "version": "7.0.0-beta.32",
1122
-          "resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.32.tgz",
1123
-          "integrity": "sha512-PvAmyP2IJEBVAuE5yVzrTSWCCN9VMa1eGns8w3w6FYD/ivHSUmS7n+F40Fmjn+0nCQSUFR96wP0CqQ4jxTnF4Q==",
1122
+          "version": "7.0.0-beta.31",
1123
+          "resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.31.tgz",
1124
+          "integrity": "sha512-6lm2mV3S51yEnKmQQNnswoABL1U1H1KHoCCVwdwI3hvIv+W7ya4ki7Aw4o4KxtUHjNKkK5WpZb22rrMMOcJXJQ==",
1124 1125
           "dev": true
1125 1126
         }
1126 1127
       }
1127 1128
     },
1128 1129
     "@babel/traverse": {
1129
-      "version": "7.0.0-beta.32",
1130
-      "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.0.0-beta.32.tgz",
1131
-      "integrity": "sha512-dGe2CLduCIZ/iDkbmnqspQguRy5ARvI+zC8TiwFnsJ2YYO2TWK7x2aEwrbkSmi0iPlBP+Syiag7Idc1qNQq74g==",
1130
+      "version": "7.0.0-beta.31",
1131
+      "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.0.0-beta.31.tgz",
1132
+      "integrity": "sha512-3N+VJW+KlezEjFBG7WSYeMyC5kIqVLPb/PGSzCDPFcJrnArluD1GIl7Y3xC7cjKiTq2/JohaLWHVPjJWHlo9Gg==",
1132 1133
       "dev": true,
1133 1134
       "requires": {
1134
-        "@babel/code-frame": "7.0.0-beta.32",
1135
-        "@babel/helper-function-name": "7.0.0-beta.32",
1136
-        "@babel/types": "7.0.0-beta.32",
1137
-        "babylon": "7.0.0-beta.32",
1135
+        "@babel/code-frame": "7.0.0-beta.31",
1136
+        "@babel/helper-function-name": "7.0.0-beta.31",
1137
+        "@babel/types": "7.0.0-beta.31",
1138
+        "babylon": "7.0.0-beta.31",
1138 1139
         "debug": "3.1.0",
1139
-        "globals": "10.3.0",
1140
+        "globals": "10.4.0",
1140 1141
         "invariant": "2.2.2",
1141 1142
         "lodash": "4.17.4"
1142 1143
       },
1143 1144
       "dependencies": {
1144 1145
         "babylon": {
1145
-          "version": "7.0.0-beta.32",
1146
-          "resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.32.tgz",
1147
-          "integrity": "sha512-PvAmyP2IJEBVAuE5yVzrTSWCCN9VMa1eGns8w3w6FYD/ivHSUmS7n+F40Fmjn+0nCQSUFR96wP0CqQ4jxTnF4Q==",
1146
+          "version": "7.0.0-beta.31",
1147
+          "resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.31.tgz",
1148
+          "integrity": "sha512-6lm2mV3S51yEnKmQQNnswoABL1U1H1KHoCCVwdwI3hvIv+W7ya4ki7Aw4o4KxtUHjNKkK5WpZb22rrMMOcJXJQ==",
1148 1149
           "dev": true
1149 1150
         },
1150 1151
         "debug": {
@@ -1157,17 +1158,17 @@
1157 1158
           }
1158 1159
         },
1159 1160
         "globals": {
1160
-          "version": "10.3.0",
1161
-          "resolved": "https://registry.npmjs.org/globals/-/globals-10.3.0.tgz",
1162
-          "integrity": "sha512-1g6qO5vMbiPHbRTDtR9JVjRkAhkgH4nSANYGyx1eOfqgxcMnYMMD+7MjmjfzXjwFpVUE/7/NzF+jQxYE7P4r7A==",
1161
+          "version": "10.4.0",
1162
+          "resolved": "https://registry.npmjs.org/globals/-/globals-10.4.0.tgz",
1163
+          "integrity": "sha512-uNUtxIZpGyuaq+5BqGGQHsL4wUlJAXRqOm6g3Y48/CWNGTLONgBibI0lh6lGxjR2HljFYUfszb+mk4WkgMntsA==",
1163 1164
           "dev": true
1164 1165
         }
1165 1166
       }
1166 1167
     },
1167 1168
     "@babel/types": {
1168
-      "version": "7.0.0-beta.32",
1169
-      "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.0.0-beta.32.tgz",
1170
-      "integrity": "sha512-w8+wzVcYCMb9OfaBfay2Vg5hyj7UfBX6qQtA+kB0qsW1h1NH/7xHMwvTZNqkuFBwjz5wxGS2QmaIcC3HH+UoxA==",
1169
+      "version": "7.0.0-beta.31",
1170
+      "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.0.0-beta.31.tgz",
1171
+      "integrity": "sha512-exAHB+NeFGxkfQ5dSUD03xl3zYGneeSk2Mw2ldTt/nTvYxuDiuSp3DlxgUBgzbdTFG4fbwPk0WtKWOoTXCmNGg==",
1171 1172
       "dev": true,
1172 1173
       "requires": {
1173 1174
         "esutils": "2.0.2",
@@ -1878,21 +1879,21 @@
1878 1879
       }
1879 1880
     },
1880 1881
     "babel-eslint": {
1881
-      "version": "8.0.2",
1882
-      "resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-8.0.2.tgz",
1883
-      "integrity": "sha512-yyl5U088oE+419+BNLJDKVWkUokuPLQeQt9ZTy9uM9kAzbtQgyYL3JkG425B8jxXA7MwTxnDAtRLMKJNH36qjA==",
1882
+      "version": "8.0.3",
1883
+      "resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-8.0.3.tgz",
1884
+      "integrity": "sha512-7D4iUpylEiKJPGbeSAlNddGcmA41PadgZ6UAb6JVyh003h3d0EbZusYFBR/+nBgqtaVJM2J2zUVa3N0hrpMH6g==",
1884 1885
       "dev": true,
1885 1886
       "requires": {
1886
-        "@babel/code-frame": "7.0.0-beta.32",
1887
-        "@babel/traverse": "7.0.0-beta.32",
1888
-        "@babel/types": "7.0.0-beta.32",
1889
-        "babylon": "7.0.0-beta.32"
1887
+        "@babel/code-frame": "7.0.0-beta.31",
1888
+        "@babel/traverse": "7.0.0-beta.31",
1889
+        "@babel/types": "7.0.0-beta.31",
1890
+        "babylon": "7.0.0-beta.31"
1890 1891
       },
1891 1892
       "dependencies": {
1892 1893
         "babylon": {
1893
-          "version": "7.0.0-beta.32",
1894
-          "resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.32.tgz",
1895
-          "integrity": "sha512-PvAmyP2IJEBVAuE5yVzrTSWCCN9VMa1eGns8w3w6FYD/ivHSUmS7n+F40Fmjn+0nCQSUFR96wP0CqQ4jxTnF4Q==",
1894
+          "version": "7.0.0-beta.31",
1895
+          "resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.31.tgz",
1896
+          "integrity": "sha512-6lm2mV3S51yEnKmQQNnswoABL1U1H1KHoCCVwdwI3hvIv+W7ya4ki7Aw4o4KxtUHjNKkK5WpZb22rrMMOcJXJQ==",
1896 1897
           "dev": true
1897 1898
         }
1898 1899
       }
@@ -5293,12 +5294,11 @@
5293 5294
       }
5294 5295
     },
5295 5296
     "doctrine": {
5296
-      "version": "2.0.0",
5297
-      "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.0.0.tgz",
5298
-      "integrity": "sha1-xz2NKQnSIpHhoAejlYBNqLZl/mM=",
5297
+      "version": "2.0.2",
5298
+      "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.0.2.tgz",
5299
+      "integrity": "sha512-y0tm5Pq6ywp3qSTZ1vPgVdAnbDEoeoc5wlOHXoY1c4Wug/a7JvqHIl7BTvwodaHmejWkK/9dSb3sCYfyo/om8A==",
5299 5300
       "requires": {
5300
-        "esutils": "2.0.2",
5301
-        "isarray": "1.0.0"
5301
+        "esutils": "2.0.2"
5302 5302
       }
5303 5303
     },
5304 5304
     "dom-helpers": {
@@ -5804,9 +5804,9 @@
5804 5804
       }
5805 5805
     },
5806 5806
     "eslint": {
5807
-      "version": "4.11.0",
5808
-      "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.11.0.tgz",
5809
-      "integrity": "sha512-UWbhQpaKlm8h5x/VLwm0S1kheMrDj8jPwhnBMjr/Dlo3qqT7MvcN/UfKAR3E1N4lr4YNtOvS4m3hwsrVc/ky7g==",
5807
+      "version": "4.12.1",
5808
+      "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.12.1.tgz",
5809
+      "integrity": "sha512-28hOYej+NZ/R5H1yMvyKa1+bPlu+fnsIAQffK6hxXgvmXnImos2bA5XfCn5dYv2k2mrKj+/U/Z4L5ICWxC7TQw==",
5810 5810
       "requires": {
5811 5811
         "ajv": "5.3.0",
5812 5812
         "babel-code-frame": "6.26.0",
@@ -5814,7 +5814,7 @@
5814 5814
         "concat-stream": "1.6.0",
5815 5815
         "cross-spawn": "5.1.0",
5816 5816
         "debug": "3.1.0",
5817
-        "doctrine": "2.0.0",
5817
+        "doctrine": "2.0.2",
5818 5818
         "eslint-scope": "3.7.1",
5819 5819
         "espree": "3.5.2",
5820 5820
         "esquery": "1.0.0",
@@ -5823,7 +5823,7 @@
5823 5823
         "file-entry-cache": "2.0.0",
5824 5824
         "functional-red-black-tree": "1.0.1",
5825 5825
         "glob": "7.1.2",
5826
-        "globals": "9.18.0",
5826
+        "globals": "11.0.1",
5827 5827
         "ignore": "3.3.7",
5828 5828
         "imurmurhash": "0.1.4",
5829 5829
         "inquirer": "3.3.0",
@@ -5877,6 +5877,11 @@
5877 5877
             "path-is-absolute": "1.0.1"
5878 5878
           }
5879 5879
         },
5880
+        "globals": {
5881
+          "version": "11.0.1",
5882
+          "resolved": "https://registry.npmjs.org/globals/-/globals-11.0.1.tgz",
5883
+          "integrity": "sha1-Eqh7sBDlFUOWrMU14eQ/x1Ow5eg="
5884
+        },
5880 5885
         "minimatch": {
5881 5886
           "version": "3.0.4",
5882 5887
           "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
@@ -6062,21 +6067,21 @@
6062 6067
       }
6063 6068
     },
6064 6069
     "eslint-plugin-react": {
6065
-      "version": "7.4.0",
6066
-      "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.4.0.tgz",
6067
-      "integrity": "sha512-tvjU9u3VqmW2vVuYnE8Qptq+6ji4JltjOjJ9u7VAOxVYkUkyBZWRvNYKbDv5fN+L6wiA+4we9+qQahZ0m63XEA==",
6070
+      "version": "7.5.1",
6071
+      "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.5.1.tgz",
6072
+      "integrity": "sha512-YGSjB9Qu6QbVTroUZi66pYky3DfoIPLdHQ/wmrBGyBRnwxQsBXAov9j2rpXt/55i8nyMv6IRWJv2s4d4YnduzQ==",
6068 6073
       "dev": true,
6069 6074
       "requires": {
6070
-        "doctrine": "2.0.0",
6075
+        "doctrine": "2.0.2",
6071 6076
         "has": "1.0.1",
6072 6077
         "jsx-ast-utils": "2.0.1",
6073 6078
         "prop-types": "15.6.0"
6074 6079
       }
6075 6080
     },
6076 6081
     "eslint-plugin-react-native": {
6077
-      "version": "3.1.0",
6078
-      "resolved": "https://registry.npmjs.org/eslint-plugin-react-native/-/eslint-plugin-react-native-3.1.0.tgz",
6079
-      "integrity": "sha1-A/lflZv/eoJntUcsuH0BDjRvciQ=",
6082
+      "version": "3.2.0",
6083
+      "resolved": "https://registry.npmjs.org/eslint-plugin-react-native/-/eslint-plugin-react-native-3.2.0.tgz",
6084
+      "integrity": "sha512-b/VrvsLM17FCul+RTXi4owZaP/u3Xo0IWv2ZTxgGGAyaNKscGbTvvoV/MxhYxRSuDmG7uAM9l7DN6wTGyC2U+Q==",
6080 6085
       "dev": true
6081 6086
     },
6082 6087
     "eslint-scope": {
@@ -11107,7 +11112,7 @@
11107 11112
       }
11108 11113
     },
11109 11114
     "lib-jitsi-meet": {
11110
-      "version": "github:jitsi/lib-jitsi-meet#067b8c3867d7e47a1f3fd8fccf702ffb3076c4a8",
11115
+      "version": "github:jitsi/lib-jitsi-meet#b4adec279669a08213adb543ef46a11e0d840b92",
11111 11116
       "requires": {
11112 11117
         "async": "0.9.0",
11113 11118
         "current-executing-script": "0.1.3",

+ 5
- 5
package.json Zobrazit soubor

@@ -46,7 +46,7 @@
46 46
     "js-md5": "0.6.1",
47 47
     "jssha": "2.2.0",
48 48
     "jwt-decode": "2.2.0",
49
-    "lib-jitsi-meet": "github:jitsi/lib-jitsi-meet#067b8c3867d7e47a1f3fd8fccf702ffb3076c4a8",
49
+    "lib-jitsi-meet": "github:jitsi/lib-jitsi-meet#b4adec279669a08213adb543ef46a11e0d840b92",
50 50
     "lodash": "4.17.4",
51 51
     "nuclear-js": "1.4.0",
52 52
     "postis": "2.2.0",
@@ -75,7 +75,7 @@
75 75
   },
76 76
   "devDependencies": {
77 77
     "babel-core": "6.26.0",
78
-    "babel-eslint": "8.0.2",
78
+    "babel-eslint": "8.0.3",
79 79
     "babel-loader": "7.1.2",
80 80
     "babel-polyfill": "6.26.0",
81 81
     "babel-preset-env": "1.6.1",
@@ -83,13 +83,13 @@
83 83
     "babel-preset-stage-1": "6.24.1",
84 84
     "clean-css": "3.4.25",
85 85
     "css-loader": "0.28.7",
86
-    "eslint": "4.11.0",
86
+    "eslint": "4.12.1",
87 87
     "eslint-config-jitsi": "github:jitsi/eslint-config-jitsi#v0.1",
88 88
     "eslint-plugin-flowtype": "2.39.1",
89 89
     "eslint-plugin-import": "2.8.0",
90 90
     "eslint-plugin-jsdoc": "3.2.0",
91
-    "eslint-plugin-react": "7.4.0",
92
-    "eslint-plugin-react-native": "3.1.0",
91
+    "eslint-plugin-react": "7.5.1",
92
+    "eslint-plugin-react-native": "3.2.0",
93 93
     "expose-loader": "0.7.4",
94 94
     "file-loader": "1.1.5",
95 95
     "flow-bin": "0.53.0",

+ 28
- 8
react/features/base/dialog/components/SimpleBottomSheet.native.js Zobrazit soubor

@@ -21,10 +21,6 @@ import { simpleBottomSheet as styles } from './styles';
21 21
  */
22 22
 const BUTTON_UNDERLAY_COLOR = '#eee';
23 23
 
24
-/**
25
- * {@code SimpleBottomSheet}'s React {@code Component} prop types.
26
- */
27
-
28 24
 type Option = {
29 25
 
30 26
     /**
@@ -44,6 +40,10 @@ type Option = {
44 40
     text: string
45 41
 };
46 42
 
43
+
44
+/**
45
+ * The type of {@code SimpleBottomSheet}'s React {@code Component} prop types.
46
+ */
47 47
 type Props = {
48 48
 
49 49
     /**
@@ -125,7 +125,9 @@ class SimpleBottomSheet extends Component<Props> {
125 125
      * @returns {void}
126 126
      */
127 127
     _onButtonPress(option) {
128
-        this.props.onSubmit && this.props.onSubmit(option);
128
+        const { onSubmit } = this.props;
129
+
130
+        onSubmit && onSubmit(option);
129 131
     }
130 132
 
131 133
     _onCancel: () => void;
@@ -137,7 +139,9 @@ class SimpleBottomSheet extends Component<Props> {
137 139
      * @returns {void}
138 140
      */
139 141
     _onCancel() {
140
-        this.props.onCancel && this.props.onCancel();
142
+        const { onCancel } = this.props;
143
+
144
+        onCancel && onCancel();
141 145
     }
142 146
 
143 147
     /**
@@ -160,14 +164,30 @@ class SimpleBottomSheet extends Component<Props> {
160 164
      * @returns {ReactElement} - A row element with an icon and text.
161 165
      */
162 166
     _renderRow(option, index) {
163
-        const onPress = this._onButtonPress.bind(this, option);
164 167
         const { iconName, selected, text } = option;
165 168
         const selectedStyle = selected ? styles.rowSelectedText : {};
166 169
 
167 170
         return (
168 171
             <TouchableHighlight
169 172
                 key = { index }
170
-                onPress = { onPress }
173
+
174
+                // TODO The following disables an eslint error alerting about a
175
+                // known potential/theoretical performance pernalty:
176
+                //
177
+                // A bind call or arrow function in a JSX prop will create a
178
+                // brand new function on every single render. This is bad for
179
+                // performance, as it will result in the garbage collector being
180
+                // invoked way more than is necessary. It may also cause
181
+                // unnecessary re-renders if a brand new function is passed as a
182
+                // prop to a component that uses reference equality check on the
183
+                // prop to determine if it should update.
184
+                //
185
+                // I'm not addressing the potential/theoretical performance
186
+                // penalty at the time of this writing because it doesn't seem
187
+                // to me that it's a practical performance penalty in the case.
188
+                //
189
+                // eslint-disable-next-line react/jsx-no-bind
190
+                onPress = { this._onButtonPress.bind(this, option) }
171 191
                 underlayColor = { BUTTON_UNDERLAY_COLOR } >
172 192
                 <View style = { styles.row } >
173 193
                     <Icon

+ 30
- 13
react/features/toolbox/components/Toolbar.web.js Zobrazit soubor

@@ -1,4 +1,4 @@
1
-/* @flow */
1
+// @flow
2 2
 
3 3
 import PropTypes from 'prop-types';
4 4
 import React, { Component } from 'react';
@@ -18,10 +18,6 @@ import ToolbarButton from './ToolbarButton';
18 18
  * @extends Component
19 19
  */
20 20
 class Toolbar extends Component<*> {
21
-    _onMouseOut: Function;
22
-    _onMouseOver: Function;
23
-    _renderToolbarButton: Function;
24
-
25 21
     /**
26 22
      * Base toolbar component's property types.
27 23
      *
@@ -86,7 +82,7 @@ class Toolbar extends Component<*> {
86 82
             <StatelessToolbar { ...props }>
87 83
                 {
88 84
                     [ ...this.props.toolbarButtons.entries() ]
89
-                    .map(this._renderToolbarButton)
85
+                        .map(this._renderToolbarButton)
90 86
                 }
91 87
                 {
92 88
                     this.props.children
@@ -95,26 +91,32 @@ class Toolbar extends Component<*> {
95 91
         );
96 92
     }
97 93
 
94
+    _onMouseOut: () => void;
95
+
98 96
     /**
99 97
      * Dispatches an action signalling that toolbar is no being hovered.
100 98
      *
101 99
      * @protected
102
-     * @returns {Object} Dispatched action.
100
+     * @returns {void}
103 101
      */
104 102
     _onMouseOut() {
105 103
         this.props.dispatch(setToolbarHovered(false));
106 104
     }
107 105
 
106
+    _onMouseOver: () => void;
107
+
108 108
     /**
109 109
      * Dispatches an action signalling that toolbar is now being hovered.
110 110
      *
111 111
      * @protected
112
-     * @returns {Object} Dispatched action.
112
+     * @returns {void}
113 113
      */
114 114
     _onMouseOver() {
115 115
         this.props.dispatch(setToolbarHovered(true));
116 116
     }
117 117
 
118
+    _renderToolbarButton: (Array<*>) => React$Element<*>;
119
+
118 120
     /**
119 121
      * Renders toolbar button. Method is passed to map function.
120 122
      *
@@ -123,20 +125,18 @@ class Toolbar extends Component<*> {
123 125
      * @private
124 126
      * @returns {ReactElement} A toolbar button.
125 127
      */
126
-    _renderToolbarButton(keyValuePair: Array<*>): React$Element<*> {
127
-        const [ key, button ] = keyValuePair;
128
+    _renderToolbarButton([ key, button ]): React$Element<*> {
129
+        const { tooltipPosition } = this.props;
128 130
 
129 131
         if (button.component) {
130
-
131 132
             return (
132 133
                 <button.component
133 134
                     key = { key }
134 135
                     toggled = { button.toggled }
135
-                    tooltipPosition = { this.props.tooltipPosition } />
136
+                    tooltipPosition = { tooltipPosition } />
136 137
             );
137 138
         }
138 139
 
139
-        const { tooltipPosition } = this.props;
140 140
         const {
141 141
             childComponent: ChildComponent,
142 142
             onClick,
@@ -150,6 +150,23 @@ class Toolbar extends Component<*> {
150 150
             <ToolbarButton
151 151
                 button = { button }
152 152
                 key = { key }
153
+
154
+                // TODO The following disables an eslint error alerting about a
155
+                // known potential/theoretical performance pernalty:
156
+                //
157
+                // A bind call or arrow function in a JSX prop will create a
158
+                // brand new function on every single render. This is bad for
159
+                // performance, as it will result in the garbage collector being
160
+                // invoked way more than is necessary. It may also cause
161
+                // unnecessary re-renders if a brand new function is passed as a
162
+                // prop to a component that uses reference equality check on the
163
+                // prop to determine if it should update.
164
+                //
165
+                // I'm not addressing the potential/theoretical performance
166
+                // penalty at the time of this writing because I don't know for
167
+                // a fact that it's a practical performance penalty in the case.
168
+                //
169
+                // eslint-disable-next-line react/jsx-no-bind
153 170
                 onClick = { onClickWithDispatch }
154 171
                 onMount = { onMount }
155 172
                 onUnmount = { onUnmount }

Načítá se…
Zrušit
Uložit