Skip to content

Commit fd77828

Browse files
skevyfacebook-github-bot-4
authored andcommitted
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 facebook/fbjs#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 facebook/react-native#5084 Reviewed By: bestander Differential Revision: D2803288 Pulled By: davidaurelio fb-gh-sync-id: fd257958ee2f8696eebe9048c1e7628c168bf4a2 shipit-source-id: fd257958ee2f8696eebe9048c1e7628c168bf4a2
1 parent 54e6576 commit fd77828

File tree

2 files changed

+0
-31
lines changed

2 files changed

+0
-31
lines changed

blacklist.js

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -17,36 +17,6 @@ var sharedBlacklist = [
1717
'node_modules/react/lib/React.js',
1818
'node_modules/react/lib/ReactDOM.js',
1919

20-
// For each of these fbjs files (especially the non-forks/stubs), we should
21-
// consider deleting the conflicting copy and just using the fbjs version.
22-
//
23-
// fbjs forks:
24-
'node_modules/fbjs/lib/Map.js',
25-
'node_modules/fbjs/lib/Promise.js',
26-
'node_modules/fbjs/lib/fetch.js',
27-
// fbjs stubs:
28-
'node_modules/fbjs/lib/ErrorUtils.js',
29-
'node_modules/fbjs/lib/URI.js',
30-
// fbjs modules:
31-
'node_modules/fbjs/lib/Deferred.js',
32-
'node_modules/fbjs/lib/PromiseMap.js',
33-
'node_modules/fbjs/lib/UserAgent.js',
34-
'node_modules/fbjs/lib/areEqual.js',
35-
'node_modules/fbjs/lib/base62.js',
36-
'node_modules/fbjs/lib/crc32.js',
37-
'node_modules/fbjs/lib/everyObject.js',
38-
'node_modules/fbjs/lib/fetchWithRetries.js',
39-
'node_modules/fbjs/lib/filterObject.js',
40-
'node_modules/fbjs/lib/flattenArray.js',
41-
'node_modules/fbjs/lib/forEachObject.js',
42-
'node_modules/fbjs/lib/isEmpty.js',
43-
'node_modules/fbjs/lib/nullthrows.js',
44-
'node_modules/fbjs/lib/removeFromArray.js',
45-
'node_modules/fbjs/lib/resolveImmediate.js',
46-
'node_modules/fbjs/lib/someObject.js',
47-
'node_modules/fbjs/lib/sprintf.js',
48-
'node_modules/fbjs/lib/xhrSimpleDataSerializer.js',
49-
5020
// Those conflicts with the ones in fbjs/. We need to blacklist the
5121
// internal version otherwise they won't work in open source.
5222
'downstream/core/CSSCore.js',

react-packager/src/Resolver/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ class Resolver {
8585
(opts.blacklistRE && opts.blacklistRE.test(filepath));
8686
},
8787
providesModuleNodeModules: [
88-
'fbjs',
8988
'react',
9089
'react-native',
9190
// Parse requires AsyncStorage. They will

0 commit comments

Comments
 (0)