Skip to content

Conversation

RSO
Copy link

@RSO RSO commented Dec 10, 2015

While reviewing the output of the transform I noticed that the transform lost all attributes for elements that use the React.__spread helper. I decided to fix this and make the transform throw an error when it doesn't recognise a certain attribute. This way we can be more sure that things don't fall through.

@RSO
Copy link
Author

RSO commented Dec 10, 2015

I should probably rebase one of these PRs once the other is landed.

@cpojer
Copy link
Member

cpojer commented Dec 10, 2015

yeah, I'm sorry, you need to rebase again :) Thanks for the contribution, may I ask where you are using this? :)

Remon Oldenbeuving added 3 commits December 11, 2015 10:07
While reviewing the output of the JSX transform I noticed that `React.__spread` attributes not only weren't ignored, they caused all attributes to be lost. I figured that it would probably be better if the transform errors when it doesn't recognize input.
@RSO RSO force-pushed the create-element-to-jsx/support-react-spread branch from 6390a9e to 9140737 Compare December 11, 2015 09:07
@RSO
Copy link
Author

RSO commented Dec 11, 2015

Not a problem!

I've been actively investigating transforming our (@Hacker0x01) codebase from CoffeeScript (CJSX) to ES2015 by using transforms to turn the ES5 output into ES2015. Currently most of my work lives in https://github.com/Hacker0x01/espresso, but I have plans of removing all the CLI helper stuff and making it a repository filled with transforms (and tests), just like this repository. I want to do this because I plan on running all transforms one by one to make sure there aren't any unforeseen cases that may break (as the assumptions on which some transforms are based are pretty loose).

I'm demoing the outcome of my investigations to my team next week, so I'll know after that if/when we decide to go forward with this :-).

Thank you for your amazing JSConf talk, it was the spark that ignited this whole project!

cpojer added a commit that referenced this pull request Dec 11, 2015
…pread Support React.__spread/Object.assign in JSX transform
@cpojer cpojer merged commit 3c1a99a into reactjs:master Dec 11, 2015
@cpojer
Copy link
Member

cpojer commented Dec 11, 2015

oh man, this is really awesome. We talked about building a CS to JS converter, also using jscodeshift, mainly just out of hate ;) Keep up the good work!

@fkling
Copy link
Member

fkling commented Dec 11, 2015

@RSO: This looks great! Also let us know if you have any suggestions for jscodeshift.

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

4 participants