Permalink
Browse files

Revert "Enable JSX files extension"

Summary:
This reverts commit 8887492.

The original commit didn't handle cases like .(ios|android|native).js, and vjeux is in favor of standardizing on .js instead of custom extensions like .jsx or .es6 everywhere.

> Unfortunately this pull request doesn't implement with .ios.jsx. But, when/if it does, it raises more questions like what happens if you have both ios.js and ios.jsx?
>
> Sorry to chime in super late but I actually think that this is harmful to support .jsx extension. We now live in a world where we have many transforms for es6, flow, jsx... Why would we add .jsx but not .flow or .es6. Supporting more extensions is only going to fragment tools even more.

#5233 (comment)
Closes #5296

Reviewed By: svcscm

Differential Revision: D2830784

Pulled By: bestander

fb-gh-sync-id: 9a7a4745803acbcbc5dba176b971c629c904bacd
  • Loading branch information...
ide authored and facebook-github-bot-5 committed Jan 25, 2016
1 parent dde5e02 commit 0893d07db197b4f78752f982abbc568c6c0c7419
@@ -350,8 +350,6 @@ class ResolutionRequest {
file = potentialModulePath + '.native.js';
} else if (this._fastfs.fileExists(potentialModulePath + '.js')) {
file = potentialModulePath + '.js';
} else if (this._fastfs.fileExists(potentialModulePath + '.jsx')) {
file = potentialModulePath + '.jsx';
} else if (this._fastfs.fileExists(potentialModulePath + '.json')) {
file = potentialModulePath + '.json';
} else {
@@ -55,7 +55,7 @@ class DependencyGraph {
platforms: platforms || [],
preferNativePlatform: preferNativePlatform || false,
cache,
extensions: extensions || ['js', 'jsx', 'json'],
extensions: extensions || ['js', 'json'],
mocksPattern,
extractRequires,
shouldThrowOnUnresolvedErrors,
@@ -151,7 +151,6 @@ class Server {
dir: dir,
globs: [
'**/*.js',
'**/*.jsx',
'**/*.json',
].concat(assetGlobs),
};

0 comments on commit 0893d07

Please sign in to comment.