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

Add support fo JSX syntax and React components #38

Open
hason opened this issue Mar 15, 2016 · 2 comments
Open

Add support fo JSX syntax and React components #38

hason opened this issue Mar 15, 2016 · 2 comments

Comments

@hason
Copy link
Contributor

hason commented Mar 15, 2016

We could make a listener for the HTML5 tags that start with an upper-case letter. For example

<CommentList />

should be replaced with

<div className="commentList">
    <Comment author="Pete Hunt">This is one comment</Comment>
    <Comment author="Jordan Walke">This is *another* comment</Comment>
</div>

and <Comment> with

<div className="comment">
    <h2 className="commentAuthor">{{ author }}</h2>
    {{ ... }}
</div>
@goetas
Copy link
Owner

goetas commented Mar 20, 2016

hm... looks an interesting idea... i tried years ago something similar using XSL transformations... it was a good period but rarely it worked in production without finding edge cases and developers that were not able to understand the concepts behind it..

JSP templates do something similar (more than 10 years ago)

@goetas
Copy link
Owner

goetas commented Mar 20, 2016

The idea/problem is where to define the logic to transform Comment into the corresponding html code.
The approach I have used years ago was to create series of transformations using XSL and XSLTProcessor class, so each tag (not only uppercase tags) can be transformed into arbitrary code.

The problem at that time was that XSL is a really xml oriented language and does not work so well with html/html5 hacks and impurities.

Any idea where store the logic?

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

No branches or pull requests

2 participants