Skip to content

Commit

Permalink
We're not ready for ES6
Browse files Browse the repository at this point in the history
Lets re-evaluate in June next year when it's actually released
  • Loading branch information
cortesi committed Sep 16, 2014
1 parent 6bac154 commit 6efe1aa
Show file tree
Hide file tree
Showing 15 changed files with 176 additions and 169 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store
MANIFEST
/build
/dist
Expand All @@ -23,4 +24,4 @@ libpathod
node_modules
bower_components
*.compiled.js
*.map
*.map
74 changes: 41 additions & 33 deletions libmproxy/web/static/js/app.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 12 additions & 12 deletions web/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@ var path = {
'vendor/react-bootstrap/react-bootstrap.js'
],
app: [
'js/Dispatcher.es6.js',
'js/actions.es6.js',
'js/stores/base.es6.js',
'js/stores/SettingsStore.es6.js',
'js/stores/EventLogStore.es6.js',
'js/Connection.es6.js',
'js/components/Header.react.js',
'js/components/TrafficTable.react.js',
'js/components/EventLog.react.js',
'js/components/Footer.react.js',
'js/components/ProxyApp.react.js',
'js/dispatcher.js',
'js/actions.js',
'js/stores/base.js',
'js/stores/settingstore.js',
'js/stores/eventlogstore.js',
'js/connection.js',
'js/components/header.jsx',
'js/components/traffictable.jsx',
'js/components/eventlog.jsx',
'js/components/footer.jsx',
'js/components/proxyapp.jsx',
'js/app.js',
],
},
Expand Down Expand Up @@ -81,7 +81,7 @@ function scripts(files, filename, dev) {
return gulp.src(files, {base: "src", cwd: "src"})
.pipe(dev ? dont_break_on_errors(): gutil.noop())
.pipe(dev ? sourcemaps.init() : gutil.noop())
.pipe(react({harmony: true}))
.pipe(react({harmony: false}))
.pipe(concat(filename))
.pipe(!dev ? uglify() : gutil.noop())
.pipe(dev ? sourcemaps.write(".", {sourceRoot: "/static"}) : gutil.noop())
Expand Down
4 changes: 2 additions & 2 deletions web/src/js/actions.es6.js → web/src/js/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var ActionTypes = {
};

var SettingsActions = {
update(settings) {
update:function(settings) {
settings = _.merge({}, SettingsStore.getAll(), settings);
//TODO: Update server.

Expand All @@ -14,4 +14,4 @@ var SettingsActions = {
settings: settings
});
}
};
};
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
/** @jsx React.DOM */

var EventLog = React.createClass({
getInitialState() {
getInitialState: function() {
return {
log: []
};
},
componentDidMount() {
componentDidMount: function() {
this.log = EventLogStore.getView();
this.log.addListener("change", this.onEventLogChange);
},
componentWillUnmount() {
componentWillUnmount: function() {
this.log.removeListener("change", this.onEventLogChange);
this.log.close();
},
onEventLogChange() {
onEventLogChange: function() {
this.setState({
log: this.log.getAll()
});
},
close() {
close: function() {
SettingsActions.update({
showEventLog: false
});
},
render() {
var messages = this.state.log.map(row => (<div key={row.id}>{row.message}</div>));
render: function() {
//var messages = this.state.log.map(row => (<div key={row.id}>{row.message}</div>));
var messages = [];
return (
<div className="eventlog">
<pre>
Expand All @@ -35,4 +36,4 @@ var EventLog = React.createClass({
</div>
);
}
});
});
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/** @jsx React.DOM */

var Footer = React.createClass({
render(){
render: function(){
var mode = this.props.settings.mode;
return (
<footer>
{mode != "regular" ? <span className="label label-success">{mode} mode</span> : null}
</footer>
);
}
});
});
Loading

0 comments on commit 6efe1aa

Please sign in to comment.