Skip to content

Commit

Permalink
Revert "Enable JSX files extension"
Browse files Browse the repository at this point in the history
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.

facebook#5233 (comment)
Closes facebook#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 0893d07
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class DependencyGraph {
platforms: platforms || [],
preferNativePlatform: preferNativePlatform || false,
cache,
extensions: extensions || ['js', 'jsx', 'json'],
extensions: extensions || ['js', 'json'],
mocksPattern,
extractRequires,
shouldThrowOnUnresolvedErrors,
Expand Down
1 change: 0 additions & 1 deletion packager/react-packager/src/Server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ class Server {
dir: dir,
globs: [
'**/*.js',
'**/*.jsx',
'**/*.json',
].concat(assetGlobs),
};
Expand Down

0 comments on commit 0893d07

Please sign in to comment.