Skip to content

v1.3.2 — builder core decomposition#2

Merged
floor merged 2 commits intomainfrom
staging
Mar 8, 2026
Merged

v1.3.2 — builder core decomposition#2
floor merged 2 commits intomainfrom
staging

Conversation

@floor
Copy link
Owner

@floor floor commented Mar 8, 2026

Changes

  • refactor(builder): extract measurement and api modules from core.ts
  • refactor(builder): deduplicate idle handler, click/dblclick, stayAtEnd
  • fix(scroll): wheel handler now fires afterScroll hooks and velocity:change events
  • fix(scroll): prevent double-firing of scroll events during wheel scrolling
  • perf(builder): base bundle −0.5 KB minified (23.6 KB, 8.8 KB gzipped)

Metrics

Metric Before After
core.ts 1,513 lines 1,097 lines (−28%)
Base minified 24.1 KB 23.6 KB (−0.5 KB)
Base gzipped 8.7 KB 8.8 KB (+0.1 KB)
Tests 2,763 2,763 ✅

No public API changes. Drop-in replacement.

floor added 2 commits March 8, 2026 09:39
…l handler

- Extract Mode B measurement subsystem to measurement.ts (ResizeObserver,
  scroll correction, content size deferral, stayAtEnd)
- Extract public API assembly to api.ts (data wrappers, scroll methods,
  event subscription, destroy teardown)
- Simplify wheel handler: delegate to onScrollFrame instead of
  reimplementing scroll logic (fixes missing velocity:change and
  afterScroll events during wheel scroll)
- Add re-entry guard in onScrollFrame to skip redundant native scroll
  events after programmatic scrollTop assignment
- Deduplicate idle timeout handler (onScrollIdle + scheduleIdle)
- Deduplicate click/dblclick traversal (findClickTarget)
- Use positional params + short property keys for minification

core.ts: 1513 → 1097 lines (-28%)
Base minified: 24.1 → 23.6 KB (-0.5 KB)
Base gzipped: 8.7 → 8.8 KB (+0.1 KB)
Tests: 2763/2763 pass, typecheck clean
@floor floor merged commit 4ea763f into main Mar 8, 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.

1 participant