holidayextras / ui-toolkit

DEPRECATED - CSS & React components
http://tech.holidayextras.co.uk/ui-toolkit/
MIT License
14 stars 3 forks source link

Ensure es6 shorthand funcs are properly transpiled #157

Closed djbeaumont closed 8 years ago

djbeaumont commented 8 years ago

Fixes a small boo-boo with the v3.0.0 release. The upgrade to babel 6 didn't include the es2015 'preset' which transpiles source to es5. This means that the JSX code was transpiled but constructs like the shorthand method syntax { myFunc() {} } wasn't. The result is that the toolkit with v3.0.0 can't be used in es5 projects without further transpilation.

This works fine in the project itself and fine in other projects, but not when passed through es5 only tools like uglify.

This change can be tested by running npm run build and checking that the produced file at dist/components/button/index.js is valid es5. I.e. _getProps: function _getProps() { not _getProps() {.