verify / internal · noindexsections 01 – 16
Verify
Three phases of correctness work, most of which has no UI surface — engine internals, CI gates, packaging, README numbers. This page renders the parts that can be seen, so they can be checked by eye instead of taken on trust. Every section states what was broken, then demonstrates it live in this browser.
- Phases
- 3
- Sections
- 16
- Live proofs
- 13
- Not yet proven
- 6
- 5 false README claims
- CI red on main
- library never typechecked
- 3 engine bugs
- 2 CLI bugs
- native CSS ≠ JS engine
- CDN build crashed
- idle CPU burn
- scrollSnap ignored a11y
- morphTo silently wrong
- scrollHorizontal never moved
- destroy() abandoned styles
- onSnap fired twice
- viewport override in the harness
- no Range support = dead video
Honesty and hygiene.
Nothing here needed a browser to find. The package was advertising numbers that were measurably wrong, its own CI had been failing on every push, and the library was never typechecked — so a type error shipped in the engine and sat there across releases.
- Coverage
- 74.6% → 85.9%, gate now passes
- Tests
- 425 → 475
- Size claim
- ~4.4 KB advertised, 9.0 KB real
- Guards added
- size budgets + doc-claim checker in CI
Generated Vue & Svelte files had an inert stroke.
The starter file from npx svg-scroll-draw init used JSX-style attribute names in HTML-parsed templates. Both graphics below request an identical 2.5px round stroke. Only one gets it.
strokeWidth="2.5"beforewhat Vue / Svelte users generated
parsed attributes…
stroke-width="2.5"afterwhat they get now
parsed attributes…
strokeWidth to strokewidth, which is not an SVG attribute, so it was discarded. Every Vue and Svelte starter file from npx svg-scroll-draw init shipped this.getProgress() was frozen at zero.
For every autoplay stroke animation, currentAlpha was only assigned on the clip-path branch — so the public getProgress() API reported 0.000 forever. The readout below is polled every frame from the real instance.
Off-screen pause/resume burned the animation out.
Leaving the viewport set startTime = null. Because null coerces to 0, a later pause() recorded the whole timestamp since page load as elapsed time — so resume() started a run already past its own duration and completed instantly, invisibly.
idle — press the button
Every size figure is now measured.
The README claimed ~4.4 KB against a real 8.9 KB, directly beneath a bundlephobia badge showing the true number. These come from npm run size, which reads the built output and fails CI if any entry drifts past its budget.
| Entry point | Raw | Gzipped | Gzipped, against the main entry |
|---|---|---|---|
| svg-scroll-draw | 27.1 KB | 9.0 KB | |
| svg-scroll-draw/group | 23.6 KB | 7.6 KB | |
| svg-scroll-draw/reveal | 9.2 KB | 3.9 KB | |
| svg-scroll-draw/timeline | 7.0 KB | 3.0 KB | |
| svg-scroll-draw/text | 5.4 KB | 2.3 KB | |
| svg-scroll-draw/video | 3.9 KB | 1.9 KB | |
| svg-scroll-draw/pin | 3.3 KB | 1.5 KB | |
| svg-scroll-draw/snap | 2.5 KB | 1.3 KB | |
| svg-scroll-draw/lenis | 0.4 KB | 0.2 KB |
9 of 21 entries shown — the full table lives in README.md.
Claims that were wrong, and now can't be.
scripts/check-claims.mjs derives the real test and example counts from source and fails the build when a doc disagrees. It caught a stale number mid-session, which is the only reason this table is right.
What a real browser found.
Phase 0 could not prove the library worked, only that its paperwork was honest — every unit test, 478 of them at the time, ran in jsdom with getTotalLength stubbed and IntersectionObserver faked. A Playwright suite across Chromium, Firefox and WebKit now runs in CI, and the first thing it did was disprove the library's headline claim.
- Browser tests
- 30, across Chromium · Firefox · WebKit
- Bugs found
- 5, none of them findable in jsdom
- Headline claim
- was false — native CSS ≠ JS engine
- Worst divergence
- 0.114 in WebKit → now 0.0000
Native CSS and the JS engine disagreed.
The library's headline claim is that the native CSS fast path and the JS engine are interchangeable. Nothing verified it, and it was false. Below, the same SVG is drawn twice at the same scroll offset — left on whatever the browser supports, right with native: false forced. Scroll slowly and watch Δ.
The CDN build crashed in a plain browser.
Every dev warning in 13 modules was guarded by a bare process.env.NODE_ENV check. process does not exist in a browser without a bundler, so reaching a warning threw instead of logging one. Both guards are evaluated below in a scope that has no process.
iframe · no process in scopeResult
process.env.NODE_ENV !== 'production'…
typeof process !== 'undefined' && typeof process.env !== 'undefined' && ……
iframe — a scope with no bundler-injected process, exactly what a CDN user has. The old guard sat in front of every dev warning in 13 modules, so reaching one threw instead of logging. The concrete repro: style a path’s stroke with CSS instead of a stroke attribute, and the engine’s “no stroke” warning took down the whole call.The JS engine worked while the page sat still.
The rAF loop ran every frame for as long as the container was in view, whether or not the scroll position had moved — recomputing values that had not changed. This is the path Firefox and every pre-115 browser always take, so it is not a niche case.
Both figures are baseline-subtracted: the page is timed once with no instances, then again with 8 alive. Without that subtraction this readout is dominated by React and the other live proofs on this page, which poll every frame — it read 1.6× where the isolated e2e fixture reads 7×.
scrollSnap overrode prefers-reduced-motion.
The clearest accessibility defect in the library, and the readout below is live against your own OS setting.
This readout is live — toggle Reduce motion in System Settings → Accessibility → Display and it updates without a reload. That is the same listener the library now uses.
scrollSnap animates window.scrollTo over a duration with an easing curve, driven off a debounced scroll handler — it takes over the user’s scrolling. It had no reduced-motion check of any kind, which was the clearest accessibility defect in the library. It now jumps straight to the target section; snapping still happens, only the animated scroll is dropped. respectReducedMotion: false is the documented opt-out.Everything else.
Phase 1 examined one API in a real browser and found five bugs. Everything else was unexamined, so this phase went through the rest of the surface: the other nine APIs, then Group / Sequence / Timeline / Cinematic, then scrollAnimate's own native fast path, then all eight framework wrappers and the CDN builds, and finally the same code again with no DOM at all. It found the worst defect of the three phases — an API that did nothing in the arrangement its own documentation prescribed — and ten more after that, including a server-side import that crashed the render and a CDN bundle shipping without the component it advertises. Sections 10–12 show three of them, and 13–15 the three 2.10.0 fixes; the rest are in the changelog for 2.10.0.
- Browser tests
- 30 → 175, on all three engines
- Defects found
- 14 in the library, 2 in the test harness
- Worst of them
- scrollHorizontal never moved the track
- New guard
- every test must fail against a broken build
scrollHorizontal never moved the track.
The worst defect in three phases of this work. The default trigger window was measured against the track itself — and a sticky stage pins that track at exactly one stage tall, so both ends of the window resolved to the same scroll position. Progress was then clamped at zero forever. The API did nothing, in precisely the CSS setup its own docs prescribe.
0.000 no matter how far you scroll. That upper strip is not a mock-up — it is the current library with triggerElement pointed at the track, which is precisely what the engine measured before this fix. The API had 100% line coverage in jsdom the whole time it was broken: every rect there is 0, so the window is equally degenerate and looks identical to a working one.destroy() left elements stranded mid-animation.
The engine wrote opacity and transform inline every frame and removed neither on teardown. Destroy a component while its reveal was half-finished and it stayed half-finished — permanently faded and offset, with nothing left running to correct it. Worse for the visitor than never animating at all.
old teardown
style="" (nothing yet)
after the fix
style="" (nothing yet)
destroy() leaves behind.onSnap fired twice for a single snap.
scrollSnap reacted to the scroll event its own animated scroll produced, treating it as a fresh user gesture and announcing a snap it had already announced. Guaranteed under reduced motion, intermittent otherwise — a public callback that fires once or twice depending on the easing curve.
snapTo() button. The two counters must stay equal.A finished sequence reported 0%.
scrollDrawSequence delegates getProgress() to whichever step is active. When the last step completed, the active index advanced past the end of the array, so the getter read from an undefined instance and fell back to zero — a sequence that had visibly finished reported that nothing had happened.
01Code
02Build
03Ship
getProgress() reports After the last one finishes.split: 'lines' deleted the spaces between words.
The only one of the three you can see without instrumentation. splitIntoLines groups words by offsetTop, and the whitespace nodes between them were dropped rather than reinserted — so a split headline rendered as one unbroken word. The sentence below is the test: read it.
Every word here should still be separated by a space after splitting.
A named easing drew a different curve on the native path.
Section 06 proves the two engines agree on the default curve, where there is nothing to get wrong. Before 2.10.0 the native path handed CSS the keyword of the same name — ease-out became animation-timing-function: ease-out — but the keywords are fixed cubic-béziers and this library’s easings are its own curves, so the two engines drew up to 0.069 apart mid-scroll. The same SVG below runs easing: 'ease-out' on both.
What still is not proven.
The limits, kept up to date rather than quietly dropped as they shrink.
- 011077 unit tests are still jsdomgetTotalLength is stubbed to a constant and IntersectionObserver is faked. They verify engine arithmetic. The 359 Playwright tests per engine are what cover browser behaviour — now run on GitHub Actions before every release, not only on one laptop — and a separate suite with no DOM at all covers what happens on a server.
- 02The wrappers are tested through their contracts, not their build pipelinesAll eight now mount for real and are held to the same contract — the engine runs, unmounting leaks no observer and no frame loop, re-mounting works. But Svelte is exercised through its action functions rather than a compiled component, and Angular through its ref classes rather than a running Angular app. That is the whole public surface in both cases, and it is still not the same as a real build.
- 03Every wrapper follows its options, and that is all it checksSince 2.17.0 the React, Vue, Nuxt, Solid, Svelte and Angular wrappers rebuild the engine when an option really changes, and keep it when a re-render passes equal options: a fresh inline object, a new callback. Since 2.19.0 Astro and <scroll-draw> do too: the element watches its option attributes and the Astro scanner its JSON attribute, and running the scanner again keeps the engine it started. The browser suite checks both halves on every engine, through the options each wrapper takes — not through every way a framework can change them.
- 04This page found a bug the e2e suite missedSection 06 kept reporting a constant 0.0201 offset. Trigger points were cached at init and only recomputed on a window resize, so a 21px layout shift during hydration left the JS engine permanently offset while the native CSS path stayed correct. Now fixed with a ResizeObserver — but only a busy, real page surfaced it, which says something about how much the isolated fixtures can prove.
- 05And the e2e suite caught this page outSection 15 was withheld for months because its harness measured the two engines 0.83 apart with easing: "ease-out". The suite’s own ease-out case had passed all along. The page was wrong: the native cell was keyed by its label, the label changed once support was detected, and React replaced that cell after the library had attached to it — leaving a fresh, undrawn path that read as fully drawn. Keyed by role, it reads 0.0001. Both sweeps also jump instantly now; this page scrolls smoothly, and a smooth jump was still gliding when the samples were read.
- 06Dev warnings still need opting intoThey were unreachable for CDN users entirely: IS_DEV is derived from process.env.NODE_ENV, and process does not exist in a browser without a bundler. 2.10.0 ships svg-scroll-draw.dev.global.js, which reports them — but you have to know to load it, and the production bundle has them removed at build time.
v2.10.0, merged to main · 531 unit tests + 175 browser tests per engine (525 runs across Chromium, Firefox and WebKit) · 56 mutations, each caught by the one test named for it · 91% line coverage · npm run verify and npm run test:e2e both exit 0