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
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

View File

@ -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', () => {