-
Notifications
You must be signed in to change notification settings - Fork 262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modernize things #421
Modernize things #421
Changes from 1 commit
6bc0286
54bbe58
166478c
e743272
cebbc9f
b7177b0
9ad047a
87a97ab
c63ec6f
e997315
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,10 +6,9 @@ const styleSheetRegistry = new StyleSheetRegistry() | |
export default class JSXStyle extends Component { | ||
static dynamic(info) { | ||
return info | ||
.map(tagInfo => { | ||
const [baseId, props] = tagInfo | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. by getting rid of this Babel won't inline the following helper: var _slicedToArray = (function() {
function sliceIterator(arr, i) {
var _arr = [];
var _n = true;
var _d = false;
var _e = undefined;
try {
for (
var _i = arr[Symbol.iterator](), _s;
!(_n = (_s = _i.next()).done);
_n = true
) {
_arr.push(_s.value);
if (i && _arr.length === i) break;
}
} catch (err) {
_d = true;
_e = err;
} finally {
try {
if (!_n && _i["return"]) _i["return"]();
} finally {
if (_d) throw _e;
}
}
return _arr;
}
return function(arr, i) {
if (Array.isArray(arr)) {
return arr;
} else if (Symbol.iterator in Object(arr)) {
return sliceIterator(arr, i);
} else {
throw new TypeError(
"Invalid attempt to destructure non-iterable instance"
);
}
};
})(); There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you mean you want smaller output, you'll need to use other options like 'loose' mode because spec is default. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good point but I don't know if I can configure that per-plugin when using preset-env. In this case I can just write es5 myself There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can apply loose mode to all plugins or do them individually yeah. Of course that works too |
||
return styleSheetRegistry.computeId(baseId, props) | ||
}) | ||
.map(tagInfo => | ||
styleSheetRegistry.computeId(tagInfo.baseId, tagInfo.props) | ||
) | ||
.join(' ') | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can just get rid of this and Babel won't inline the following helper :)