Skip to content

Commit

Permalink
Revert "add flow suppressions"
Browse files Browse the repository at this point in the history
This reverts commit d9cbb5f.
  • Loading branch information
gorakong committed Nov 16, 2023
1 parent e7455c3 commit 41f2ca7
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 43 deletions.
2 changes: 1 addition & 1 deletion packages/core/core/src/RequestTracker.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ type RequestNode = {|
hash?: string,
|};

export type RequestType =
type RequestType =
| 'parcel_build_request'
| 'bundle_graph_request'
| 'asset_graph_request'
Expand Down
3 changes: 1 addition & 2 deletions packages/core/core/src/requests/ParcelConfigRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import {optionsProxy} from '../utils';
import ParcelConfig from '../ParcelConfig';
import {createBuildCache} from '../buildCache';
import {toProjectPath} from '../projectPath';
import type {RequestType} from '../RequestTracker';

type ConfigMap<K, V> = {[K]: V, ...};

Expand All @@ -53,7 +52,7 @@ type RunOpts<TResult> = {|

export type ParcelConfigRequest = {|
id: string,
type: RequestType,
type: 'parcel_config_request',
input: null,
run: (RunOpts<ConfigAndCachePath>) => Async<ConfigAndCachePath>,
|};
Expand Down
60 changes: 20 additions & 40 deletions packages/core/core/test/RequestTracker.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,14 @@ describe('RequestTracker', () => {
let tracker = new RequestTracker({farm, options});
await tracker.runRequest({
id: 'abc',
// $FlowFixMe[incompatible-call]
type: 'mock_request',
type: 'path_request',
run: () => {},
input: null,
});
let called = false;
await tracker.runRequest({
id: 'abc',
// $FlowFixMe[incompatible-call]
type: 'mock_request',
type: 'path_request',
run: () => {
called = true;
},
Expand All @@ -38,8 +36,7 @@ describe('RequestTracker', () => {
let tracker = new RequestTracker({farm, options});
await tracker.runRequest({
id: 'abc',
// $FlowFixMe[incompatible-call]
type: 'mock_request',
type: 'path_request',
run: () => {},
input: null,
});
Expand All @@ -50,8 +47,7 @@ describe('RequestTracker', () => {
let called = false;
await tracker.runRequest({
id: 'abc',
// $FlowFixMe[incompatible-call]
type: 'mock_request',
type: 'path_request',
run: () => {
called = true;
},
Expand All @@ -64,13 +60,11 @@ describe('RequestTracker', () => {
let tracker = new RequestTracker({farm, options});
await tracker.runRequest({
id: 'abc',
// $FlowFixMe[incompatible-call]
type: 'mock_request',
type: 'path_request',
run: async ({api}) => {
await api.runRequest({
id: 'xyz',
// $FlowFixMe[incompatible-call]
type: 'mock_request',
type: 'path_request',
run: () => {},
input: null,
});
Expand All @@ -94,8 +88,7 @@ describe('RequestTracker', () => {
await tracker
.runRequest({
id: 'abc',
// $FlowFixMe[incompatible-call]
type: 'mock_request',
type: 'path_request',
run: async () => {
await Promise.resolve();
throw new Error('woops');
Expand All @@ -117,13 +110,11 @@ describe('RequestTracker', () => {
let tracker = new RequestTracker({farm, options});
await tracker.runRequest({
id: 'abc',
// $FlowFixMe[incompatible-call]
type: 'mock_request',
type: 'path_request',
run: async ({api}) => {
await api.runRequest({
id: 'xyz',
// $FlowFixMe[incompatible-call]
type: 'mock_request',
type: 'path_request',
run: () => {},
input: null,
});
Expand All @@ -134,13 +125,11 @@ describe('RequestTracker', () => {
tracker.graph.invalidateNode(nodeId, INITIAL_BUILD);
await tracker.runRequest({
id: 'abc',
// $FlowFixMe[incompatible-call]
type: 'mock_request',
type: 'path_request',
run: async ({api}) => {
await api.runRequest({
id: '123',
// $FlowFixMe[incompatible-call]
type: 'mock_request',
type: 'path_request',
run: () => {},
input: null,
});
Expand All @@ -154,8 +143,7 @@ describe('RequestTracker', () => {
let tracker = new RequestTracker({farm, options});
await tracker.runRequest({
id: 'abc',
// $FlowFixMe[incompatible-call]
type: 'mock_request',
type: 'path_request',
run: async ({api}: {api: RunAPI<string | void>, ...}) => {
let result = await Promise.resolve('hello');
api.storeResult(result);
Expand All @@ -164,8 +152,7 @@ describe('RequestTracker', () => {
});
let result = await tracker.runRequest({
id: 'abc',
// $FlowFixMe[incompatible-call]
type: 'mock_request',
type: 'path_request',
run: async () => {},
input: null,
});
Expand All @@ -177,8 +164,7 @@ describe('RequestTracker', () => {
let p = tracker
.runRequest({
id: 'abc',
// $FlowFixMe[incompatible-call]
type: 'mock_request',
type: 'path_request',
run: async () => {
await Promise.resolve('hello');
},
Expand Down Expand Up @@ -206,8 +192,7 @@ describe('RequestTracker', () => {

let requestA = tracker.runRequest({
id: 'abc',
// $FlowFixMe[incompatible-call]
type: 'mock_request',
type: 'path_request',
run: async ({api}: {api: RunAPI<string>, ...}) => {
await lockA.promise;
api.storeResult('a');
Expand All @@ -219,8 +204,7 @@ describe('RequestTracker', () => {
let calledB = false;
let requestB = tracker.runRequest({
id: 'abc',
// $FlowFixMe[incompatible-call]
type: 'mock_request',
type: 'path_request',
run: async ({api}: {api: RunAPI<string>, ...}) => {
calledB = true;
await lockB.promise;
Expand All @@ -240,8 +224,7 @@ describe('RequestTracker', () => {

let cachedResult = await tracker.runRequest({
id: 'abc',
// $FlowFixMe[incompatible-call]
type: 'mock_request',
type: 'path_request',
run: () => {},
input: null,
});
Expand All @@ -257,8 +240,7 @@ describe('RequestTracker', () => {
let requestA = tracker
.runRequest({
id: 'abc',
// $FlowFixMe[incompatible-call]
type: 'mock_request',
type: 'path_request',
run: async () => {
await lockA.promise;
throw new Error('whoops');
Expand All @@ -271,8 +253,7 @@ describe('RequestTracker', () => {

let requestB = tracker.runRequest({
id: 'abc',
// $FlowFixMe[incompatible-call]
type: 'mock_request',
type: 'path_request',
run: async ({api}: {api: RunAPI<string | void>, ...}) => {
await lockB.promise;
api.storeResult('b');
Expand All @@ -288,8 +269,7 @@ describe('RequestTracker', () => {
let called = false;
let cachedResult = await tracker.runRequest({
id: 'abc',
// $FlowFixMe[incompatible-call]
type: 'mock_request',
type: 'path_request',
run: () => {
called = true;
},
Expand Down

0 comments on commit 41f2ca7

Please sign in to comment.