-
Notifications
You must be signed in to change notification settings - Fork 13
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
Too easy to confuse jsx-mode with a mode for Facebook's JSX #13
Comments
Use emacs's own js-jsx-mode for React's jsx file. |
for anyone else looking to highlight JSX in context of React I used (add-to-list 'auto-mode-alist '("\\.jsx$" . web-mode))
(defadvice web-mode-highlight-part (around tweak-jsx activate)
(if (equal web-mode-content-type "jsx")
(let ((web-mode-enable-part-face nil))
ad-do-it)
ad-do-it)) |
My suggestion is simple: change the MELPA and README.md descriptions to describe what "major mode for JSX" means. Does it mean JSX the type-checked Javascript language? Does it mean JSX the extended syntax used by React.js? Does it mean JSX the "erlang application for consuming, producing and manipulating json"? Is it something to do with JSX Audio? Is it something to do with jsx (Java Serialization to XML)? ... |
I agree. It seems like this was here before React, but I think most people looking for JSX will be looking for React's JSX, so it would behoove the project owners to at least clarify somewhere that this is not related to React. |
+1 for clarifying language |
@jazzonmymind, thank you so much for your piece of code. However, it only seems to work for .jsx files. Is there any way to make it work for .js files? Changing .jsx$ for .js$ doesn't work. Thanks. |
Note that there's now a proper major mode for JSX files available on MELPA: https://github.com/felipeochoa/rjsx-mode |
jsx-mode.el had been created for JSX, an AltJS provided by DeNA, before JSX, an XML-like syntax extension, provided by Facebook was released, and I added its recipe by melpa#1013. However many people misunderstand that jsx-mode.el is for the XML-like syntax. cf. jsx/jsx-mode.el#13 In addition, the AltJS seems to be no longer maintained, so I think it is better to delete its recipe to avoid misunderstanding.
I'm sorry for the confusion. I've changed the title of README by #16. |
jsx-mode.el had been created for JSX, an AltJS provided by DeNA, before JSX, an XML-like syntax extension, provided by Facebook was released, and I added its recipe by #1013. However many people misunderstand that jsx-mode.el is for the XML-like syntax. cf. jsx/jsx-mode.el#13 In addition, the AltJS seems to be no longer maintained, so I think it is better to delete its recipe to avoid misunderstanding.
Installed from MELPA, assumed it was for the JSX that extends javascript to support XML literals. Maybe add something to the README and MELPA description that reads like "For JSX, the type-checked Javascipt language"? See also: #10.
The text was updated successfully, but these errors were encountered: