-
Notifications
You must be signed in to change notification settings - Fork 47.2k
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
Change bin/jsx default file extension to .jsx #832
Comments
This is probably reasonable, though it'll break some people's current expectations. I do like that it would leave |
+1, we can then get rid of the docblock. |
I really wish we'd done this from the beginning. My only concern is for backwards compatibility. Maybe target this for the next minor version bump and make a big deal of it in the release notes? |
+1 for breaking change at next minor version bump. You're still < 1.0, so semver-wise it's acceptable - as long as it's well documented ;) Anyone who wanted to keep using |
Urgh. I just got caught out by this big time. Spent 30 minutes trying to figure this out before I realised that |
Agreed on all points above. I'll add that using |
As per [react recommendation](facebook/react#832)
As far as I understand, if you choose to use |
@koistya This depends on the bundler you're using. In Webpack, extensions can be configured explicitly in |
Oh, I get your point now. I don't really use an IDE. Regardless, I think such issues should be filed against IDEs themselves. If you use JSX, IDE already has to have some knowledge about it (e.g. how to parse it), so it's not too much to expect it to also follow JSX |
Feels suspiciously like the user agent string conundrum. JSX is distinctly not JavaScript, but we put it in |
It could give an error when no files are found, and the extension isn't explicitly set. I say error, as in non-zero exit code, so any CI servers that install the latest version implicitly will fail. Something like this,
|
Related: #2943 |
IDEs like Webstorm recognize JSX inside a |
We're deprecating react-tools so closing out. |
Currently, bin/jsx defaults to looking for
.js
files to which contain jsx content to compile. Whilst it's possible to override this usingjsx -x jsx ...
, I think that since jsx content is not valid JavaScript, using the.js
extension by default isn't ideal.Could we change
bin/jsx
to look for.jsx
files instead?Another advantage to this is that the generated
.js
files can live the same directory as the source.jsx
. This simplifies the generation of source maps files as well, because the path to the.jsx
is trivially relative to the generated.js
For example, given
foo.jsx
, runningjsx . .
would result in:The text was updated successfully, but these errors were encountered: