{"action":"opened","issue":{"url":"https://api.github.com/repos/MozillaFoundation/mofo-example-app/issues/54","labels_url":"https://api.github.com/repos/MozillaFoundation/mofo-example-app/issues/54/labels{/name}","comments_url":"https://api.github.com/repos/MozillaFoundation/mofo-example-app/issues/54/comments","events_url":"https://api.github.com/repos/MozillaFoundation/mofo-example-app/issues/54/events","html_url":"https://github.com/MozillaFoundation/mofo-example-app/issues/54","id":60670944,"number":54,"title":"Should .js files be processed as JSX?","user":{"login":"toolness","id":124687,"avatar_url":"https://avatars.githubusercontent.com/u/124687?v=3","gravatar_id":"","url":"https://api.github.com/users/toolness","html_url":"https://github.com/toolness","followers_url":"https://api.github.com/users/toolness/followers","following_url":"https://api.github.com/users/toolness/following{/other_user}","gists_url":"https://api.github.com/users/toolness/gists{/gist_id}","starred_url":"https://api.github.com/users/toolness/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toolness/subscriptions","organizations_url":"https://api.github.com/users/toolness/orgs","repos_url":"https://api.github.com/users/toolness/repos","events_url":"https://api.github.com/users/toolness/events{/privacy}","received_events_url":"https://api.github.com/users/toolness/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-11T14:55:25Z","updated_at":"2015-03-11T14:55:25Z","closed_at":null,"body":"Currently, mofo-example-app assumes JS contains standards-compliant JS and that .JSX files contain JSX. This is a very reasonable way of approaching things, in my opinion.\r\n\r\nHowever, we did run into some dragons when we wanted to create `index.jsx` files in directories and load them via a reference to the directory they're in (e.g. so that `require('foo')` would actually load `foo/index.jsx`). This doesn't work by default, but *could* work if `.js` files were allowed to have `.jsx` in them.\r\n\r\nThat's just one example... there are other advantages to allowing JSX in `.js` files, but there are also disadvantages, which we discussed a bit in https://github.com/mozilla/teach.webmaker.org/pull/238#issuecomment-78269006.\r\n\r\nWe also noticed that @k88hudson's [react-web-app](https://github.com/k88hudson/react-web-app) uses `.js` for JSX files, so it seems the opinions of mofo engineers might be split here too.\r\n\r\nAnyhow, I just filed this issue so we can consciously make an explicit decision about it. I don't really care which particular one we land on--both approaches seem to have their benefits and drawbacks--but it'd be nice if all of mofo used the same practice, with some kind of rationale to back it up. (Perhaps this conversation has already been had, in which case I apologize.)"}}