Skip to content

Tweak comments, benchmarking, types, and code.#330

Merged
minjoonkim merged 1 commit intovariant-canvasfrom
variant-canvas-review
Apr 27, 2026
Merged

Tweak comments, benchmarking, types, and code.#330
minjoonkim merged 1 commit intovariant-canvasfrom
variant-canvas-review

Conversation

@dlrice
Copy link
Copy Markdown
Contributor

@dlrice dlrice commented Apr 27, 2026

Small changes, a benchmarking convenience, and a doc tweak.

Fix

  • mousemove no longer dispatches mouseover / mouseout on every pixel — only on actual enter/leave transitions. Adds 5 regression tests covering the transition cases.

Benchmark / dev server

  • New web-dev-server.config.mjs resolves @nightingale-elements/* to each package's src/index.ts and transpiles TS on the fly, so dev/benchmarks/*.html runs without a yarn build.
  • New yarn benchmark:variation-canvas script opens the benchmark page directly.
  • New NightingaleVariationCanvas#whenDrawn() lets the benchmark await actual draw completion instead of guessing with double-RAF.

Polish

  • MAX_HIT_RADIUS warns when a variant exceeds the hit-test cap.
  • pointer-events: none on the background canvas (defense in depth).
  • TODO on the extends withCanvas(NightingaleVariation) line capturing the migration cost when SVG is removed.
  • Drop unnecessary as unknown as Parameters<typeof createEvent>["1"] casts — VariationDatum is structurally compatible.
  • README: documents the getVariantEnd fallback as a second parity gap.

Type re-export tweak

  • packages/nightingale-variation/src/index.ts uses export type { … } for the existing type re-exports. Same public API, but per-file transpilers (incl. the new dev server) now drop them at JS-emit time so the browser doesn't try to bind nonexistent runtime exports.

@dlrice dlrice requested a review from minjoonkim April 27, 2026 07:00
@dlrice dlrice force-pushed the variant-canvas-review branch from 220b691 to 4399568 Compare April 27, 2026 07:04
@minjoonkim minjoonkim merged commit 46f9e3d into variant-canvas Apr 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants