mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-06-01 10:07:35 +00:00
Update flow to 0.142
This commit is contained in:
committed by
Nicolas Gallagher
parent
7293a613d5
commit
26a3e1e958
@@ -3,7 +3,7 @@
|
|||||||
"react": {
|
"react": {
|
||||||
"pragma": "React",
|
"pragma": "React",
|
||||||
"version": "16.6",
|
"version": "16.6",
|
||||||
"flowVersion": "0.109.0" // Flow version
|
"flowVersion": "0.142.0" // Flow version
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// babel parser to support ES6/7 features
|
// babel parser to support ES6/7 features
|
||||||
|
|||||||
+4
-2
@@ -1,5 +1,5 @@
|
|||||||
[version]
|
[version]
|
||||||
^0.109.0
|
^0.142.0
|
||||||
|
|
||||||
[ignore]
|
[ignore]
|
||||||
<PROJECT_ROOT>/.*/__tests__/.*
|
<PROJECT_ROOT>/.*/__tests__/.*
|
||||||
@@ -15,7 +15,9 @@
|
|||||||
<PROJECT_ROOT>/types
|
<PROJECT_ROOT>/types
|
||||||
|
|
||||||
[options]
|
[options]
|
||||||
|
munge_underscores=true
|
||||||
|
types_first=false
|
||||||
|
well_formed_exports=false
|
||||||
suppress_type=$FlowIssue
|
suppress_type=$FlowIssue
|
||||||
suppress_type=$FlowFixMe
|
suppress_type=$FlowFixMe
|
||||||
suppress_type=$FlowFixMeProps
|
suppress_type=$FlowFixMeProps
|
||||||
|
|||||||
+1
-1
@@ -51,7 +51,7 @@
|
|||||||
"eslint-plugin-promise": "^4.2.1",
|
"eslint-plugin-promise": "^4.2.1",
|
||||||
"eslint-plugin-react": "^7.22.0",
|
"eslint-plugin-react": "^7.22.0",
|
||||||
"eslint-plugin-react-hooks": "^4.2.0",
|
"eslint-plugin-react-hooks": "^4.2.0",
|
||||||
"flow-bin": "^0.109.0",
|
"flow-bin": "^0.142.0",
|
||||||
"glob": "^7.1.6",
|
"glob": "^7.1.6",
|
||||||
"husky": "^4.3.8",
|
"husky": "^4.3.8",
|
||||||
"inline-style-prefixer": "^6.0.0",
|
"inline-style-prefixer": "^6.0.0",
|
||||||
|
|||||||
+5
-4
@@ -14,18 +14,18 @@ import createElement from '../createElement';
|
|||||||
import useMergeRefs from '../../modules/useMergeRefs';
|
import useMergeRefs from '../../modules/useMergeRefs';
|
||||||
import usePlatformMethods from '../../modules/usePlatformMethods';
|
import usePlatformMethods from '../../modules/usePlatformMethods';
|
||||||
import PickerItem from './PickerItem';
|
import PickerItem from './PickerItem';
|
||||||
import StyleSheet, { type StyleObj } from '../StyleSheet';
|
import StyleSheet from '../StyleSheet';
|
||||||
import { forwardRef, useRef } from 'react';
|
import { forwardRef, useRef } from 'react';
|
||||||
|
|
||||||
type PickerProps = {
|
type PickerProps = {
|
||||||
...ViewProps,
|
...ViewProps,
|
||||||
children?: PickerItem | Array<typeof PickerItem>,
|
children?: typeof PickerItem | Array<typeof PickerItem>,
|
||||||
enabled?: boolean,
|
enabled?: boolean,
|
||||||
onValueChange?: (number | string, number) => void,
|
onValueChange?: (number | string, number) => void,
|
||||||
selectedValue?: number | string,
|
selectedValue?: number | string,
|
||||||
style?: StyleObj,
|
style?: any,
|
||||||
/* compat */
|
/* compat */
|
||||||
itemStyle?: StyleObj,
|
itemStyle?: any,
|
||||||
mode?: string,
|
mode?: string,
|
||||||
prompt?: string
|
prompt?: string
|
||||||
};
|
};
|
||||||
@@ -55,6 +55,7 @@ const Picker = forwardRef<PickerProps, *>((props, forwardedRef) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// $FlowFixMe ViewProps should be exact in the future
|
||||||
const supportedProps: any = {
|
const supportedProps: any = {
|
||||||
children,
|
children,
|
||||||
disabled: enabled === false ? true : undefined,
|
disabled: enabled === false ? true : undefined,
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ export function classic(style: Style, name: string): CompilerOutput {
|
|||||||
* Compile simple style object to inline DOM styles.
|
* Compile simple style object to inline DOM styles.
|
||||||
* No support for 'animationKeyframes', 'placeholderTextColor', 'scrollbarWidth', or 'pointerEvents'.
|
* No support for 'animationKeyframes', 'placeholderTextColor', 'scrollbarWidth', or 'pointerEvents'.
|
||||||
*/
|
*/
|
||||||
export function inline(style: Style) {
|
export function inline(style: Style): any {
|
||||||
return prefixInlineStyles(createReactDOMStyle(style));
|
return prefixInlineStyles(createReactDOMStyle(style));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,7 +107,7 @@ export function inline(style: Style) {
|
|||||||
* Create a value string that normalizes different input values with a common
|
* Create a value string that normalizes different input values with a common
|
||||||
* output.
|
* output.
|
||||||
*/
|
*/
|
||||||
export function stringifyValueWithProperty(value: Value, property: ?string) {
|
export function stringifyValueWithProperty(value: Value, property: ?string): string {
|
||||||
// e.g., 0 => '0px', 'black' => 'rgba(0,0,0,1)'
|
// e.g., 0 => '0px', 'black' => 'rgba(0,0,0,1)'
|
||||||
const normalizedValue = normalizeValueWithProperty(value, property);
|
const normalizedValue = normalizeValueWithProperty(value, property);
|
||||||
return typeof normalizedValue !== 'string'
|
return typeof normalizedValue !== 'string'
|
||||||
@@ -152,17 +152,17 @@ function createAtomicRules(identifier: string, property, value): Rules {
|
|||||||
if (value === 'auto' || value === 'box-only') {
|
if (value === 'auto' || value === 'box-only') {
|
||||||
finalValue = 'auto!important';
|
finalValue = 'auto!important';
|
||||||
if (value === 'box-only') {
|
if (value === 'box-only') {
|
||||||
const block = createDeclarationBlock({ [property]: 'none' });
|
const block = createDeclarationBlock({ pointerEvents: 'none' });
|
||||||
rules.push(`${selector}>*${block}`);
|
rules.push(`${selector}>*${block}`);
|
||||||
}
|
}
|
||||||
} else if (value === 'none' || value === 'box-none') {
|
} else if (value === 'none' || value === 'box-none') {
|
||||||
finalValue = 'none!important';
|
finalValue = 'none!important';
|
||||||
if (value === 'box-none') {
|
if (value === 'box-none') {
|
||||||
const block = createDeclarationBlock({ [property]: 'auto' });
|
const block = createDeclarationBlock({ pointerEvents: 'auto' });
|
||||||
rules.push(`${selector}>*${block}`);
|
rules.push(`${selector}>*${block}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const block = createDeclarationBlock({ [property]: finalValue });
|
const block = createDeclarationBlock({ pointerEvents: finalValue });
|
||||||
rules.push(`${selector}${block}`);
|
rules.push(`${selector}${block}`);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -173,7 +173,7 @@ function createAtomicRules(identifier: string, property, value): Rules {
|
|||||||
if (value === 'none') {
|
if (value === 'none') {
|
||||||
rules.push(`${selector}::-webkit-scrollbar{display:none}`);
|
rules.push(`${selector}::-webkit-scrollbar{display:none}`);
|
||||||
}
|
}
|
||||||
const block = createDeclarationBlock({ [property]: value });
|
const block = createDeclarationBlock({ scrollbarWidth: value });
|
||||||
rules.push(`${selector}${block}`);
|
rules.push(`${selector}${block}`);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -218,7 +218,7 @@ function createDeclarationBlock(style: Style) {
|
|||||||
/**
|
/**
|
||||||
* An identifier is associated with a unique set of styles.
|
* An identifier is associated with a unique set of styles.
|
||||||
*/
|
*/
|
||||||
function createIdentifier(prefix, name, value) {
|
function createIdentifier(prefix: string, name: string, value): string {
|
||||||
const hashedString = hash(name + stringifyValueWithProperty(value, name));
|
const hashedString = hash(name + stringifyValueWithProperty(value, name));
|
||||||
return process.env.NODE_ENV !== 'production'
|
return process.env.NODE_ENV !== 'production'
|
||||||
? `${prefix}-${name}-${hashedString}`
|
? `${prefix}-${name}-${hashedString}`
|
||||||
|
|||||||
+1
-1
@@ -72,7 +72,7 @@ export default function createOrderedCSSStyleSheet(sheet: ?CSSStyleSheet) {
|
|||||||
// Increment the starting index of all subsequent groups
|
// Increment the starting index of all subsequent groups
|
||||||
for (let i = nextGroupIndex; i < orderedGroups.length; i += 1) {
|
for (let i = nextGroupIndex; i < orderedGroups.length; i += 1) {
|
||||||
const groupNumber = orderedGroups[i];
|
const groupNumber = orderedGroups[i];
|
||||||
const previousStart = groups[groupNumber].start;
|
const previousStart = groups[groupNumber].start || 0;
|
||||||
groups[groupNumber].start = previousStart + 1;
|
groups[groupNumber].start = previousStart + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,9 +9,7 @@
|
|||||||
|
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
|
|
||||||
opaque type UninitializedMarker = Symbol | {||};
|
const UNINITIALIZED =
|
||||||
|
|
||||||
const UNINITIALIZED: UninitializedMarker =
|
|
||||||
typeof Symbol === 'function' && typeof Symbol() === 'symbol' ? Symbol() : Object.freeze({});
|
typeof Symbol === 'function' && typeof Symbol() === 'symbol' ? Symbol() : Object.freeze({});
|
||||||
|
|
||||||
export default function useStable<T>(getInitialValue: () => T): T {
|
export default function useStable<T>(getInitialValue: () => T): T {
|
||||||
|
|||||||
@@ -5321,10 +5321,10 @@ flatted@^3.1.0:
|
|||||||
resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.1.1.tgz#c4b489e80096d9df1dfc97c79871aea7c617c469"
|
resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.1.1.tgz#c4b489e80096d9df1dfc97c79871aea7c617c469"
|
||||||
integrity sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==
|
integrity sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==
|
||||||
|
|
||||||
flow-bin@^0.109.0:
|
flow-bin@^0.142.0:
|
||||||
version "0.109.0"
|
version "0.142.0"
|
||||||
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.109.0.tgz"
|
resolved "https://registry.npmjs.org/flow-bin/-/flow-bin-0.142.0.tgz#b46b69de1123cf7c5a50917402968e07291df054"
|
||||||
integrity sha512-tpcMTpAGIRivYhFV3KJq+zHI2HzcXo8MoGe9pXS4G/UZuey2Faq/e8/gdph2WF0erRlML5hmwfwiq7v9c25c7w==
|
integrity sha512-YgiapK/wrJjcgSgOWfoncbZ4vZrZWdHs+p7V9duI9zo4ehW2nM/VRrpSaWoZ+CWu3t+duGyAvupJvC6MM2l07w==
|
||||||
|
|
||||||
follow-redirects@^1.0.0, follow-redirects@^1.10.0:
|
follow-redirects@^1.0.0, follow-redirects@^1.10.0:
|
||||||
version "1.13.1"
|
version "1.13.1"
|
||||||
|
|||||||
Reference in New Issue
Block a user