Skip to content

Commit ccd75d5

Browse files
committed
cache fiber measurments, remove animations to keep ui thread unblocked
1 parent c56a768 commit ccd75d5

File tree

3 files changed

+300
-259
lines changed

3 files changed

+300
-259
lines changed

src/core/index.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
import type { Fiber, FiberRoot } from 'react-reconciler';
22
import * as React from 'react';
33
import { instrument, type Render } from './instrumentation/index';
4+
5+
import { createOverlay } from './web/index';
6+
import { logIntro } from './web/log';
7+
import { createToolbar } from './web/toolbar';
8+
import { playGeigerClickSound } from './web/geiger';
9+
import { createPerfObserver } from './web/perf-observer';
410
import { createStore } from './utils';
511
import {
612
ActiveOutline,
713
flushOutlines,
814
getOutline,
915
PendingOutline,
1016
} from './web/outline';
11-
import { createOverlay } from './web/index';
12-
import { logIntro } from './web/log';
13-
import { createToolbar } from './web/toolbar';
14-
import { playGeigerClickSound } from './web/geiger';
15-
import { createPerfObserver } from './web/perf-observer';
1617

1718
interface Options {
1819
/**
@@ -88,8 +89,8 @@ interface Options {
8889
onCommitStart?: () => void;
8990
onRender?: (fiber: Fiber, render: Render) => void;
9091
onCommitFinish?: () => void;
91-
onPaintStart?: (outline: PendingOutline) => void;
92-
onPaintFinish?: (outline: PendingOutline) => void;
92+
onPaintStart?: (outline: any) => void;
93+
onPaintFinish?: (outline: any) => void;
9394
}
9495

9596
interface Internals {
@@ -116,6 +117,8 @@ export type MeasurementValue = {
116117
height: number;
117118
pageX: number;
118119
pageY: number;
120+
x: number;
121+
y: number;
119122
};
120123
export type Measurement =
121124
| { kind: 'dom'; value: DOMRect }

0 commit comments

Comments
 (0)