Skip to content

Commit

Permalink
Remove DevTools dependency on Scheduler runWithPriority (#20967)
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Vaughn authored Mar 10, 2021
1 parent e4d4b70 commit ec372fa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 66 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,8 @@ import {
useMemo,
useReducer,
useRef,
unstable_startTransition as startTransition,
} from 'react';
import {
unstable_next as next,
unstable_runWithPriority as runWithPriority,
unstable_UserBlockingPriority as UserBlockingPriority,
} from 'scheduler';
import {createRegExp} from '../utils';
import {BridgeContext, StoreContext} from '../context';
import Store from '../../store';
Expand Down Expand Up @@ -923,11 +919,10 @@ function TreeContextController({

const dispatchWrapper = useCallback(
(action: Action) => {
// Run the first update at "user-blocking" priority in case dispatch is called from a non-React event.
// In this case, the current (and "next") priorities would both be "normal",
// and suspense would potentially block both updates.
runWithPriority(UserBlockingPriority, () => dispatch(action));
next(() => dispatch({type: 'UPDATE_INSPECTED_ELEMENT_ID'}));
dispatch(action);
startTransition(() => {
dispatch({type: 'UPDATE_INSPECTED_ELEMENT_ID'});
});
},
[dispatch],
);
Expand Down
54 changes: 0 additions & 54 deletions packages/react-devtools-shell/src/app/PriorityLevels/index.js

This file was deleted.

2 changes: 0 additions & 2 deletions packages/react-devtools-shell/src/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import Hydration from './Hydration';
import InlineWarnings from './InlineWarnings';
import InspectableElements from './InspectableElements';
import InteractionTracing from './InteractionTracing';
import PriorityLevels from './PriorityLevels';
import ReactNativeWeb from './ReactNativeWeb';
import ToDoList from './ToDoList';
import Toggle from './Toggle';
Expand Down Expand Up @@ -55,7 +54,6 @@ function mountTestApp() {
mountHelper(ElementTypes);
mountHelper(EditableProps);
mountHelper(InlineWarnings);
mountHelper(PriorityLevels);
mountHelper(ReactNativeWeb);
mountHelper(Toggle);
mountHelper(SuspenseTree);
Expand Down

0 comments on commit ec372fa

Please sign in to comment.