-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CoffeeScript 1.11 now supports ES modules!
- Fixed all source code to use ES import/export - Added Babel build toolchain after CS compilation - npm run build will now build a CommonJS module (lib/) and an ES6 module (es/) - package.json includes a jsnext:main directive for ES6 imports - main now points at lib/ (no more git submodule free rides)
- Loading branch information
Showing
18 changed files
with
130 additions
and
88 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 +1,35 @@ | ||
{ "presets": ["es2015", "stage-1"] } | ||
{ | ||
"plugins": [ | ||
["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-object-rest-spread", | ||
"transform-es3-member-expression-literals", | ||
"transform-es3-property-literals" | ||
], | ||
"env": { | ||
"commonjs": { | ||
"plugins": [ | ||
["transform-es2015-modules-commonjs", { "loose": true }] | ||
] | ||
}, | ||
"es": { | ||
"plugins": [ | ||
] | ||
} | ||
} | ||
} |
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 |
---|---|---|
|
@@ -37,4 +37,6 @@ node_modules | |
|
||
# Build products | ||
dist | ||
lib | ||
lib/ | ||
build/ | ||
es/ |
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 |
---|---|---|
|
@@ -4,7 +4,9 @@ test/ | |
*.swp | ||
.DS_Store | ||
src/ | ||
coverage/ | ||
scripts/ | ||
build/ | ||
book.json | ||
coffeelint.json | ||
.eslintrc | ||
|
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 @@ | ||
/////////////////////////////////////////////////////////////////////// | ||
// ES5 EXPORT STUB | ||
/////////////////////////////////////////////////////////////////////// | ||
module.exports = require('./lib/ReduxComponent'); | ||
module.exports = require('./lib').ReduxComponent; |
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 @@ | ||
/////////////////////////////////////////////////////////////////////// | ||
// ES5 EXPORT STUB | ||
/////////////////////////////////////////////////////////////////////// | ||
module.exports = require('./lib/subtree').SubtreeMixin; | ||
module.exports = require('./lib').SubtreeMixin; |
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 @@ | ||
/////////////////////////////////////////////////////////////////////// | ||
// ES5 EXPORT STUB | ||
/////////////////////////////////////////////////////////////////////// | ||
module.exports = require('./lib/createClass'); | ||
module.exports = require('./lib').createClass; |
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 @@ | ||
/////////////////////////////////////////////////////////////////////// | ||
// ES5 EXPORT STUB | ||
/////////////////////////////////////////////////////////////////////// | ||
module.exports = require('./lib/subtree').createComponent; | ||
module.exports = require('./lib').createComponent; |
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,8 +1,4 @@ | ||
// Default exports for redux-components | ||
module.exports = { | ||
createClass: require('./createClass.js'), | ||
createComponent: require('./createComponent.js'), | ||
mountComponent: require('./mountComponent.js'), | ||
ReduxComponent: require('./ReduxComponent.js'), | ||
SubtreeMixin: require('./SubtreeMixin.js') | ||
}; | ||
/////////////////////////////////////////////////////////////////////// | ||
// ES5 EXPORT STUB | ||
/////////////////////////////////////////////////////////////////////// | ||
module.exports = require('./lib'); |
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 @@ | ||
/////////////////////////////////////////////////////////////////////// | ||
// ES5 EXPORT STUB | ||
/////////////////////////////////////////////////////////////////////// | ||
module.exports = require('./lib/mountComponent'); | ||
module.exports = require('./lib').mountComponent; |
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
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import applyMixin from './applyMixin' | ||
import createClass from './createClass' | ||
import DefaultMixin from './DefaultMixin' | ||
import mountComponent from './mountComponent' | ||
import ReduxComponent from './ReduxComponent' | ||
import { createComponent, SubtreeMixin } from './subtree' | ||
|
||
export { | ||
applyMixin | ||
createClass | ||
DefaultMixin | ||
mountComponent | ||
ReduxComponent | ||
createComponent | ||
SubtreeMixin | ||
} |
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,14 +1,8 @@ | ||
"use strict" | ||
_export = null | ||
|
||
defaultMounter = (store, componentInstance) -> | ||
store.replaceReducer(componentInstance.reducer) | ||
|
||
mountComponent = (store, componentInstance, path = [], mounter = defaultMounter) -> | ||
export default mountComponent = (store, componentInstance, path = [], mounter = defaultMounter) -> | ||
componentInstance.__mounter = mounter | ||
componentInstance.__willMount(store, path, null) | ||
mounter?(store, componentInstance) | ||
componentInstance.componentDidMount?() | ||
|
||
_export = mountComponent | ||
module.exports = _export |
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,15 +1,10 @@ | ||
"use strict" | ||
_export = null | ||
export assign = (dst, src) -> | ||
(if src.hasOwnProperty(k) then dst[k] = src[k]) for k of src; dst | ||
|
||
assign = (dst, src) -> (if src.hasOwnProperty(k) then dst[k] = src[k]) for k of src; dst | ||
export chain = (one, two) -> -> one.apply(@, arguments); two.apply(@, arguments) | ||
|
||
chain = (one, two) -> -> one.apply(@, arguments); two.apply(@, arguments) | ||
|
||
get = (object, path) -> | ||
export get = (object, path) -> | ||
index = 0; length = path.length | ||
while object? and index < length | ||
object = object[path[index++]] | ||
if (index is length) then object else undefined | ||
|
||
_export = { assign, chain, get } | ||
module.exports = _export |