Problem description
With the recent change to flow 0.53, we encountered a small but perhaps unnecessary size increase. There are two sources of this:
- the conditional check for
typeof seems quite long
- there are two assignments to propTypes
This was occurring before the PR #7869 as verified in the build package, but I assume the long typeof check pushed us up and over that limit.
This could be a bug in the plugin, or it could be a quirk with our usage.
Steps to reproduce
yarn build
- open
RadioGroup.js
- look at the bottom to find
RadioGroup.propTypes = process.env.NODE_ENV !== "production" ? (_ref2 = {
classes: require('prop-types').object.isRequired,
children: typeof (React.ChildrenArray == null ? {} : React.ChildrenArray) === 'function' ? require('prop-types').instanceOf(React.ChildrenArray == null ? {} : React.ChildrenArray) : require('prop-types').any
}, (0, _defineProperty3.default)(_ref2, 'classes', require('prop-types').object), (0, _defineProperty3.default)(_ref2, 'className', require('prop-types').string), (0, _defineProperty3.default)(_ref2, 'name', require('prop-types').string), (0, _defineProperty3.default)(_ref2, 'onBlur', require('prop-types').func), (0, _defineProperty3.default)(_ref2, 'onChange', require('prop-types').func), (0, _defineProperty3.default)(_ref2, 'onKeyDown', require('prop-types').func), (0, _defineProperty3.default)(_ref2, 'value', require('prop-types').string.isRequired), _ref2) : {};
RadioGroup.propTypes = process.env.NODE_ENV !== "production" ? (_ref3 = {
classes: require('prop-types').object.isRequired,
children: typeof (React.ChildrenArray == null ? {} : React.ChildrenArray) === 'function' ? require('prop-types').instanceOf(React.ChildrenArray == null ? {} : React.ChildrenArray) : require('prop-types').any
}, (0, _defineProperty3.default)(_ref3, 'classes', require('prop-types').object), (0, _defineProperty3.default)(_ref3, 'className', require('prop-types').string), (0, _defineProperty3.default)(_ref3, 'name', require('prop-types').string), (0, _defineProperty3.default)(_ref3, 'onBlur', require('prop-types').func), (0, _defineProperty3.default)(_ref3, 'onChange', require('prop-types').func), (0, _defineProperty3.default)(_ref3, 'onKeyDown', require('prop-types').func), (0, _defineProperty3.default)(_ref3, 'value', require('prop-types').string.isRequired), _ref3) : {};
Problem description
With the recent change to flow 0.53, we encountered a small but perhaps unnecessary size increase. There are two sources of this:
typeofseems quite longThis was occurring before the PR #7869 as verified in the build package, but I assume the long
typeofcheck pushed us up and over that limit.This could be a bug in the plugin, or it could be a quirk with our usage.
Steps to reproduce
yarn buildRadioGroup.js