-
Notifications
You must be signed in to change notification settings - Fork 132
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
Update spec for putting JSXFragment inside attributes #94
Conversation
The PR is correct but your example is wrong. That was already allowed. This PR makes it possible to have this: |
Ah, interesting. I wasn't aware of that - I guess Babel doesn't have that implemented yet. For example, if I try to transform |
We thought it would be good but then sorta never followed through. Now it seems more confusing than necessary. |
TypeScript also doesn't support it. Perhaps it would be a good idea to revisit whether this should be in the spec at all. 😄 |
Yeah, always putting anything that is not plain text in an expression
container definitely seems saner.
But now I’m not sure if this is a bias because of how it’s “always been
done”.
…On Fri, Oct 13, 2017 at 9:20 Daniel Rosenwasser ***@***.***> wrote:
TypeScript also doesn't support it. Perhaps it would be a good idea to
revisit whether this should be in the spec at all. 😄
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#94 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAEdfV3u3-fDCZAPU_hRx-B7ObesHhpmks5srqzhgaJpZM4P2URE>
.
|
@clemmy Babel's parser has always supported it, but the transform itself either never worked or broke at some point. We've fixed it for 7.x babel/babel#6004 |
Never worked. Can we hold off on adding this and make sure we get agreement that we want to turn it on? |
If that's what people think, sure. I just took the fact that it's in the spec at face value and figured we should fix it since it was a trivial bug causing the breakage in the first place. |
It wasn't a bug, we had never gotten agreement to add it to the transform. |
Alright, good to know. It does seem super confusing that it's in the spec text if that is the case. Should we also remove it from the spec then? Or at least mark it as deprecated and not recommended. |
I'm in favor of just adding it and starting to support it (if we have consensus). |
Personally, I'm not the biggest fan of that syntax - it looks super confusing. |
I spoke with folks from our team. It does seem somewhat confusing, and clearly rare if nobody has filed an issue in all the time that Babel & TypeScript have supported JSX. We'd be for removing from the spec, or putting it on a deprecation path. |
I raised this earlier at #53 without any success. We still haven't implemented elements in attribute positions in TypeScript and no one has cared. Given the lack of interest from anyone other than transpiler implementers it really seems like it ought to be removed before someone does implement it and cause a syntactic ambiguity that prevents more useful syntax from being added in the future. |
I think this is desired behavior and something that was overlooked in #93 - the idea is to allow fragments to be a part of JSX attributes. For example,
<MyComponent attrib={<></>} />
.