Skip to content
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

Allowing .jsx extensions in webpack #394

Closed
wants to merge 1 commit into from

Conversation

arnarthor
Copy link

I don't know if this is wanted, but I've used .jsx to identify components in personal and work projects.

We usually have it as a rule of thumb to have .jsx for files that export React Components and .js for files that do not include jsx syntax. This is both helpful to identify component files while scanning the project and is helpful when using editors that identify .jsx files to use JSX syntax highlighting instead of regular javascript highlight.

If this is not wanted feel free to close this 👍

@ghost ghost added the CLA Signed label Aug 7, 2016
@arnarthor
Copy link
Author

I completely forgot to read your comments in the issues regarding this before opening the PR.

If you still think this should not be applied feel free to close it like stated above 😄

@gaearon
Copy link
Contributor

gaearon commented Aug 7, 2016

when using editors that identify .jsx files to use JSX syntax highlighting instead of regular javascript highlight.

Are there any editors that can’t be reconfigured to use .js instead?

@arnarthor
Copy link
Author

No I guess all editors can be configured to do that. For me I haven't done that myself because the theme I'm using in Atom doesn't have the same highlighting for pure JS when using JSX.

Like I said, this is not a strong preference for me, just wanted to suggest it since I use it at work and in my own projects.

I have done my fair share of these setups so I feel comfortable ejecting my app to get this nitpick in.

@gaearon
Copy link
Contributor

gaearon commented Aug 8, 2016

I haven't done that myself because the theme I'm using in Atom doesn't have the same highlighting for pure JS when using JSX.

The bigger problem is that JSX theme is usually not just "JSX".

Most "JSX" themes highlight all of the modern JS including some extensions (like Flow, async/await, ES6 etc). And most "JS" themes don't even support ES6.

This is why making "JSX" themes default for .js would make more sense to me because generally they tend to be more up-to-date, and it's a strict superset of JS.

Does this logic apply in your case?

@arnarthor
Copy link
Author

Yup, that sounds about right.

I've gotten used to my theme for .js and .jsx being while it's definitely not a problem to switch over.
Closing this as a result then 👍

@arnarthor arnarthor closed this Aug 8, 2016
@gaearon
Copy link
Contributor

gaearon commented Sep 3, 2016

FYI we support JSX extension since 0.4.1 even though we don’t recommend it.
Read the release notes.

@lock lock bot locked and limited conversation to collaborators Jan 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants