Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -583,8 +583,11 @@ module.exports = {
mixin$Animatable: 'readonly',
MouseEventHandler: 'readonly',
NavigateEvent: 'readonly',
PerformanceMeasureOptions: 'readonly',
PropagationPhases: 'readonly',
PropertyDescriptor: 'readonly',
PropertyDescriptorMap: 'readonly',
Proxy$traps: 'readonly',
React$Component: 'readonly',
React$Config: 'readonly',
React$Context: 'readonly',
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@
"eslint-plugin-react-internal": "link:./scripts/eslint-rules",
"fbjs-scripts": "^3.0.1",
"filesize": "^6.0.1",
"flow-bin": "^0.274",
"flow-remove-types": "^2.274",
"flow-bin": "^0.279.0",
"flow-remove-types": "^2.279.0",
"flow-typed": "^4.1.1",
"glob": "^7.1.6",
"glob-stream": "^6.1.0",
"google-closure-compiler": "^20230206.0.0",
"gzip-size": "^5.1.1",
"hermes-eslint": "^0.25.1",
"hermes-parser": "^0.25.1",
"hermes-eslint": "^0.32.0",
"hermes-parser": "^0.32.0",
"jest": "^29.4.2",
"jest-cli": "^29.4.2",
"jest-diff": "^29.4.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-react-hooks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"dependencies": {
"@babel/core": "^7.24.4",
"@babel/parser": "^7.24.4",
"@babel/plugin-transform-private-methods": "^7.24.4",
"@babel/plugin-proposal-private-methods": "^7.18.6",
"hermes-parser": "^0.25.1",
"zod": "^3.22.4",
"zod-validation-error": "^3.0.3"
Expand Down
4 changes: 2 additions & 2 deletions packages/react-client/src/ReactFlightPerformanceTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export function logComponentAborted(
const entryName =
isPrimaryEnv || env === undefined ? name : name + ' [' + env + ']';
if (__DEV__) {
const properties = [
const properties: Array<[string, string]> = [
[
'Aborted',
'The stream was aborted before this Component finished rendering.',
Expand Down Expand Up @@ -215,7 +215,7 @@ export function logComponentErrored(
String(error.message)
: // eslint-disable-next-line react-internal/safe-string-coercion
String(error);
const properties = [['Error', message]];
const properties: Array<[string, string]> = [['Error', message]];
if (componentInfo.key != null) {
addValueToProperties('key', componentInfo.key, properties, 0, '');
}
Expand Down
2 changes: 1 addition & 1 deletion packages/react-debug-tools/src/ReactDebugHooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ const Dispatcher: DispatcherType = {

// create a proxy to throw a custom error
// in case future versions of React adds more hooks
const DispatcherProxyHandler = {
const DispatcherProxyHandler: Proxy$traps<DispatcherType> = {
get(target: DispatcherType, prop: string) {
if (target.hasOwnProperty(prop)) {
// $FlowFixMe[invalid-computed-prop]
Expand Down
9 changes: 8 additions & 1 deletion packages/react-devtools-shared/src/backend/fiber/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2217,7 +2217,7 @@ export function attach(
}
if (typeof instance.getClientRects === 'function') {
// DOM
const result = [];
const result: Array<Rect> = [];
const doc = instance.ownerDocument;
const win = doc && doc.defaultView;
const scrollX = win ? win.scrollX : 0;
Expand Down Expand Up @@ -7455,6 +7455,13 @@ export function attach(
}

function overrideSuspense(id: number, forceFallback: boolean) {
if (!supportsTogglingSuspense) {
// TODO:: Add getter to decide if overrideSuspense is available.
// Currently only available on inspectElement.
// Probably need a different affordance to batch since the timeline
// fallback is not the same as resuspending.
return;
}
if (
typeof setSuspenseHandler !== 'function' ||
typeof scheduleUpdate !== 'function'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,10 @@ function HookView({
const hookDisplayName = hookName ? (
<>
{name}
{!!hookName && <span className={styles.HookName}>({hookName})</span>}
{
// $FlowFixMe[constant-condition]
!!hookName && <span className={styles.HookName}>({hookName})</span>
}
</>
) : (
name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function dialogReducer(state: State, action: Action) {
content: action.content,
id: action.id,
title: action.title || null,
},
} as Dialog,
],
};
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function getTooltipPosition(
mouseY: number,
width: number,
},
) {
): {left: string, top: string} {
const {height, mouseX, mouseY, width} = mousePosition;
let top: number | string = 0;
let left: number | string = 0;
Expand Down Expand Up @@ -108,7 +108,13 @@ function getMousePosition(
}
}

const {height, left, top, width} = targetContainer.getBoundingClientRect();
const {height, left, top, width} =
targetContainer.getBoundingClientRect() as {
height: number,
left: number,
top: number,
width: number,
};

const mouseX = mouseEvent.clientX - left;
const mouseY = mouseEvent.clientY - top;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
padding: 0.25rem;
display: flex;
flex-direction: row;
align-items: flex-start;
}

.Timeline {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import InspectedElement from '../Components/InspectedElement';
import portaledContent from '../portaledContent';
import styles from './SuspenseTab.css';
import SuspenseRects from './SuspenseRects';
import SuspenseTimeline from './SuspenseTimeline';
import SuspenseTreeList from './SuspenseTreeList';
import Button from '../Button';
import typeof {SyntheticPointerEvent} from 'react-dom-bindings/src/events/SyntheticEvent';
Expand All @@ -46,10 +47,6 @@ type LayoutState = {
};
type LayoutDispatch = (action: LayoutAction) => void;

function SuspenseTimeline() {
return <div className={styles.Timeline}>timeline</div>;
}

function ToggleTreeList({
dispatch,
state,
Expand Down Expand Up @@ -309,7 +306,9 @@ function SuspenseTab(_: {}) {
<div className={styles.TreeView}>
<div className={styles.TimelineWrapper}>
<ToggleTreeList dispatch={dispatch} state={state} />
<SuspenseTimeline />
<div className={styles.Timeline}>
<SuspenseTimeline />
</div>
<ToggleInspectedElement
dispatch={dispatch}
state={state}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.SuspenseTimelineSlider {
width: 100%;
}

.SuspenseTimelineMarkers {
display: flex;
flex-direction: row;
justify-content: space-between;
}

.SuspenseTimelineMarkers > * {
flex: 1 1 0;
overflow: visible;
visibility: hidden;
width: 0
}

.SuspenseTimelineActiveMarker {
visibility: visible;
}
Loading
Loading