babel-plugin-transform-react-binding
babel-plugin-transform-react-binding copied to clipboard
The npm package doesn't contain the compiled version
Hey,
the current version of the npm package (0.1.2) does not contain the compiled version (lib/index.js), meaning any require of this package will fail.
Could you publish a new version w/ the compiled source please?
Thanks!
I get ReferenceError: Unknown plugin "transform-react-binding" specified in "base" when attempting to load my app with this plugin, is that the same issue as this by any chance?
I was too lazy to fork it, so I made a very shameful hack. If anyone else chances across this, beware that it's pretty terrible, but it's the quickest fix.
Add this to the scripts section of your package.json:
"postinstall": "cd node_modules/babel-plugin-transform-react-binding && npm install && npm run build"
Basically, since the compiled version wasn't added to this plugin's package, this script runs the build on this particular plugin manually after you install.
If you've already installed, just manually run it: npm run postinstall.
Hopefully this package can be fixed soon; otherwise, maybe someone wants to fork it and publish their own with the fix? I might later anyway, since I can't keep this horrible postinstall hook forever.
@mmiller42 : You probably don't want to use this plugin. It has many bugs in its transforms that will break your code at some point (it doesn't walk the AST correctly and changes things it isn't supposed to change).
I spend many hours trying to track down bugs in my code that were due this plugin, spare yourself that time (note that the author says [this is] '😱 Experimental! 😱').
Good to know. This would be an extremely useful Babel extension, do you know if anyone has made something similar that does this binding?
Yeah, i did, kinda at least. After I tried this one and realized it's really buggy i started to write my own plugin to accomplish the same task. Never got to finish it tho, but I'll think about picking the development up again or just pushlishing it in it's current state. Ran out of time :-/
Awesome! I'm surprised to see so little traction with this plugin, seems like a major nice-to-have in the React world.
@SimonSelg Any progress with your plugin?