facebook / jsx

The JSX specification is a XML-like syntax extension to ECMAScript.
http://facebook.github.io/jsx/
1.96k stars 133 forks source link

JSXTextCharacter may not be '>' or '}' either #2

Closed syranide closed 10 years ago

syranide commented 10 years ago

See facebook/esprima#36.

cc @sebmarkbage

sebmarkbage commented 10 years ago

Yea, can you separate the issues? :) I foresee there being more discussion on each individual part and then we can close out a whole thread individually.

syranide commented 10 years ago

Done, cleaned up this PR.

sebmarkbage commented 10 years ago

I guess this makes sense but I'd like to get input and commitment to change implementations from @RReverser and @jeffmo before pulling this in.

RReverser commented 10 years ago

@sebmarkbage It's no problem to change, but from @syranide's PR into esprima it looks like this also removes elements-as-attributes which conflicts with feature that we two agree on.

@syranide, is it possible to introduce these rule changes without dropping that feature (at least until further separate discussions)?

syranide commented 10 years ago

@RReverser Hmm? This shouldn't affect elements-as-attributes, this only rejects orphaned > and } (EDIT) in text.

RReverser commented 10 years ago

@syranide I'm talking about facebook/esprima#36 that you mentioned in first post in this thread. As far as I can see from https://github.com/facebook/esprima/pull/36/files, in that PR you also removed element-as-attr-value from fbtest.js, so I wondered if that appeared in the same commit because those are linked issues or was there any other reason.

syranide commented 10 years ago

@RReverser Aha, now I see what you mean. No that is not because I "broke" elements-as-attribute but simply because that test includes an orphaned > and I just assumed that it's what it was for. I've restored the test and removed the orphaned >.

<LeftRight left=<a /> right=<b>monkeys /**>** gorillas</b> />
sebmarkbage commented 10 years ago

In the standards world, there's another level of stability when at least two independent implementations have implemented this.

As a guideline, we could make changes to the spec once at least two implementations have implemented the feature in their parser. What do you guys think? That shows commitment to support the feature.

RReverser commented 10 years ago

@sebmarkbage Sure, it's not a problem. Btw, } was already an unsupported part of JSXText in my implementation (due to implementation specifics), so just need to add >. Will do a bit later.

sebmarkbage commented 10 years ago

Cool. Rebase and I'll pull.