Skip to content

Commit

Permalink
Whitelist react-native-dom in haste/cli config defaults (#20393)
Browse files Browse the repository at this point in the history
Summary:
This adds `react-native-dom` to `hasteImpl.js` because it's not currently possible to configure it from an out of tree platform. Also adds the relevant `providesModuleNodeModules` and `platforms` values to the default RN CLI config. This should hopefully be able to be removed once better support for out of tree platforms is implemented.
Pull Request resolved: #20393

Differential Revision: D9007186

Pulled By: hramos

fbshipit-source-id: 67077860dc1fb191d80300fb980599ed76d5f91c
  • Loading branch information
vincentriemer authored and facebook-github-bot committed Jul 26, 2018
1 parent 253b29d commit c4bcca6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion jest/hasteImpl.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const path = require('path');
const ROOTS = [
path.resolve(__dirname, '..') + path.sep,
path.resolve(__dirname, '../../react-native-windows') + path.sep,
path.resolve(__dirname, '../../react-native-dom') + path.sep,
];

const BLACKLISTED_PATTERNS /*: Array<RegExp> */ = [
Expand All @@ -36,7 +37,7 @@ const NAME_REDUCERS /*: Array<[RegExp, string]> */ = [
// strip .js/.js.flow suffix
[/^(.*)\.js(\.flow)?$/, '$1'],
// strip .android/.ios/.native/.web suffix
[/^(.*)\.(android|ios|native|web|windows)$/, '$1'],
[/^(.*)\.(android|ios|native|web|windows|dom)$/, '$1'],
];

const haste = {
Expand Down
4 changes: 2 additions & 2 deletions local-cli/core/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ const defaultConfig = {
hasteImplModulePath: require.resolve('../../jest/hasteImpl'),

getPlatforms(): Array<string> {
return ['ios', 'android', 'windows', 'web'];
return ['ios', 'android', 'windows', 'web', 'dom'];
},

getProvidesModuleNodeModules(): Array<string> {
return ['react-native', 'react-native-windows'];
return ['react-native', 'react-native-windows', 'react-native-dom'];
},
};

Expand Down

0 comments on commit c4bcca6

Please sign in to comment.