Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused Flow suppressions #25977

Merged
merged 1 commit into from
Jan 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/react-cache/src/ReactCacheOld.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ function accessResult<I, K, V>(
status: Pending,
value: thenable,
};
// $FlowFixMe[escaped-generic] discovered when updating Flow
const newEntry = lru.add(newResult, deleteEntry.bind(null, resource, key));
entriesForResource.set(key, newEntry);
return newResult;
Expand Down
1 change: 0 additions & 1 deletion packages/react-devtools-core/src/backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ export function connectToDevTools(options: ?ConnectOptions) {
}
},
});
// $FlowFixMe[incompatible-use] found when upgrading Flow
bridge.addListener(
'updateComponentFilters',
(componentFilters: Array<ComponentFilter>) => {
Expand Down
1 change: 0 additions & 1 deletion packages/react-devtools-inline/src/backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ export function activate(
bridge,
}: {
bridge?: BackendBridge,
// $FlowFixMe[incompatible-exact]
} = {},
): void {
if (bridge == null) {
Expand Down
1 change: 0 additions & 1 deletion packages/react-devtools-inline/src/frontend.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ export function initialize(
}: {
bridge?: FrontendBridge,
store?: Store,
// $FlowFixMe[incompatible-exact]
} = {},
): React.AbstractComponent<Props, mixed> {
if (bridge == null) {
Expand Down
1 change: 0 additions & 1 deletion packages/react-devtools-shared/src/backend/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ export function serializeToString(data: any): string {
}
cache.add(value);
}
// $FlowFixMe
if (typeof value === 'bigint') {
return value.toString() + 'n';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ function wrapWithHoc(Component: () => any, index: number) {

const displayName = (Component: any).displayName || Component.name;

// $FlowFixMe[incompatible-type] found when upgrading Flow
HOC.displayName = `withHoc${index}(${displayName})`;
return HOC;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ const immutable = Immutable.fromJS({
xyz: 1,
},
});
// $FlowFixMe
const bigInt = BigInt(123); // eslint-disable-line no-undef

export default function UnserializableProps(): React.Node {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ function getRootNode(container: Container): FloatRoot {

function getCurrentResourceRoot(): null | FloatRoot {
const currentContainer = getCurrentRootHostContainer();
// $FlowFixMe flow should know currentContainer is a Node and has getRootNode
return currentContainer ? getRootNode(currentContainer) : null;
}

Expand Down
3 changes: 0 additions & 3 deletions packages/react-dom-bindings/src/server/ReactDOMFloatServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -782,11 +782,9 @@ export function resourcesFromLink(props: Props): boolean {
if (__DEV__) {
validateLinkPropsForStyleResource(props);
}
// $FlowFixMe[incompatible-use] found when upgrading Flow
let preloadResource = resources.preloadsMap.get(href);
if (!preloadResource) {
preloadResource = createPreloadResource(
// $FlowFixMe[incompatible-call] found when upgrading Flow
resources,
href,
'style',
Expand Down Expand Up @@ -937,7 +935,6 @@ export function resourcesFromScript(props: Props): boolean {
let preloadResource = resources.preloadsMap.get(src);
if (!preloadResource) {
preloadResource = createPreloadResource(
// $FlowFixMe[incompatible-call] found when upgrading Flow
resources,
src,
'script',
Expand Down
1 change: 0 additions & 1 deletion packages/react-reconciler/src/ReactFiberBeginWork.js
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,6 @@ function updateSimpleMemoComponent(
try {
outerMemoType = init(payload);
} catch (x) {
// $FlowFixMe[incompatible-type] found when upgrading Flow
outerMemoType = null;
}
// Inner propTypes will be validated in the function component path.
Expand Down
3 changes: 0 additions & 3 deletions packages/react-reconciler/src/ReactFiberCommitWork.js
Original file line number Diff line number Diff line change
Expand Up @@ -2391,12 +2391,9 @@ function getRetryCache(finishedWork: Fiber) {
}
case OffscreenComponent: {
const instance: OffscreenInstance = finishedWork.stateNode;
// $FlowFixMe[incompatible-type-arg] found when upgrading Flow
let retryCache: null | Set<Wakeable> | WeakSet<Wakeable> =
// $FlowFixMe[incompatible-type] found when upgrading Flow
instance._retryCache;
if (retryCache === null) {
// $FlowFixMe[incompatible-type]
retryCache = instance._retryCache = new PossiblyWeakSet();
}
return retryCache;
Expand Down
1 change: 0 additions & 1 deletion packages/react-reconciler/src/ReactFiberContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ if (__DEV__) {
warnedAboutMissingGetChildContext = ({}: {[string]: boolean});
}

// $FlowFixMe[incompatible-exact]
export const emptyContextObject: {} = {};
if (__DEV__) {
Object.freeze(emptyContextObject);
Expand Down
1 change: 0 additions & 1 deletion packages/react-reconciler/src/ReactFiberHooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -2806,7 +2806,6 @@ const HooksDispatcherOnMount: Dispatcher = {
useId: mountId,
};
if (enableCache) {
// $FlowFixMe[escaped-generic] discovered when updating Flow
(HooksDispatcherOnMount: Dispatcher).useCacheRefresh = mountRefresh;
}
if (enableUseHook) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ export type OffscreenInstance = {
_visibility: OffscreenVisibility,
_pendingMarkers: Set<TracingMarkerInstance> | null,
_transitions: Set<Transition> | null,
// $FlowFixMe[incompatible-type-arg] found when upgrading Flow
_retryCache: WeakSet<Wakeable> | Set<Wakeable> | null,

// Represents the current Offscreen fiber
Expand Down
2 changes: 0 additions & 2 deletions packages/react-reconciler/src/ReactFiberWorkLoop.js
Original file line number Diff line number Diff line change
Expand Up @@ -1813,7 +1813,6 @@ function handleThrow(root: FiberRoot, thrownValue: any): void {
const isWakeable =
thrownValue !== null &&
typeof thrownValue === 'object' &&
// $FlowFixMe[method-unbinding]
typeof thrownValue.then === 'function';

workInProgressSuspendedReason = isWakeable
Expand Down Expand Up @@ -3458,7 +3457,6 @@ export function resolveRetryWakeable(boundaryFiber: Fiber, wakeable: Wakeable) {
break;
case OffscreenComponent: {
const instance: OffscreenInstance = boundaryFiber.stateNode;
// $FlowFixMe[incompatible-type] found when upgrading Flow
retryCache = instance._retryCache;
break;
}
Expand Down
5 changes: 3 additions & 2 deletions packages/react-refresh/src/ReactFreshRuntime.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ const allFamiliesByID: Map<string, Family> = new Map();
const allFamiliesByType:
| WeakMap<any, Family>
| Map<any, Family> = new PossiblyWeakMap();
const allSignaturesByType: // $FlowFixMe
WeakMap<any, Signature> | Map<any, Signature> = new PossiblyWeakMap();
const allSignaturesByType:
| WeakMap<any, Signature>
| Map<any, Signature> = new PossiblyWeakMap();
// This WeakMap is read by React, so we only put families
// that have actually been edited here. This keeps checks fast.
const updatedFamiliesByType:
Expand Down
1 change: 0 additions & 1 deletion packages/react-server/src/ReactFizzContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ if (__DEV__) {
warnedAboutMissingGetChildContext = ({}: {[string]: boolean});
}

// $FlowFixMe[incompatible-exact]
export const emptyContextObject: {} = {};
if (__DEV__) {
Object.freeze(emptyContextObject);
Expand Down
2 changes: 0 additions & 2 deletions packages/react-server/src/ReactFlightCache.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ export const DefaultCacheDispatcher: CacheDispatcher = {
let entry: AbortSignal | void = (cache.get(createSignal): any);
if (entry === undefined) {
entry = createSignal();
// $FlowFixMe[incompatible-use] found when upgrading Flow
cache.set(createSignal, entry);
}
return entry;
Expand All @@ -47,7 +46,6 @@ export const DefaultCacheDispatcher: CacheDispatcher = {
if (entry === undefined) {
entry = resourceType();
// TODO: Warn if undefined?
// $FlowFixMe[incompatible-use] found when upgrading Flow
cache.set(resourceType, entry);
}
return entry;
Expand Down
1 change: 0 additions & 1 deletion packages/react-server/src/ReactFlightServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,6 @@ export function resolveModelToJSON(
return serializeByValueID(symbolId);
}

// $FlowFixMe: bigint isn't added to Flow yet.
if (typeof value === 'bigint') {
throw new Error(
`BigInt (${value}) is not yet supported in Client Component props.` +
Expand Down
1 change: 0 additions & 1 deletion packages/react-server/src/ReactServerStreamConfigBun.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ export function clonePrecomputedChunk(
}

export function closeWithError(destination: Destination, error: mixed): void {
// $FlowFixMe[method-unbinding]
if (typeof destination.error === 'function') {
// $FlowFixMe: This is an Error object or the destination accepts other types.
destination.error(error);
Expand Down
4 changes: 1 addition & 3 deletions packages/react/src/ReactDebugCurrentFrame.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ const ReactDebugCurrentFrame: {
setExtraStackFrame?: (stack: null | string) => void,
getCurrentStack?: null | (() => string),
getStackAddendum?: () => string,
} =
// $FlowFixMe[incompatible-exact]
{};
} = {};

let currentExtraStackFrame = (null: null | string);

Expand Down