Reduce babel junk in built files

Configure babel preset-env to match the documentation's browser support
list.
This commit is contained in:
Nicolas Gallagher
2022-07-06 15:42:38 -07:00
parent 1aa84d5447
commit e027829cdb
5 changed files with 106 additions and 96 deletions
+16 -13
View File
@@ -23,19 +23,22 @@ import StyleSheet from '../StyleSheet';
import TextAncestorContext from './TextAncestorContext';
import { useLocaleContext, getLocaleDirection } from '../../modules/useLocale';
const forwardPropsList = {
...forwardedProps.defaultProps,
...forwardedProps.accessibilityProps,
...forwardedProps.clickProps,
...forwardedProps.focusProps,
...forwardedProps.keyboardProps,
...forwardedProps.mouseProps,
...forwardedProps.touchProps,
...forwardedProps.styleProps,
href: true,
lang: true,
pointerEvents: true
};
const forwardPropsList = Object.assign(
{},
forwardedProps.defaultProps,
forwardedProps.accessibilityProps,
forwardedProps.clickProps,
forwardedProps.focusProps,
forwardedProps.keyboardProps,
forwardedProps.mouseProps,
forwardedProps.touchProps,
forwardedProps.styleProps,
{
href: true,
lang: true,
pointerEvents: true
}
);
const pickProps = (props) => pick(props, forwardPropsList);
+30 -27
View File
@@ -47,33 +47,36 @@ const setSelection = (node, selection) => {
}
};
const forwardPropsList = {
...forwardedProps.defaultProps,
...forwardedProps.accessibilityProps,
...forwardedProps.clickProps,
...forwardedProps.focusProps,
...forwardedProps.keyboardProps,
...forwardedProps.mouseProps,
...forwardedProps.touchProps,
...forwardedProps.styleProps,
autoCapitalize: true,
autoComplete: true,
autoCorrect: true,
autoFocus: true,
defaultValue: true,
disabled: true,
lang: true,
maxLength: true,
onChange: true,
onScroll: true,
placeholder: true,
pointerEvents: true,
readOnly: true,
rows: true,
spellCheck: true,
value: true,
type: true
};
const forwardPropsList = Object.assign(
{},
forwardedProps.defaultProps,
forwardedProps.accessibilityProps,
forwardedProps.clickProps,
forwardedProps.focusProps,
forwardedProps.keyboardProps,
forwardedProps.mouseProps,
forwardedProps.touchProps,
forwardedProps.styleProps,
{
autoCapitalize: true,
autoComplete: true,
autoCorrect: true,
autoFocus: true,
defaultValue: true,
disabled: true,
lang: true,
maxLength: true,
onChange: true,
onScroll: true,
placeholder: true,
pointerEvents: true,
readOnly: true,
rows: true,
spellCheck: true,
value: true,
type: true
}
);
const pickProps = (props) => pick(props, forwardPropsList);
+21 -15
View File
@@ -23,21 +23,27 @@ import StyleSheet from '../StyleSheet';
import TextAncestorContext from '../Text/TextAncestorContext';
import { useLocaleContext, getLocaleDirection } from '../../modules/useLocale';
const forwardPropsList = {
...forwardedProps.defaultProps,
...forwardedProps.accessibilityProps,
...forwardedProps.clickProps,
...forwardedProps.focusProps,
...forwardedProps.keyboardProps,
...forwardedProps.mouseProps,
...forwardedProps.touchProps,
...forwardedProps.styleProps,
href: true,
lang: true,
onScroll: true,
onWheel: true,
pointerEvents: true
};
const forwardPropsList = Object.assign(
{},
forwardedProps.defaultProps,
forwardedProps.accessibilityProps,
forwardedProps.clickProps,
forwardedProps.defaultProps,
forwardedProps.accessibilityProps,
forwardedProps.clickProps,
forwardedProps.focusProps,
forwardedProps.keyboardProps,
forwardedProps.mouseProps,
forwardedProps.touchProps,
forwardedProps.styleProps,
{
href: true,
lang: true,
onScroll: true,
onWheel: true,
pointerEvents: true
}
);
const pickProps = (props) => pick(props, forwardPropsList);