Skip to content
This repository has been archived by the owner on Sep 11, 2018. It is now read-only.

Use .js instead of .jsx #37

Closed
amorino opened this issue Aug 30, 2015 · 6 comments
Closed

Use .js instead of .jsx #37

amorino opened this issue Aug 30, 2015 · 6 comments

Comments

@amorino
Copy link

amorino commented Aug 30, 2015

A lot of examples and boilerplates, even the Redux official examples are not using .jsx for components.

@dvdzkwsk
Copy link
Owner

dvdzkwsk commented Sep 1, 2015

I'd like to hear more on this before just changing all the files in the project. Personally, the .jsx extension has been helpful since my IDE can make assumptions based off the of the file extension, and even simple things like file icon extensions help separate what in a project is a react component and what's just vanilla JS, for lack of a better term.

@nodkz
Copy link
Contributor

nodkz commented Sep 1, 2015

I think for newbie is better use .jsx. After some time they transparently may migrate to the .js names, when their religion changes.

Jsx is not vanilla js, so lets get to newbies chance to clarify (googlify) what is jsx, what is es6 and etc.

@nhagen
Copy link

nhagen commented Sep 7, 2015

+1 for .js. I don't think its that important, but I get the sense that the community is more and more not making the distinction. JSX isn't vanilla js, but neither is ES6/ES7, and we're not using .es6. The pattern seems to be that if its getting transpiled down to vanilla js the .js extension is okay.

I also think people who are able to grasp all of the things in this library are people who are generally familiar with React by now (aka, they've changed their religion, as nodkz says).

The biggest kicker might be IDE compatibility though. I have zero issues with JSX in .js in vim, but I'm interested to get a better idea of what other IDE's are capable of.

@dvdzkwsk
Copy link
Owner

dvdzkwsk commented Sep 7, 2015

@nhagen I really like the argument about .es6 as I've never been a fan of that extension. Personally the only thing holding me back right now is the nice file icons I get in my IDE, but thinking about it that's a pretty silly reason to make decision for a starter kit.

So, that said, .js it is. I'll update the project later. I do have one more question, however: what about naming conventions? A lot of React projects seem to be going with ProperCased file names for components, which is a divergence from the previously popular dash-separated names. My team has actually switched to the former, since the file name then matches the class name, but I'd be curious to hear what others think.

@nhagen
Copy link

nhagen commented Sep 7, 2015

Hm. I've always used thisCamelCase, but it looks like facebook uses ProperCase, so thats probably what everyone should be doing for JSX.. Crap.

@dvdzkwsk
Copy link
Owner

dvdzkwsk commented Sep 7, 2015

Updated all .jsx files with #62.

@dvdzkwsk dvdzkwsk closed this as completed Sep 7, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants