-
Notifications
You must be signed in to change notification settings - Fork 449
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
cjsx-Support #608
Comments
It is more challenging than you think. The syntax of JSX expects the following: JavaScript that contains XML syntax where the XML syntax may have one of the following JavaScript syntaxes embedded directly:
Those three items are logically represented in the XML as tag attributes where the embedded JavaScript logic may or may not be associated with a proper attribute name. Then this logic might be JavaScript that contains further XML, such as JSX embedded directly in a JSX tag attribute. These things sound confusing, but its not so bad as long you have a JavaScript parser that can correctly identify when to switch to an XML parser and for that XML parser to know that it is receiving JSX syntax which may require switching back to the prior JavaScript parser at the appropriate points. Having the appropriate parsers talking together in the appropriate ways extensively is the hard part. You could probably use the same markup parser that is used for JSX here, but you would need to extend a coffeescript parser to push to the markup parser correctly. |
@prettydiff thanks for the explanation - I see now how it is more compilcated than I thought. Unfortunately I have 0 experience in writing/extending parsers - but the issue is not that pressing anyways. Thanks again. |
The CJSX project is deprecated in favor of using CoffeeScript2. Closing issue. |
As jsx and coffee are already supported, I hope cjsx is possible without too much work:
https://github.com/jsdf/coffee-react
Would be awesome! Thanks for your great work.
The text was updated successfully, but these errors were encountered: