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 ( +
+

Input

+