-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use ES6 modules again with es3ify as a temporary fix against IE8
- Loading branch information
Showing
9 changed files
with
111 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,26 @@ | ||
{ | ||
"presets": ["es2015-loose", "stage-0", "react"], | ||
"plugins": [ | ||
"transform-decorators-legacy" | ||
plugins: [ | ||
"transform-decorators-legacy", | ||
["transform-es2015-template-literals", { "loose": true }], | ||
"transform-es2015-literals", | ||
"transform-es2015-function-name", | ||
"transform-es2015-arrow-functions", | ||
"transform-es2015-block-scoped-functions", | ||
["transform-es2015-classes", { "loose": true }], | ||
"transform-es2015-object-super", | ||
"transform-es2015-shorthand-properties", | ||
["transform-es2015-computed-properties", { "loose": true }], | ||
["transform-es2015-for-of", { "loose": true }], | ||
"transform-es2015-sticky-regex", | ||
"transform-es2015-unicode-regex", | ||
"check-es2015-constants", | ||
["transform-es2015-spread", { "loose": true }], | ||
"transform-es2015-parameters", | ||
["transform-es2015-destructuring", { "loose": true }], | ||
"transform-es2015-block-scoping", | ||
["transform-es2015-modules-commonjs", { "loose": true }], | ||
"transform-object-rest-spread", | ||
"transform-react-jsx", | ||
"syntax-jsx" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
var glob = require('glob') | ||
var fs = require('fs') | ||
var es3ify = require('es3ify') | ||
|
||
glob('./@(lib|dist)/**/*.js', function (err, files) { | ||
if (err) { | ||
throw err | ||
} | ||
|
||
files.forEach(function (file) { | ||
fs.readFile(file, 'utf8', function (err, data) { | ||
if (err) { | ||
throw err | ||
} | ||
|
||
fs.writeFile(file, es3ify.transform(data), function (err) { | ||
if (err) { | ||
throw err | ||
} | ||
|
||
console.log('es3ified ' + file) // eslint-disable-line no-console | ||
}) | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
const Provider = require('./components/Provider') | ||
const connect = require('./components/connect') | ||
import Provider from './components/Provider' | ||
import connect from './components/connect' | ||
|
||
module.exports = { Provider, connect } | ||
export { Provider, connect } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
const { PropTypes } = require('react') | ||
import { PropTypes } from 'react' | ||
|
||
const storeShape = PropTypes.shape({ | ||
export default PropTypes.shape({ | ||
subscribe: PropTypes.func.isRequired, | ||
dispatch: PropTypes.func.isRequired, | ||
getState: PropTypes.func.isRequired | ||
}) | ||
|
||
module.exports = storeShape |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
import { bindActionCreators } from 'redux' | ||
|
||
function wrapActionCreators(actionCreators) { | ||
export default function wrapActionCreators(actionCreators) { | ||
return dispatch => bindActionCreators(actionCreators, dispatch) | ||
} | ||
|
||
module.exports = wrapActionCreators |
65a80f8
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.
What's this about?Ah, to enable loose mode https://twitter.com/dan_abramov/status/694512168788692992 (thread).
65a80f8
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.
If you want to stick with babel instead of es3ify you can use:
http://babeljs.io/docs/plugins/transform-es3-member-expression-literals/
http://babeljs.io/docs/plugins/transform-es3-property-literals/
65a80f8
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.
@jdalton Unfortunately they are broken: https://phabricator.babeljs.io/T2817
65a80f8
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.
Broke since Nov. @thejameskyle
65a80f8
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.
Here as well: https://phabricator.babeljs.io/T6863