Skip to content

Releases: rocicorp/zero-virtual

Release list

v0.6.1

Choose a tag to compare

@arv arv released this 14 Jul 13:08
36a0160

What's Changed

  • feat: add minPageSize option to control query page size by @arv in #64
  • feat: update minPageSize default from 100 to 50 by @arv in #66
  • Make core library-agnostic while preserving everything else by @arv in #68. Thanks @buzinas

Full Changelog: v0.6.0...v0.6.1

v0.6.0

Choose a tag to compare

@arv arv released this 11 Jul 11:28
dc5509a

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 by spaceBefore / spaceAfter, instead of
    absolutely-positioned virtual items (#48).

⚠️ Breaking changes (migrating from 0.5.x)

  • Rendering model. virtualizer.getVirtualItems() / getTotalSize() /
    rowAt are gone. Render the returned items inside a wrapper padded by
    spaceBefore (top) and spaceAfter (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}) and getSingleQuery({id}).

  • Scroll-state props renamed: permalinkState / onPermalinkStateChange
    scrollState / onScrollStateChange. A ready-made useHistoryScrollState
    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
    resolved permalinkRow on 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).
  • useHistoryScrollState setter re-reads live history state before writing (#51).
  • Snapshot invalidated on option changes; settled flip is notified on scroll (#49).
  • Warn on listContextParams identity 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