-
Notifications
You must be signed in to change notification settings - Fork 131
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
Please consider users' proposals/ideas or move the JSX spec to an independent organization #119
Comments
JSX's success as a non-standard syntax extension has been largely due to its stability which has let a wide variety of tooling develop in compatible way. Often with even better cross-compatibility that standard language features. Particularly parsing is something that is difficult to fork which is why syntax stability is particularly important. Where as transforms can be pluggable syntax can't as easily be pluggable. Syntax also conflicts with extensions that TC39, Flow and TypeScript wants to do. So it's important to the whole ecosystem that not too many permutations become popular. JSX 2.0 was an attempt to unify a lot of different changes into one cohesive one so there would at least only be two versions to support instead of many. Unfortunately, while it had a lot of upvotes here, it also had a lot of concerns elsewhere and didn't provide enough value. There were also other ideas popping up that wouldn't necessarily neatly fit into this. So to avoid having to also do a JSX 3.0, it kind of fizzled out. So the lack of activity here is very intentional. In terms of stewarding going forward. I believe that the next step for JSX is to make it into a TC39 proposal where it can reach further stability. That's the natural ownership org for this extension to the language since it's highly integrated with other possible language features and risks conflicting with other syntax. Perhaps not in its current form though. Perhaps even as a macro. |
I'm not disputing this at all, it's quite true. However, updating JSX's syntax to implement some new features from ES6+ should (IMO) absolutely be performed. I'd absolutely like to preserve backwards-compatibility as much as feasible in order to avoid breaking existing plugins.
Agreed. At least with Babel, some of the issues mentioned in the original comment should be relatively simple to implement.
See below for a possible solution.
This pretty much sums up why I listed the "uncontroversial" proposals, based on things that had a significant number of upvotes and minimal downvotes.
I agree this would be the best way forward, but I follow TC39 proposals quite closely, and personally don't think this would be feasible. Do you think TC39 would consider a JSX-style syntax? We're both well aware of the fact that JSX by itself doesn't actually do anything, it necessitates a transform to do anything useful. Given the wide variety of things JSX can transform into, what would this even do? DOM is not ECMAScript, so TC39 wouldn't spec that, and WHATWG certainly wouldn't expand syntax singlehandedly. Perhaps TC39 could create reserved syntax, in the same way it was reserved the type annotation syntax TypeScript uses.
Not entirely sure what you mean by this. If TC39 could get onboard with an expansion of reserved syntax to include JSX, that would obviously be ideal. Then all future changes could be done annually as with other syntax changes. In the meantime, I personally believe some updating should take place independently. |
I went through the list of issues that you posted and all of them have a number of outstanding unanswered questions in them.
|
I can't speak as to the difficulty of syntax highlighters, as I've never created one. Parsers should be able to handle it if comments are sufficiently restricted (such as within another JSX node). As to semantics, that's not a JSX problem, it's React's (for you, at least). At last with how Babel works, the parser would create a comment node in the AST, and it would be up to the transformer to determine what happens.
I don't necessarily agree with this one either, but it does have 100 upvotes.
As with above, this would be up to the transformers, no? In Babel, a quick test shows that HTML entities are decoded, but there's still
Waiting for further development with
For this, at least, it seems like it should be removed if for no other reason than nothing supports it.
Not sure where exactly was discussed, but if there's other things that can it can be expanded to, even better. Numeric literals are just an obvious starting point.
Of course it's best to avoid future syntax conflicts, but given that JSX controls its own portion, it could disallow decorators, private fields, etc. inside the opening element declaration (some options wouldn't make much sense, anyways). Lit HTML currently uses a prefixed |
@sebmarkbage Which interpretation do you mean here?
If it's the first, just turn off the Issues tab in this repo, or add a template indicating that users should expect to be largely ignored. |
Lack of activity, meaning that we don’t just add something because it seems like a good idea at the time. It needs to be well motivated and needed. We tend to answer and follow up on issues when there are new points or someone actively driving a proposal. My frustration has been that there are a lot of drive-by comments on these issues that just ignore the unanswered questions above and rehash previous points. It gets tiring. I admit I’ve been bad at answering those threads. Especially since it’s usually new people you have to rehash it with every time. Feels a bit like es-discuss. It might be helpful to have a small working group for that purpose. |
@jhpratt Do you mind if we follow up on each one at their specific issue so we can keep the thread going there? |
I'd very much like a working group; it certainly doesn't need to be anything like TC39, but an independent group that's able to determine if something is worthwhile would be great. Feel free to follow up in individual issues if you'd prefer. |
@sebmarkbage have you given much thought about a jsx working group? A couple of community folks, some from react, some from babel, some from typescript. The lack of progress in the spec is very disheartening. |
There are a number of proposals that have been open for years. After quickly going through the list of open issues, here's a few that don't seem too controversial that have been open for multiple years.
A number of these proposals were put forth together in October 2016 in JSX 2.0 (203 👍, 3 👎). It was locked in December 2016 after minimal input/feedback from maintainers.
What I am asking is simple: consider these suggestions and proposals. All of the issues I've linked have widespread support and would allow the use of JSX by wider audiences.
The lack of responsiveness, even after pinging users who are otherwise active on GitHub, is unacceptable. If there is a lack of activity on these or other issues in the coming days and weeks, I intend to create a competing specification in the newly created @jsx-spec organization. I expect the JavaScript community to understand that specifications need updating, and the failure to do so under Facebook's control is holding a number of projects back.
The text was updated successfully, but these errors were encountered: