v0.2.0 — two silent failures fixed
Published to npm: @danhnm1203/scrollytelling@0.2.0, with build provenance attesting it was built from this commit by the release workflow.
npx @danhnm1203/scrollytelling scaffold ./my-site
Fixed
A decode worker that failed to load hung the page forever. A worker whose URL 404s still constructs — the browser hands back a valid Worker and reports the failure asynchronously — so the try/catch around construction never fired, and the main-thread fallback was gated on the worker being absent. Every frame posted went to a worker that would never answer, nothing cleared them, and the page sat at a loading percentage indefinitely with no error, no console output and no timeout. It now falls back to main-thread decoding, re-requests the frames that were in flight, and warns once naming the URL that failed. (#38)
A freshly scaffolded project could not be built. scaffold ./site && npm install && npm run build failed before any frames were generated. Next typechecks during a build, and the placeholder declared SEQUENCES as [] as const — the tuple type readonly [] — so the three call sites that index it did not compile. This affected the whole of a project's life before its first frames run, which is exactly where a new user starts. (#40)
A page whose opening frames all decoded could report "no frames found". The opening request covers the whole decode window, but only about half of those are opening frames. Readiness was checked against every failure so far, so frames beyond the opening set failing first could push a perfectly renderable page into its empty state.
Changed
The runtime's decisions — load-state transitions, which frames to fetch and release, the draw parameters, and the choice between worker and main-thread decoding — moved into lib/scroll-engine-state.mjs: plain JavaScript, no DOM, unit-tested directly. The scrubbing component now applies those decisions rather than making them.
Generated projects gain lib/scroll-engine-state.mjs and its .d.ts. A new scaffold installs them automatically. An existing project picks them up by re-running scrollytelling scaffold ., which never overwrites files you have edited — scrollytelling scaffold . --diff reports what has moved. That new scaffold surface is why this is a minor rather than a patch.
The generated frames placeholder is annotated rather than as const, so it typechecks before any footage has been processed.
Internal
package.jsoncarried the unscoped namescrollytelling, which belongs to a different package on npm. Releases have always gone out scoped; the manifest now matches, so the tag-driven workflow can publish. This is the first release to go through it.*.tsbuildinfois gitignored —templates/sets"incremental": trueand ships in the package, so a stray build artifact would have been published.- Three stale ASCII diagrams corrected; two described code that had already changed.
Full changelog: CHANGELOG.md