Releases: rocicorp/zero-virtual
Release list
v0.6.1
v0.6.0
v0.6.0
A major release: a reworked rendering model, SolidJS support, dynamic row
heights, and a framework-agnostic core - plus scroll-restore and permalink
fixes.
Highlights
- Dynamic row heights: rows can now size to their content; heights are
measured from the DOM rather than fixed up front (#42). - SolidJS bindings + framework-agnostic core: the virtualizer logic moved
into a framework-free core, with first-class React and Solid wrappers (#43). - New flow-based rendering model: rows render in normal document flow
inside a content wrapper padded byspaceBefore/spaceAfter, instead of
absolutely-positioned virtual items (#48).
⚠️ Breaking changes (migrating from 0.5.x)
-
Rendering model.
virtualizer.getVirtualItems()/getTotalSize()/
rowAtare gone. Render the returneditemsinside a wrapper padded by
spaceBefore(top) andspaceAfter(bottom), and stamp each row with
rowAttributes(index, key):const {items, spaceBefore, spaceAfter} = useZeroVirtualizer({...}); <div ref={parentRef} style={{overflow: 'auto', height: '100vh'}}> <div style={{paddingTop: spaceBefore, paddingBottom: spaceAfter}}> {items.map(({index, key, row}) => ( <div key={key} {...rowAttributes(index, key)}>…</div> ))} </div> </div>
-
Query callbacks now take an options object and return
{query, options}:
getPageQuery({limit, start, dir})andgetSingleQuery({id}). -
Scroll-state props renamed:
permalinkState/onPermalinkStateChange
→scrollState/onScrollStateChange. A ready-madeuseHistoryScrollState
hook is provided (Solid:createHistoryScrollState); it uses the Navigation
API (Firefox 147+; all supported Chromium/Safari already have it), or wire
your own persistence to the props.
Fixes
- Scroll restore now applies correctly when the scroll container is mounted
lazily (e.g. after measuring available space) instead of being silently
dropped (#56). - Permalink deep-links scroll the target into view even when the permalink
id differs from the row key (e.g. short-id URLs over uuid-keyed rows), via a
resolvedpermalinkRowon the rows snapshot (#57). - Scroll position is flushed on
scrollend, so navigating immediately
after scrolling no longer loses the position to the persist debounce (#57). useHistoryScrollStatesetter re-reads live history state before writing (#51).- Snapshot invalidated on option changes;
settledflip is notified on scroll (#49). - Warn on
listContextParamsidentity churn; docs no longer teach inline
listContextParams(#50).
Docs & internal
- Documented the Navigation API requirement (Firefox 147+) for the
history-state helpers (#54). - DOM-attached test harness for the imperative virtualizer paths (#53).
- Packaging hygiene + publish-workflow gate (#52); demo split into
demo/react,demo/solid,demo/shared(#45, #46); formatting/cleanup
(#44, #47).
What's Changed
- feat!: Support dynamic row heights by @arv in #42
- feat: Framework-agnostic core + SolidJS bindings by @arv in #43
- chore: fmt command by @arv in #44
- Arv/solid demo by @arv in #45
- refactor(demo): split into demo/react, demo/solid, and demo/shared by @arv in #46
- chore: More cleanup and refactoring by @arv in #47
- Arv/no space yes content wrapper by @arv in #48
- fix(core): invalidate snapshot on option changes; notify settled flip on scroll by @arv in #49
- chore: packaging hygiene + publish-workflow gate by @arv in #52
- docs: Navigation API requirement (Firefox 147+) for the history-state helpers by @arv in #54
- docs+fix(core): stop teaching inline listContextParams; warn on identity churn by @arv in #50
- fix(react): useHistoryScrollState setter re-reads live history state by @arv in #51
- test(core): DOM-attached harness for the imperative virtualizer paths by @arv in #53
- 0.6.0-0 by @arv in #55
- fix(core): apply scroll restore when the container attaches on a later commit by @arv in #56
- fix: add permalinkRow to RowsSnapshot and related functions for permalink support by @arv in #57
- 0.6.0-1 by @arv in #58
- 0.6.0-2 by @arv in #59
Full Changelog: v0.5.1...v0.6.0