Skip to content

Commit

Permalink
Deploy 0.254.0 to xplat
Browse files Browse the repository at this point in the history
Reviewed By: SamChou19815

Differential Revision: D66278779

fbshipit-source-id: 01dec1dc844607afa8f650c5acdebc6d5d5739d2
  • Loading branch information
pieterv authored and facebook-github-bot committed Nov 21, 2024
1 parent b65f53d commit 3c5b65c
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ untyped-import
untyped-type-import

[version]
^0.253.0
^0.254.0
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"eslint-plugin-relay": "1.8.3",
"eslint-plugin-relay-internal": "link:./packages/eslint-plugin-relay-internal",
"fbjs": "^3.0.2",
"flow-bin": "^0.253.0",
"flow-bin": "^0.254.0",
"glob": "^7.1.1",
"graphql": "15.3.0",
"gulp": "4.0.2",
Expand Down
14 changes: 14 additions & 0 deletions packages/react-relay/__tests__/LiveResolvers-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,7 @@ test('Outer resolvers do not overwrite subscriptions made by inner resolvers (re
});

TestRenderer.act(() => jest.runAllImmediates());
// $FlowFixMe[incompatible-use]
expect(renderer.toJSON()).toEqual(null);

// Calling increment here should be ignored by Relay. However, if there are
Expand All @@ -411,19 +412,22 @@ test('Outer resolvers do not overwrite subscriptions made by inner resolvers (re
GLOBAL_STORE.dispatch({type: 'INCREMENT'});
});
TestRenderer.act(() => jest.runAllImmediates());
// $FlowFixMe[incompatible-use]
expect(renderer.toJSON()).toEqual(null);

// Revering optimistic update puts inner back into a state where its
// fragment is valid. HOWEVER, if a dangling subscription has marked inner
// as dirty, we will try to read from a LiveValue that does not exist.
TestRenderer.act(() => update.dispose());
// $FlowFixMe[incompatible-use]
expect(renderer.toJSON()).toEqual('1');

// Not part of the repro, but just to confirm: We should now be resubscribed...
TestRenderer.act(() => {
GLOBAL_STORE.dispatch({type: 'INCREMENT'});
});
TestRenderer.act(() => jest.runAllImmediates());
// $FlowFixMe[incompatible-use]
expect(renderer.toJSON()).toEqual('2');
});

Expand Down Expand Up @@ -496,6 +500,7 @@ test("Resolvers without fragments aren't reevaluated when their parent record up
TestRenderer.act(() => jest.runAllImmediates());

expect(counterNoFragmentResolver.callCount).toBe(initialCallCount + 1);
// $FlowFixMe[incompatible-use]
expect(renderer.toJSON()).toEqual('0');
});

Expand Down Expand Up @@ -561,10 +566,12 @@ test('Can suspend', () => {
});
// If do not trigger `act` here, the renderer is still `0`. Probably, a React thing...
TestRenderer.act(() => jest.runAllImmediates());
// $FlowFixMe[incompatible-use]
expect(renderer.toJSON()).toEqual('Loading...');
TestRenderer.act(() => {
GLOBAL_STORE.dispatch({type: 'INCREMENT'});
});
// $FlowFixMe[incompatible-use]
expect(renderer.toJSON()).toEqual('2');
});

Expand Down Expand Up @@ -633,10 +640,12 @@ test('Can suspend with resolver that uses live resolver', () => {
});
// If do not trigger `act` here, the renderer is still `0`. Probably, a React thing...
TestRenderer.act(() => jest.runAllImmediates());
// $FlowFixMe[incompatible-use]
expect(renderer.toJSON()).toEqual('Loading...');
TestRenderer.act(() => {
GLOBAL_STORE.dispatch({type: 'INCREMENT'});
});
// $FlowFixMe[incompatible-use]
expect(renderer.toJSON()).toEqual('Alice 2');
TestRenderer.act(() => {
const operationDescriptor = createOperationDescriptor(
Expand All @@ -647,6 +656,7 @@ test('Can suspend with resolver that uses live resolver', () => {
me: {id: '1', name: 'Bob', __typename: 'User'},
});
});
// $FlowFixMe[incompatible-use]
expect(renderer.toJSON()).toEqual('Bob 2');
});

Expand Down Expand Up @@ -1444,10 +1454,12 @@ describe('client-only fragments', () => {
GLOBAL_STORE.dispatch({type: 'INCREMENT'});
});
TestRenderer.act(() => jest.runAllImmediates());
// $FlowFixMe[incompatible-use]
expect(renderer.toJSON()).toEqual('Loading...');
TestRenderer.act(() => {
GLOBAL_STORE.dispatch({type: 'INCREMENT'});
});
// $FlowFixMe[incompatible-use]
expect(renderer.toJSON()).toEqual('2');
});

Expand Down Expand Up @@ -1477,6 +1489,7 @@ describe('client-only fragments', () => {
GLOBAL_STORE.dispatch({type: 'INCREMENT'});
});
TestRenderer.act(() => jest.runAllImmediates());
// $FlowFixMe[incompatible-use]
expect(renderer.toJSON()).toEqual('Loading...');
environment.applyUpdate({
storeUpdater: store => {
Expand All @@ -1490,6 +1503,7 @@ describe('client-only fragments', () => {
}).toThrowError(
'Unexpected LiveState value returned from Relay Resolver internal field `RELAY_RESOLVER_LIVE_STATE_VALUE`. It is likely a bug in Relay, or a corrupt state of the relay store state Field Path `counter_suspends_when_odd`. Record `{"__id":"client:1:counter_suspends_when_odd","__typename":"__RELAY_RESOLVER__","__resolverError":null,"__resolverValue":{"__LIVE_RESOLVER_SUSPENSE_SENTINEL":true},"__resolverLiveStateDirty":true}`.',
);
// $FlowFixMe[incompatible-use]
expect(renderer.toJSON()).toEqual('Loading...');
});
});
Expand Down
6 changes: 6 additions & 0 deletions packages/react-relay/__tests__/RelayResolverModel-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ describe.each([['New', useFragment]])(
completeTodo('todo-1');
jest.runAllImmediates();
});
// $FlowFixMe[incompatible-use]
expect(renderer.toJSON()).toEqual('Test todo - green');
});

