Skip to content

Commit

Permalink
Remove knowledge of fbjs from the packager
Browse files Browse the repository at this point in the history
Summary:Follow-up to facebook/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 facebook/react-native#5084

public

Reviewed By: bestander

Differential Revision: D2926835

fb-gh-sync-id: 2095e22b2f38e032599d1f2601722b3560e8b6e9
shipit-source-id: 2095e22b2f38e032599d1f2601722b3560e8b6e9
  • Loading branch information
davidaurelio authored and venepe committed Mar 7, 2016
1 parent 737fdc7 commit ac6f5cd
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/container/__tests__/RelayRenderer_renderArgs-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ describe('RelayRenderer.renderArgs', () => {
const {retry} = render.mock.calls[1][0];
expect(typeof retry).toBe('function');
expect(() => retry()).toThrowError(
'RelayRenderer: You tried to call `retry`, but the last request did ' +
'Invariant Violation: RelayRenderer: You tried to call `retry`, but the last request did ' +
'not fail. You can only call this when the last request has failed.'
);
});
Expand Down
6 changes: 3 additions & 3 deletions src/mutation/__tests__/RelayMutationQueue-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ describe('RelayMutationQueue', () => {
var transaction = mutationQueue.createTransaction(mockMutation1);
transaction.commit();
expect(() => transaction.commit()).toThrowError(
'RelayMutationTransaction: Only transactions with status ' +
'Invariant Violation: RelayMutationTransaction: Only transactions with status ' +
'`UNCOMMITTED` can be comitted.'
);
});
Expand Down Expand Up @@ -322,7 +322,7 @@ describe('RelayMutationQueue', () => {
expect(failureCallback1).toBeCalled();
expect(failureCallback2).toBeCalled();
expect(() => transaction1.getStatus()).toThrowError(
'RelayMutationQueue: `0` is not a valid pending transaction ID.'
'Invariant Violation: RelayMutationQueue: `0` is not a valid pending transaction ID.'
);
expect(transaction2.getStatus()).toBe(
RelayMutationTransactionStatus.COLLISION_COMMIT_FAILED
Expand Down Expand Up @@ -427,7 +427,7 @@ describe('RelayMutationQueue', () => {
RelayMutationTransactionStatus.COMMIT_FAILED
);
expect(() => transaction2.getStatus()).toThrowError(
'RelayMutationQueue: `1` is not a valid pending transaction ID.'
'Invariant Violation: RelayMutationQueue: `1` is not a valid pending transaction ID.'
);
expect(transaction3.getStatus()).toBe(
RelayMutationTransactionStatus.COLLISION_COMMIT_FAILED
Expand Down
2 changes: 1 addition & 1 deletion src/query/__tests__/RelayQL-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ describe('RelayQL', () => {
}
`;
}).toThrowError(
'RelayQL: Invalid argument `size` supplied via template substitution. ' +
'Invariant Violation: RelayQL: Invalid argument `size` supplied via template substitution. ' +
'Instead, use an inline variable (e.g. `comments(count: $count)`).'
);
});
Expand Down
2 changes: 1 addition & 1 deletion src/store/__tests__/RelayRecordWriter-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ describe('RelayRecordWriter', () => {
expect(() => {
store.deleteField('1', 'name', null);
}).toThrowError(
'RelayRecordWriter.deleteField(): Expected record `1` to exist ' +
'Invariant Violation: RelayRecordWriter.deleteField(): Expected record `1` to exist ' +
'before deleting field `name`.'
);
});
Expand Down
8 changes: 4 additions & 4 deletions src/store/__tests__/readRelayQueryData-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ describe('readRelayQueryData', () => {
`);
expect(
() => readData(getStoreData({records}), query, 'story_id')
).toThrowError(error);
).toThrowError('Invariant Violation: ' + error);

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

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

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

fragment = Relay.QL`fragment on LikersOfContentConnection{count}`;
query = getNode(Relay.QL`fragment on Story{feedback{likers{${fragment}}}}`);
Expand Down
2 changes: 1 addition & 1 deletion src/tools/__mocks__/RelayTestUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ var RelayTestUtils = {
toFailInvariant() {
return {
compare(actual, expected) {
expect(actual).toThrowError(expected);
expect(actual).toThrowError('Invariant Violation: ' + expected);
return {
pass: true,
};
Expand Down

0 comments on commit ac6f5cd

Please sign in to comment.