Skip to content

Commit 41884e1

Browse files
davidaurelioFacebook Github Bot 2
authored andcommitted
Remove knowledge of fbjs from the packager
Summary:Follow-up to react/react-native#5084 This… - changes all requires within RN to `require('fbjs/lib/…')` - updates `.flowconfig` - updates `packager/blacklist.js` - adapts tests - removes things from `Libraries/vendor/{core,emitter}` that are also in fbjs - removes knowledge of `fbjs` from the packager Closes react/react-native#5084 public Reviewed By: bestander Differential Revision: D2926835 fb-gh-sync-id: 2095e22b2f38e032599d1f2601722b3560e8b6e9 shipit-source-id: 2095e22b2f38e032599d1f2601722b3560e8b6e9
1 parent 9401d98 commit 41884e1

6 files changed

Lines changed: 11 additions & 11 deletions

File tree

src/container/__tests__/RelayRenderer_renderArgs-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ describe('RelayRenderer.renderArgs', () => {
203203
const {retry} = render.mock.calls[1][0];
204204
expect(typeof retry).toBe('function');
205205
expect(() => retry()).toThrowError(
206-
'RelayRenderer: You tried to call `retry`, but the last request did ' +
206+
'Invariant Violation: RelayRenderer: You tried to call `retry`, but the last request did ' +
207207
'not fail. You can only call this when the last request has failed.'
208208
);
209209
});

src/mutation/__tests__/RelayMutationQueue-test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ describe('RelayMutationQueue', () => {
166166
var transaction = mutationQueue.createTransaction(mockMutation1);
167167
transaction.commit();
168168
expect(() => transaction.commit()).toThrowError(
169-
'RelayMutationTransaction: Only transactions with status ' +
169+
'Invariant Violation: RelayMutationTransaction: Only transactions with status ' +
170170
'`UNCOMMITTED` can be comitted.'
171171
);
172172
});
@@ -322,7 +322,7 @@ describe('RelayMutationQueue', () => {
322322
expect(failureCallback1).toBeCalled();
323323
expect(failureCallback2).toBeCalled();
324324
expect(() => transaction1.getStatus()).toThrowError(
325-
'RelayMutationQueue: `0` is not a valid pending transaction ID.'
325+
'Invariant Violation: RelayMutationQueue: `0` is not a valid pending transaction ID.'
326326
);
327327
expect(transaction2.getStatus()).toBe(
328328
RelayMutationTransactionStatus.COLLISION_COMMIT_FAILED
@@ -427,7 +427,7 @@ describe('RelayMutationQueue', () => {
427427
RelayMutationTransactionStatus.COMMIT_FAILED
428428
);
429429
expect(() => transaction2.getStatus()).toThrowError(
430-
'RelayMutationQueue: `1` is not a valid pending transaction ID.'
430+
'Invariant Violation: RelayMutationQueue: `1` is not a valid pending transaction ID.'
431431
);
432432
expect(transaction3.getStatus()).toBe(
433433
RelayMutationTransactionStatus.COLLISION_COMMIT_FAILED

src/query/__tests__/RelayQL-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ describe('RelayQL', () => {
9898
}
9999
`;
100100
}).toThrowError(
101-
'RelayQL: Invalid argument `size` supplied via template substitution. ' +
101+
'Invariant Violation: RelayQL: Invalid argument `size` supplied via template substitution. ' +
102102
'Instead, use an inline variable (e.g. `comments(count: $count)`).'
103103
);
104104
});

src/store/__tests__/RelayRecordWriter-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ describe('RelayRecordWriter', () => {
172172
expect(() => {
173173
store.deleteField('1', 'name', null);
174174
}).toThrowError(
175-
'RelayRecordWriter.deleteField(): Expected record `1` to exist ' +
175+
'Invariant Violation: RelayRecordWriter.deleteField(): Expected record `1` to exist ' +
176176
'before deleting field `name`.'
177177
);
178178
});

src/store/__tests__/readRelayQueryData-test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ describe('readRelayQueryData', () => {
599599
`);
600600
expect(
601601
() => readData(getStoreData({records}), query, 'story_id')
602-
).toThrowError(error);
602+
).toThrowError('Invariant Violation: ' + error);
603603

604604
// Note that `pageInfo` also triggers the error...
605605
const pageInfoFragment = Relay.QL`
@@ -620,7 +620,7 @@ describe('readRelayQueryData', () => {
620620
`);
621621
expect(
622622
() => readData(getStoreData({records}), query, 'story_id')
623-
).toThrowError(error);
623+
).toThrowError('Invariant Violation: ' + error);
624624

625625
// ...but not `count`:
626626
query = getNode(Relay.QL`fragment on Story{feedback{likers{count}}}`);
@@ -662,12 +662,12 @@ describe('readRelayQueryData', () => {
662662
fragment on Story{feedback{likers{${fragmentReference}}}}
663663
`);
664664
expect(() => readData(getStoreData({records}), query, 'story_id'))
665-
.toThrowError(error);
665+
.toThrowError('Invariant Violation: ' + error);
666666

667667
let fragment = Relay.QL`fragment on LikersOfContentConnection{pageInfo}`;
668668
query = getNode(Relay.QL`fragment on Story{feedback{likers{${fragment}}}}`);
669669
expect(() => readData(getStoreData({records}), query, 'story_id'))
670-
.toThrowError(error);
670+
.toThrowError('Invariant Violation: ' + error);
671671

672672
fragment = Relay.QL`fragment on LikersOfContentConnection{count}`;
673673
query = getNode(Relay.QL`fragment on Story{feedback{likers{${fragment}}}}`);

src/tools/__mocks__/RelayTestUtils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ var RelayTestUtils = {
421421
toFailInvariant() {
422422
return {
423423
compare(actual, expected) {
424-
expect(actual).toThrowError(expected);
424+
expect(actual).toThrowError('Invariant Violation: ' + expected);
425425
return {
426426
pass: true,
427427
};

0 commit comments

Comments
 (0)