From an app built on core-v2: Scrolling (#3, #4, #14) - Each recognizer locks onto a touch within its first 6px: along its axis and direction it holds the touch, otherwise it lets go. A new onTouchmove binding cancels native scrolling only while a recognizer holds the touch, so hosts use touch-action: manipulation and one vertical gesture no longer disables vertical scrolling. Several gestures on one host share touches through the same rule. - .from.scrollEdge(scroller, edge) admits drag-to-dismiss only while a scroller is at the edge (#5). Feel - recognition.distance sets what counts as full progress: pixels, a CSS length, or a measuring function (#6). - Choreographies receive overshoot, the drag past either end of the clamped progress, and the settling spring starts from it (#7). - Velocity is the least-squares trend of the last 100ms (#8). - Defaults retuned to commitThreshold 0.25 and commitVelocity 0.2; the slide presets use them (#9). - Choreographies may set spring stiffness and damping (#10). Hooks and helpers - .onArm()/.onDisarm() run during a drag when releasing would start or stop committing (#12). - startedIn, nearEdge, atScrollEdge, anyOf, allOf start predicates (#15). - Development builds warn when an operation's first frame moves a node that was visibly at rest, the one-frame "pop" of mismatched open and close choreographies (#16). Docs: scrolling, ignored elements, animation performance, haptics, and operating-system edge gestures including CloseWatcher/popstate for PWAs (#11, #17, #18). Verification: a Chromium harness with emulated touch (verify/browser) checks swipes over scrollers, native scrolling beside gestures, scroll-edge dismissal, onCommit inside pointerup, and the continuity warning. Reverting the earlier capture fix makes it fail exactly as reported ("none of the handles work"). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Faarh2Ts6StJPcz2mRiHiR
38 lines
1.4 KiB
Markdown
38 lines
1.4 KiB
Markdown
# Benchmarks
|
|
|
|
Compares core-v2's performance against an earlier implementation (by default
|
|
`main`).
|
|
|
|
From the repository root:
|
|
|
|
```sh
|
|
packages/core-v2/verify/setup-baseline.sh main # extract into verify/.baseline/
|
|
ONLY=baseline npx vitest bench --run --config packages/core-v2/verify/vitest.config.ts
|
|
ONLY=rewrite npx vitest bench --run --config packages/core-v2/verify/vitest.config.ts
|
|
```
|
|
|
|
`scene.bench.ts` measures compositing, push/back cycles, and rendered frames.
|
|
Run each implementation in its own process with `ONLY=`; running both in one
|
|
process biases whichever runs second.
|
|
|
|
Behavioural verification lives with the unit tests: `tests/property.test.ts`
|
|
drives random operation sequences and pointer streams and checks the scene's
|
|
structural invariants after every step. Set `PROPERTY_SEEDS` to run more.
|
|
|
|
## Real-browser touch checks
|
|
|
|
`browser/` drives a development build in Chromium with emulated touch input,
|
|
which happy-dom cannot model: implicit touch pointer capture, native scrolling,
|
|
`pointercancel`, and rendered styles. It checks that swipes over scrollers
|
|
commit, that scrolling still works beside gestures, scroll-edge dismissal,
|
|
that `onCommit` runs inside `pointerup`, and the development continuity
|
|
warning.
|
|
|
|
```sh
|
|
NODE_ENV=development npx vite build --mode development \
|
|
--config packages/core-v2/verify/browser/app/vite.config.mjs
|
|
node packages/core-v2/verify/browser/run.mjs
|
|
```
|
|
|
|
Set `CHROMIUM_PATH` to use a Chromium other than Playwright's own.
|