You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered this issue when demoing to airbnb today.
Steps to repro:
create src/ dir
create regular js module src/React.js containing module.exports = 7; and src/Component.jsx which contains require('./React')
run: jsx -x jsx src/ src/ to build .js files alongside .jsx (a very common use case of this tool)
Observe React.js gets overwritten with a file that throws an exception
This manifests itself as: any time you pass something to -x that is not js, if you require React (which are js files) it will get overwritten.
This is very confusing. I think we really need to turn all of the magic off in this tool unless --relativize is provided. That includes debranching __DEV__, relativizing module names, and this sort of thing. That is, only the JSX desugaring should happen.
The text was updated successfully, but these errors were encountered:
If you are using bin/jsx independently, you may need to pass
--follow-requires to it if you rely on its dependency scanning.
Dependency scanning is still a good idea, but it's difficult to make it
work perfectly for everyone the first time they try bin/jsx.
Closesfacebook#131.
I encountered this issue when demoing to airbnb today.
Steps to repro:
src/
dirsrc/React.js
containingmodule.exports = 7;
andsrc/Component.jsx
which containsrequire('./React')
jsx -x jsx src/ src/
to build .js files alongside .jsx (a very common use case of this tool)This manifests itself as: any time you pass something to -x that is not js, if you require React (which are js files) it will get overwritten.
This is very confusing. I think we really need to turn all of the magic off in this tool unless --relativize is provided. That includes debranching
__DEV__
, relativizing module names, and this sort of thing. That is, only the JSX desugaring should happen.The text was updated successfully, but these errors were encountered: