Remove RelayFBPreloadedModules, error on overlapping modules

Reviewed By: davidaurelio

Differential Revision: D4779671

fbshipit-source-id: f2dfeb696baab457769c22ca7ab28972270e5fc0
This commit is contained in:
Pieter De Baets 2017-03-30 16:35:21 -07:00 committed by Facebook Github Bot
parent 7773f25756
commit 7db16a4020
2 changed files with 5 additions and 8 deletions

View File

@ -420,7 +420,7 @@ function createGroups(ramGroups: Array<string>, lazyModules) {
// print a warning for each removed module // print a warning for each removed module
const parentNames = parents.map(byId.get, byId); const parentNames = parents.map(byId.get, byId);
const lastName = parentNames.pop(); const lastName = parentNames.pop();
console.warn( throw new Error(
/* $FlowFixMe: this assumes the element exists. */ /* $FlowFixMe: this assumes the element exists. */
`Module ${byId.get(moduleId)} belongs to groups ${ `Module ${byId.get(moduleId)} belongs to groups ${
parentNames.join(', ')}, and ${lastName parentNames.join(', ')}, and ${lastName

View File

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