diff --git a/Rakefile b/Rakefile
index 44a3e114..6a7454ba 100644
--- a/Rakefile
+++ b/Rakefile
@@ -4,12 +4,12 @@ require('yaml')
desc "generate js from jsx"
task :js do
- system "../bin/jsx _js js"
+ system "../bin/jsx --harmony _js js"
end
desc "watch js"
task :watch do
- Process.spawn "../bin/jsx --watch _js js"
+ Process.spawn "../bin/jsx --watch --harmony _js js"
Process.waitall
end
diff --git a/_js/examples/hello.js b/_js/examples/hello.js
index b71430a8..61a5e732 100644
--- a/_js/examples/hello.js
+++ b/_js/examples/hello.js
@@ -1,12 +1,12 @@
-var HELLO_COMPONENT = "\
-var HelloMessage = React.createClass({\n\
- render: function() {\n\
- return
Hello {this.props.name}
;\n\
- }\n\
-});\n\
-\n\
-React.render(, mountNode);\
-";
+var HELLO_COMPONENT = `
+var HelloMessage = React.createClass({
+ render: function() {
+ return Hello {this.props.name}
;
+ }
+});
+
+React.render(, mountNode);
+`;
React.render(
,
diff --git a/_js/examples/markdown.js b/_js/examples/markdown.js
index 956d81de..cc43db49 100644
--- a/_js/examples/markdown.js
+++ b/_js/examples/markdown.js
@@ -1,35 +1,35 @@
-var MARKDOWN_COMPONENT = "\
-var converter = new Showdown.converter();\n\
-\n\
-var MarkdownEditor = React.createClass({\n\
- getInitialState: function() {\n\
- return {value: 'Type some *markdown* here!'};\n\
- },\n\
- handleChange: function() {\n\
- this.setState({value: this.refs.textarea.getDOMNode().value});\n\
- },\n\
- render: function() {\n\
- return (\n\
- \n\
-
Input
\n\
-
\n\
-
Output
\n\
-
\n\
-
\n\
- );\n\
- }\n\
-});\n\
-\n\
-React.render(, mountNode);\
-";
+var MARKDOWN_COMPONENT = `
+var converter = new Showdown.converter();
+
+var MarkdownEditor = React.createClass({
+ getInitialState: function() {
+ return {value: 'Type some *markdown* here!'};
+ },
+ handleChange: function() {
+ this.setState({value: this.refs.textarea.getDOMNode().value});
+ },
+ render: function() {
+ return (
+
+ );
+ }
+});
+
+React.render(, mountNode);
+`;
React.render(
,
diff --git a/_js/examples/timer.js b/_js/examples/timer.js
index c54e8b4f..44b5981a 100644
--- a/_js/examples/timer.js
+++ b/_js/examples/timer.js
@@ -1,26 +1,26 @@
-var TIMER_COMPONENT = "\
-var Timer = React.createClass({\n\
- getInitialState: function() {\n\
- return {secondsElapsed: 0};\n\
- },\n\
- tick: function() {\n\
- this.setState({secondsElapsed: this.state.secondsElapsed + 1});\n\
- },\n\
- componentDidMount: function() {\n\
- this.interval = setInterval(this.tick, 1000);\n\
- },\n\
- componentWillUnmount: function() {\n\
- clearInterval(this.interval);\n\
- },\n\
- render: function() {\n\
- return (\n\
- Seconds Elapsed: {this.state.secondsElapsed}
\n\
- );\n\
- }\n\
-});\n\
-\n\
-React.render(, mountNode);\
-";
+var TIMER_COMPONENT = `
+var Timer = React.createClass({
+ getInitialState: function() {
+ return {secondsElapsed: 0};
+ },
+ tick: function() {
+ this.setState({secondsElapsed: this.state.secondsElapsed + 1});
+ },
+ componentDidMount: function() {
+ this.interval = setInterval(this.tick, 1000);
+ },
+ componentWillUnmount: function() {
+ clearInterval(this.interval);
+ },
+ render: function() {
+ return (
+ Seconds Elapsed: {this.state.secondsElapsed}
+ );
+ }
+});
+
+React.render(, mountNode);
+`;
React.render(
,
diff --git a/_js/examples/todo.js b/_js/examples/todo.js
index 6c628cea..2ecea761 100644
--- a/_js/examples/todo.js
+++ b/_js/examples/todo.js
@@ -1,40 +1,41 @@
-var TODO_COMPONENT = "\
-var TodoList = React.createClass({\n\
- render: function() {\n\
- var createItem = function(itemText) {\n\
- return {itemText};\n\
- };\n\
- return {this.props.items.map(createItem)}
;\n\
- }\n\
-});\n\
-var TodoApp = React.createClass({\n\
- getInitialState: function() {\n\
- return {items: [], text: ''};\n\
- },\n\
- onChange: function(e) {\n\
- this.setState({text: e.target.value});\n\
- },\n\
- handleSubmit: function(e) {\n\
- e.preventDefault();\n\
- var nextItems = this.state.items.concat([this.state.text]);\n\
- var nextText = '';\n\
- this.setState({items: nextItems, text: nextText});\n\
- },\n\
- render: function() {\n\
- return (\n\
- \n\
-
TODO
\n\
- \n\
- \n\
- \n\
- );\n\
- }\n\
-});\n\
-React.render(, mountNode);\
-";
+var TODO_COMPONENT = `
+var TodoList = React.createClass({
+ render: function() {
+ var createItem = function(itemText) {
+ return {itemText};
+ };
+ return {this.props.items.map(createItem)}
;
+ }
+});
+var TodoApp = React.createClass({
+ getInitialState: function() {
+ return {items: [], text: ''};
+ },
+ onChange: function(e) {
+ this.setState({text: e.target.value});
+ },
+ handleSubmit: function(e) {
+ e.preventDefault();
+ var nextItems = this.state.items.concat([this.state.text]);
+ var nextText = '';
+ this.setState({items: nextItems, text: nextText});
+ },
+ render: function() {
+ return (
+
+
TODO
+
+
+
+ );
+ }
+});
+
+React.render(, mountNode);
+`;
React.render(
,