Skip to content

Commit

Permalink
Remove RelayFBPreloadedModules, error on overlapping modules
Browse files Browse the repository at this point in the history
Reviewed By: davidaurelio

Differential Revision: D4779671

fbshipit-source-id: f2dfeb696baab457769c22ca7ab28972270e5fc0
  • Loading branch information
javache authored and facebook-github-bot committed Mar 30, 2017
1 parent 7773f25 commit 7db16a4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packager/src/Bundler/Bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ function createGroups(ramGroups: Array<string>, lazyModules) {
// print a warning for each removed module
const parentNames = parents.map(byId.get, byId);
const lastName = parentNames.pop();
console.warn(
throw new Error(
/* $FlowFixMe: this assumes the element exists. */
`Module ${byId.get(moduleId)} belongs to groups ${
parentNames.join(', ')}, and ${lastName
Expand Down
11 changes: 4 additions & 7 deletions packager/src/Bundler/__tests__/Bundle-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,13 +330,10 @@ describe('Bundle', () => {

it('omits modules that are contained by more than one group', () => {
bundle = createBundle([fsLocation('React'), fsLocation('OtherFramework')]);
const {groups} = bundle.getUnbundle();
expect(groups).toEqual(new Map([
[idFor('React'),
new Set(['ReactFoo', 'ReactBar', 'cx'].map(idFor))],
[idFor('OtherFramework'),
new Set(['OtherFrameworkFoo', 'OtherFrameworkBar', 'crc32'].map(idFor))],
]));
expect(() => {
const {groups} = bundle.getUnbundle(); //eslint-disable-line no-unused-vars
}).toThrow(new Error(`Module ${fsLocation('invariant')} belongs to groups ${fsLocation('React')}` +
`, and ${fsLocation('OtherFramework')}. Removing it from all groups.`));
});

it('ignores missing dependencies', () => {
Expand Down

0 comments on commit 7db16a4

Please sign in to comment.