Expand Down Expand Up @@ -328,13 +329,15 @@ describe.each([['New', useFragment]])(
});
expect(LiveColorSubscriptions.activeSubscriptions.length).toBe(1);

// $FlowFixMe[incompatible-use]
expect(renderer.toJSON()).toEqual('Test todo - green');

TestRenderer.act(() => {
removeTodo('todo-1');
jest.runAllImmediates();
});

// $FlowFixMe[incompatible-use]
expect(renderer.toJSON()).toEqual(null);
// Run GC to will remove "orphan" records and unsubscribe if they have live resolver subscriptions
store.scheduleGC();
Expand Down Expand Up @@ -378,6 +381,7 @@ describe.each([['New', useFragment]])(
changeDescription('todo-1', 'Changed todo description text');
jest.runAllImmediates();
});
// $FlowFixMe[incompatible-use]
expect(renderer.toJSON()).toEqual('[x] Changed todo description text');
});

Expand Down Expand Up @@ -671,13 +675,15 @@ describe.each([['New', useFragment]])(
setIsHuman(false);
jest.runAllImmediates();
});
// $FlowFixMe[incompatible-use]
expect(renderer.toJSON()).toEqual('robot:0');

TestRenderer.act(() => {
chargeBattery();
setIsHuman(true);
jest.runAllImmediates();
});
// $FlowFixMe[incompatible-use]
expect(renderer.toJSON()).toEqual('human:0');

TestRenderer.act(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ it.skip('suspends then updates when the query and component load', () => {
expect(entryPoint.root.load).toBeCalledTimes(1);
expect(receivedProps).not.toBe(null);
expect(receivedProps?.props).toBe(otherProps);
// $FlowFixMe[incompatible-use]
expect(renderer.toJSON()).toEqual('Zuck');
});

Expand Down Expand Up @@ -355,6 +356,7 @@ it('re-renders without reloading when non-prefetch props change', () => {
</RelayEnvironmentProvider>,
);
});
// $FlowFixMe[incompatible-use]
expect(renderer.toJSON()).toEqual('Zuck');
expect(Component).toBeCalledTimes(2);
expect(entryPoint.getPreloadProps).toBeCalledTimes(1);
Expand Down Expand Up @@ -404,6 +406,7 @@ it.skip('re-renders and reloads when prefetch params change', () => {
</RelayEnvironmentProvider>,
);
});
// $FlowFixMe[incompatible-use]
expect(renderer.toJSON()).toEqual('Fallback');
expect(Component).toBeCalledTimes(2);
expect(entryPoint.getPreloadProps).toBeCalledTimes(2);
Expand All @@ -422,6 +425,7 @@ it.skip('re-renders and reloads when prefetch params change', () => {
});
dataSource.complete();
TestRenderer.act(() => jest.runAllImmediates());
// $FlowFixMe[incompatible-use]
expect(renderer.toJSON()).toEqual('Mark');
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,7 @@ it('disposes all entry points if the callback is called, the component suspends,
entryPointLoaderCallback({});
});
const secondDispose = dispose;
// $FlowFixMe[incompatible-use]
expect(outerInstance.toJSON()).toEqual('fallback');

// TODO(T19754110): This fails in OSS where we have concurrent mode, but might
Expand Down Expand Up @@ -609,6 +610,7 @@ it('disposes all entry points if the component suspends, another entry point is
// *even though the component is in a suspended state.* As such, it commits and
// the entry point is disposed.
expect(renderCount).toBeLessThanOrEqual(2);
// $FlowFixMe[incompatible-use]
expect(outerInstance.toJSON()).toEqual('fallback');
expect(dispose).not.toHaveBeenCalled();
ReactTestRenderer.act(() => outerInstance.unmount());
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3864,10 +3864,10 @@ flatted@^3.1.0:
resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.6.tgz#022e9218c637f9f3fc9c35ab9c9193f05add60b2"
integrity sha512-0sQoMh9s0BYsm+12Huy/rkKxVu4R1+r96YX5cG44rHV0pQ6iC3Q+mkoMFaGWObMFYQxCVT+ssG1ksneA2MI9KQ==

flow-bin@^0.253.0:
version "0.253.0"
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.253.0.tgz#5b5150ad9a68560c1b8ace225b7d30e1a6469346"
integrity sha512-D1EY3n+YNTG9PK15VGHuwxTPMJncUizVDjFS7vm6mIj1qoo7DDDMa8poEgpuZS0yKVBMWoM2IXlWYyZ9v5MVvg==
flow-bin@^0.254.0:
version "0.254.0"
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.254.0.tgz#8d35c0f8ff3700215b63c55f520079ef7e602d13"
integrity sha512-JqnsagGayC1u6yWQGkwbiaDV7FqUTL4Hle3/bgsjxStD/nTn9/qFz5jF9l4Lus8zyzIM21mm822MijBwBnEKdA==

flush-write-stream@^1.0.2:
version "1.1.1"
Expand Down

0 comments on commit 3c5b65c

Please sign in to comment.