-
Notifications
You must be signed in to change notification settings - Fork 50.2k
Add harmony transform support in browser (Fixes GH-1420) #1525
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
Conversation
I implemented this by checking for `type="text/jsx;harmony"`, since this has a bit of a cleaner implementation rather than parsing a JSON object out of a data attribute. If in the future there are other options to pass, it would make sense to move to a system like that. Along with adding support, there is also a new example added that's the basic-jsx example with Harmony syntax.
|
Looks good, although I wonder if it's really a good idea to use
|
|
I believe the spec [1] is ok with having optional parameters, such as: "text/jsx; harmony=true;". [1] http://en.wikipedia.org/wiki/Internet_media_type |
|
Ah you're definitely right, but unless I'm misinterpreting the spec, there's still kind of a complication as
EDIT: Researching a bit more it seems like |
|
I'm going to shoot down
|
|
Another option: we could implement it with a |
|
Nah, let's do |
|
Done! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
|
Could you rebase? #1558 made some other changes in there so this doesn't apply cleanly anymore. |
|
@zpao Rebased. Let me know if you want me to squash the commits. |
|
@zpao It just struck me, if we want to do this properly, it should really be Do we care? Don't ask me :) But it could make the case for something like |
I implemented this by checking for
type="text/jsx;harmony", since this has a bit of a cleaner implementation rather than parsing a JSON object out of a data attribute. If in the future there are other options to pass, it would make sense to move to a system like that.Along with adding support, there is also a new example added that's the basic-jsx example with harmony syntax. Feedback on implementation totally welcome! 😄