From a17f6c8ae1481d8b657c9b2fa8e5cbcd97316a9d Mon Sep 17 00:00:00 2001 From: Dimitri Kennedy Date: Thu, 20 Nov 2014 14:56:09 -0500 Subject: [PATCH 1/7] =?UTF-8?q?add=20.cjsx=20extension=20for=20Facebook?= =?UTF-8?q?=E2=80=99s=20JSX=20in=20coffescript?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/linguist/languages.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 4d36d8d0..cc7fa4f0 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -451,6 +451,7 @@ CoffeeScript: - ._coffee - .cson - .iced + - .cjsx filenames: - Cakefile interpreters: From f5953a09da2cbb38e992adfbd5479674b0b03586 Mon Sep 17 00:00:00 2001 From: Dimitri Kennedy Date: Thu, 20 Nov 2014 16:48:22 -0500 Subject: [PATCH 2/7] add example cjsx file --- samples/CoffeeScript/example.cjsx | 40 +++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 samples/CoffeeScript/example.cjsx diff --git a/samples/CoffeeScript/example.cjsx b/samples/CoffeeScript/example.cjsx new file mode 100644 index 00000000..7e30f745 --- /dev/null +++ b/samples/CoffeeScript/example.cjsx @@ -0,0 +1,40 @@ +###* @cjsx React.DOM ### +define 'myProject.myComponent', [ + 'React' + 'myProject.ExampleStore' + 'myProject.ExampleActions' + 'myProject.ReactExampleTable' +], (React, ExampleStore, ExampleActions, ReactExampleTable ) -> + + ReactListDetail = React.createClass + mixins: [ListenMixin] + + getInitialState: -> + rows: ExampleStore.getRows() + meta: ExampleStore.getMeta() + + componentWillMount: -> + @listenTo ExampleStore + + componentDidMount: -> + ExampleActions.getExampleData() + + onStoreChange: -> + if this.isMounted() + @setState + rows: ExampleStore.getRows() + meta: ExampleStore.getMeta() + + componentWillUnmount: -> + @stopListening ExampleStore + + render: -> +
+
+ {@state.title} +
+ +
From 1d69228872c56d91764d513fe3a7a367073bdd73 Mon Sep 17 00:00:00 2001 From: Dimitri Kennedy Date: Thu, 20 Nov 2014 16:49:48 -0500 Subject: [PATCH 3/7] change component name --- samples/CoffeeScript/example.cjsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/CoffeeScript/example.cjsx b/samples/CoffeeScript/example.cjsx index 7e30f745..def9cf2f 100644 --- a/samples/CoffeeScript/example.cjsx +++ b/samples/CoffeeScript/example.cjsx @@ -1,12 +1,12 @@ ###* @cjsx React.DOM ### -define 'myProject.myComponent', [ +define 'myProject.ReactExampleComponent', [ 'React' 'myProject.ExampleStore' 'myProject.ExampleActions' 'myProject.ReactExampleTable' ], (React, ExampleStore, ExampleActions, ReactExampleTable ) -> - ReactListDetail = React.createClass + ReactExampleComponent = React.createClass mixins: [ListenMixin] getInitialState: -> From 79c1d21a0fa45c18056ba6a0a07dbdfacde168ff Mon Sep 17 00:00:00 2001 From: Dimitri Kennedy Date: Thu, 20 Nov 2014 17:08:10 -0500 Subject: [PATCH 4/7] move cjsx before iced --- lib/linguist/languages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index cc7fa4f0..c90afec7 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -447,11 +447,11 @@ CoffeeScript: - coffee - coffee-script extensions: + - .cjsx - .coffee - ._coffee - .cson - .iced - - .cjsx filenames: - Cakefile interpreters: From 9d3b9964b55ba0b7dd69b6bdd38a94e725a59c9f Mon Sep 17 00:00:00 2001 From: Dimitri Kennedy Date: Thu, 20 Nov 2014 17:08:21 -0500 Subject: [PATCH 5/7] move cjsx before iced --- lib/linguist/languages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index c90afec7..cda27774 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -447,10 +447,10 @@ CoffeeScript: - coffee - coffee-script extensions: - - .cjsx - .coffee - ._coffee - .cson + - .cjsx - .iced filenames: - Cakefile From 2352ce77c9803d104b5c7eb0ac3d88a5d01c10e1 Mon Sep 17 00:00:00 2001 From: Dimitri Kennedy Date: Thu, 20 Nov 2014 17:38:38 -0500 Subject: [PATCH 6/7] put cjsx at the top --- lib/linguist/languages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index cda27774..c90afec7 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -447,10 +447,10 @@ CoffeeScript: - coffee - coffee-script extensions: + - .cjsx - .coffee - ._coffee - .cson - - .cjsx - .iced filenames: - Cakefile From b283548c0f4e2737061fac2814d7a0e365f27040 Mon Sep 17 00:00:00 2001 From: Dimitri Kennedy Date: Thu, 20 Nov 2014 18:36:08 -0500 Subject: [PATCH 7/7] =?UTF-8?q?reorder=20again=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/linguist/languages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index c90afec7..fe707369 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -447,9 +447,9 @@ CoffeeScript: - coffee - coffee-script extensions: - - .cjsx - .coffee - ._coffee + - .cjsx - .cson - .iced filenames: