mirror of https://github.com/status-im/metro.git
Remove knowledge of fbjs from the packager
Summary: As spicyj mentioned in commit 6a838a4, the ideal state of affairs when it comes to consuming `react` and `fbjs` from NPM is for the packager not to have knowledge of either package. This PR addresses the `fbjs` part of that, and relies on https://github.com/facebook/fbjs/pull/95. **DO NOT MERGE** until #95 (or a variation) is in `fbjs` and is released to npm. This PR does several things: 1. Adds stub modules within RN that expose `fbjs` modules to be required using Haste. After discussing a few ideas with spicyj, this seemed like a good option to keep internal FB devs happy (and not make them change the way they write JS), but allow for removing packager complexity and fit in better with the NPM ecosystem. Note -- it skips stubbing `fetch`, `ExecutionEnvironment`, and `ErrorUtils`, due to the fact that these need to have Native specific implementations, and there's no reason for those implementations to exist in `fbjs`. 2. Removes the modules that were previously being used in lieu of their `fbjs` eq Closes https://github.com/facebook/react-native/pull/5084 Reviewed By: bestander Differential Revision: D2803288 Pulled By: davidaurelio fb-gh-sync-id: fd257958ee2f8696eebe9048c1e7628c168bf4a2 shipit-source-id: fd257958ee2f8696eebe9048c1e7628c168bf4a2
This commit is contained in:
parent
54e6576199
commit
fd7782849e
30
blacklist.js
30
blacklist.js
|
@ -17,36 +17,6 @@ var sharedBlacklist = [
|
|||
'node_modules/react/lib/React.js',
|
||||
'node_modules/react/lib/ReactDOM.js',
|
||||
|
||||
// For each of these fbjs files (especially the non-forks/stubs), we should
|
||||
// consider deleting the conflicting copy and just using the fbjs version.
|
||||
//
|
||||
// fbjs forks:
|
||||
'node_modules/fbjs/lib/Map.js',
|
||||
'node_modules/fbjs/lib/Promise.js',
|
||||
'node_modules/fbjs/lib/fetch.js',
|
||||
// fbjs stubs:
|
||||
'node_modules/fbjs/lib/ErrorUtils.js',
|
||||
'node_modules/fbjs/lib/URI.js',
|
||||
// fbjs modules:
|
||||
'node_modules/fbjs/lib/Deferred.js',
|
||||
'node_modules/fbjs/lib/PromiseMap.js',
|
||||
'node_modules/fbjs/lib/UserAgent.js',
|
||||
'node_modules/fbjs/lib/areEqual.js',
|
||||
'node_modules/fbjs/lib/base62.js',
|
||||
'node_modules/fbjs/lib/crc32.js',
|
||||
'node_modules/fbjs/lib/everyObject.js',
|
||||
'node_modules/fbjs/lib/fetchWithRetries.js',
|
||||
'node_modules/fbjs/lib/filterObject.js',
|
||||
'node_modules/fbjs/lib/flattenArray.js',
|
||||
'node_modules/fbjs/lib/forEachObject.js',
|
||||
'node_modules/fbjs/lib/isEmpty.js',
|
||||
'node_modules/fbjs/lib/nullthrows.js',
|
||||
'node_modules/fbjs/lib/removeFromArray.js',
|
||||
'node_modules/fbjs/lib/resolveImmediate.js',
|
||||
'node_modules/fbjs/lib/someObject.js',
|
||||
'node_modules/fbjs/lib/sprintf.js',
|
||||
'node_modules/fbjs/lib/xhrSimpleDataSerializer.js',
|
||||
|
||||
// Those conflicts with the ones in fbjs/. We need to blacklist the
|
||||
// internal version otherwise they won't work in open source.
|
||||
'downstream/core/CSSCore.js',
|
||||
|
|
|
@ -85,7 +85,6 @@ class Resolver {
|
|||
(opts.blacklistRE && opts.blacklistRE.test(filepath));
|
||||
},
|
||||
providesModuleNodeModules: [
|
||||
'fbjs',
|
||||
'react',
|
||||
'react-native',
|
||||
// Parse requires AsyncStorage. They will
|
||||
|
|
Loading…
Reference in New Issue