Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: support React #314

Open
coyotemarin opened this issue Jun 22, 2015 · 6 comments
Open

feature request: support React #314

coyotemarin opened this issue Jun 22, 2015 · 6 comments

Comments

@coyotemarin
Copy link

I'm using CoffeeScript for my startup, SpendRight and really appreciate being able to use coffee-mode in Emacs. I'd love to use React as well (compiling it with @jsdf's coffee-react compiler), but I don't have a working coffee-react mode for Emacs.

For plain JSX (i.e. JavaScript with React), the React project recommends just using web-mode.el, though there is also a jsx-mode, created by @abicky.

I haven't worked on emacs modes before, so I really have no idea if combining one emacs mode with another is easy or difficult. If it is relatively easy, I would totally appreciate it. :)

(I'm also the maintainer of mrjob and get feature requests all the time, so if you don't have the time or have different priorities for your project, I totally understand where you're coming from.)

@coyotemarin coyotemarin changed the title feature request: support react feature request: support React Jun 22, 2015
@syohex
Copy link
Collaborator

syohex commented Jun 24, 2015

I don't understand React well. What feature should we implement for supporting React ?
syntax highlight ? indentation ? others ?

@coyotemarin
Copy link
Author

Just indentation would be awesome. Right now, if I try to have a block of JSX (basically an HTML template) in the middle of my coffeescript, it messes up the indentation of any coffeescript code below it.

@jasonm23
Copy link

IIRC the CoffeeScript dialect of JSX is called CSX (could be wrong!)

Edit: wrong ... it's cjsx

@jasonm23
Copy link

@ibrahima
Copy link
Contributor

I'm curious enough to take a stab at this when I get some time, maybe this weekend or next... it seems js2-mode apparently has support for inline JSX now. I think just fixing indentation would be awesome, and syntax highlighting would be sweet as well. I wonder if something like MuMaMo would work, but I feel like that's more heavyweight of an approach than we really need.

(Note that I haven't worked with major modes before, but I've done a smattering of elisp here and there, so no idea how long it would take me to figure out what even needs to be done).

@coyotemarin
Copy link
Author

That would be cool. Not urgent for me anymore; CoffeeScript's syntax is clean enough that you can create very readable code just using short names for React functions and CoffeeScript's indentation-based syntax.

CoffeeScript can be a bit brittle though; sometimes surprising things happen when you leave out a comma. So CJSX would probably be a bit more maintainable with proper editor support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants