Not for now. Explicitly opt-in, through a prop, so the fixed-size path stays exactly as fast.
Today every item fills one cell of the probe's size. Position, rendered window and content size are index arithmetic, O(1), with no per-item state.
- Spans: an item covers several tracks, like
grid-column: span 2,span 4, orgrid-row: span 2. Example: a 4-column grid with items of span 2, 1, 1, 4, 2, 2. - Different sizes: rows (or columns in column flow) of different heights, known up front or measured.
itemSpan: (index: number) => { column: number; row: number }: the span of each item, from data.itemSize: (index: number) => number: a known size per row, from data.dynamicSize: boolean: measure rendered items with aResizeObserver, with an estimate for the rest.
- Placement: with spans, an index no longer maps to a cell by arithmetic. A placement pass
walks the items in order and packs them row by row, like CSS grid auto-placement. Decide whether
to match
grid-auto-flow: dense. Store each item's row and column start in typed arrays (Uint32Array), computed lazily up to the furthest index needed. - Offsets: a Fenwick tree (or block prefix sums) over row sizes maps row to offset and offset to row in O(log n).
- Rendered window: find the first visible row from the scroll offset, then the first item placed in that row. Items spanning into the window from rows above must render too.
- Scroll anchoring: when a measured size differs from its estimate above the viewport, adjust the scroll position by the difference so visible items do not jump.
- Content size,
scrollTo: sums over rows. Approximate until rows before the target are measured or placed. - Primitives:
getItemRectreads placement and offsets instead of multiplying, and returns the spanned width and height.getItemCellreturns the start cell.getIndexByCellreturns the item covering that cell.
- Placement cost for 1,000,000 items, and memory (two
Uint32Arrayof 4 MB each). - One
ResizeObserverentry per rendered item withdynamicSize. - Scroll benchmark with the props on and off. With them off, nothing may change.
For the v2 branch. RxJS 9 is in beta (9.0.0-beta.1, npm tag next). RxJS 7.8.2 stays the
latest tag until 9 is released, so wait for a stable 9 before publishing on it.
RxJS 9 is not a version bump. It builds on the browser's own Observable and ships no .pipe,
no pipeable operators and no schedulers. The pipeline is rewritten, not migrated.
- Imports: one subpath per operator, used as a Symbol-keyed method:
import { map } from "rxjs/map", thensource[map](fn). - No direct replacement:
debounceTime,firstValueFrom,mergeAll,range,animationFrameSchedulerandscheduled. Candidates arerxjs/debouncewithrxjs/timer,rxjs/firstandrxjs/animation-frames. Check each one's behaviour before using it. - Sharing: the platform
Observableshares one producer between concurrent subscribers. EveryshareReplayandBehaviorSubjectinpipeline()needs its lifecycle decided again. RxJS'sMIGRATION.mdlists the choices. - Public API:
pipeline()takes and returns RxJS 7 Observables, so this is a breaking change. - Tests: the marble tests in
tests/buffer.test.tsuserxjs/testing. Rewrite them.
Measured on 2026-11-16, minified, with esbuild:
| Operator set the grid needs | Minified | Gzip |
|---|---|---|
| RxJS 7.8.2 | 29.8 KB | 9.0 KB |
| RxJS 9.0.0-beta.1 | 26.5 KB | 7.8 KB |
- 13.1 KB of the RxJS 9 figure is
@rxjs/observable-polyfill. RxJS 9 imports it in every build, for browsers without a nativeObservable. - The saving over RxJS 7 is about 1.2 KB gzip. A pipeline on Vue reactivity alone would save about 9 KB gzip. Compare both before starting.
- Check that the polyfill can be left out for projects that only target browsers with a native
Observable.
- Drop the
valueRefalias inuseObservableand write totargetdirectly. - Cut the exports of
primitives.tsto the functions and the types users need. - Stop
index.tsfrom re-exporting everything inpipeline.ts. - Replace the "created once" code comment in the primitives sample with a performance note.
- Explain
outin the docs: the object the result is written into and returned. Consider making it optional, allocating only when it is left out. - Docs are hard to read and follow. Rewrite for a reader with no context.
- Every page under Guides must be a guide: a goal, then numbered steps in procedural
sentences ("Add
role="list"to<VirtualGrid>"), each with its code, ending in a result the reader can check. Move reference material (role tables, API facts) to Reference.- Accessibility: open with what the reader builds (a grid a screen reader announces as
"item 4,200 of 10,000"), state why the grid cannot do it alone (most items are not in the
DOM), then steps: set the list roles, set
aria-setsizeandaria-posinset, mark placeholders busy, add keyboard focus, verify with a screen reader. - Popovers, sizing and direction, performance: same shape.
- Accessibility: open with what the reader builds (a grid a screen reader announces as
"item 4,200 of 10,000"), state why the grid cannot do it alone (most items are not in the
DOM), then steps: set the list roles, set
- Accessibility, "Pick a role": the "Fits the grid's DOM" column is unclear. It meant "can this role pattern be built from the flat list of elements the grid renders". Rewrite as prose or move the table to Reference with a clear column name and a sentence of context.
- Popovers: add a guide for Floating UI (
useFloating/computePosition). Show a virtual element whosegetBoundingClientRect()returns the grid's computed rect for an index, so the floating element follows items that are not rendered. out: explain why it exists. Writing into an object the caller owns means a call creates no object, like an output parameter in a C API (void get_rect(int index, Rect *out)).- Add helpers that create the reusable argument objects in one call, so users do not write
{ root: null, index: -1, layout: null, out: { x: 0, y: 0, width: 0, height: 0 } }by hand. Pick a clear name, notinitRectArgs. Candidates:createRectQuery(),createCellQuery(),createDimensionsQuery(). - Sizing, "Scroll horizontally": the sample is a bare
<VirtualGrid>tag in avuefence, so it does not highlight. Wrap it in<template>(and a<script setup>if needed). - Performance, "Keep callbacks cheap": the sample and prose do not say why a reused, writable
object matters. State the cost:
onViewportScrollruns on every scroll event, and a new object per event becomes garbage the collector must reclaim during scrolling. - Performance: "Write styles after it, not between two reads" is unclear. Explain layout thrashing: reading layout after writing a style forces the browser to recompute layout immediately. Read every rect first, then write every style.
- Performance, "Keep items stable": name what "items" means (the rendered slot elements and the data objects behind them) or rename the section.
- Performance, "Request fewer pages": too important to sit near the end. Move
pageProviderDebounceTimeup front, as the first step for any network provider. Also point to it from thepageProviderdocs (Utilities) and the VirtualGrid props table. - Remove the tree-shaking sentences. They change no decision a reader makes:
guides/performance: "A bundle that imports onlyVirtualGridcontains none of the primitives."reference/primitives: "The grid does not importvvirtual-grid/primitives. A bundle that imports none of them contains none of them."- Changelog 1.2.0 "Build" entry: drop the second sentence.
- Changelog page: say that
vvirtual-gridis a fork ofvue-virtual-scroll-gridby Roc Wang, published on npm up to 1.11.0. Releases before the fork are in that repository, not here. This changelog starts at the fork (1.1.x). - Accessibility, keyboard focus: turn it into a guide with steps and code, not loose sentences.
- "The grid does not handle keys." and "A roving tabindex works with virtualized items." are two contexts side by side. Split them (new paragraph or callout) or drop the second.
- "on the item whose index matches": matches what. Name it: the focused index you keep in a ref.
- "On an arrow key": how the reader got there is never shown. Add the step that listens for
keydownon the grid, then map each arrow key to a row or column change.
- Utilities intro: "or write one for an API" is unclear. Write "or write your own provider for an API", linking to the section.
- Utilities, rejected promise warning: rewrite so it flows. Draft from review: "The virtual grid does not handle a rejected promise. If your provider throws or rejects, the grid stops loading pages. Handle errors inside the provider and return an empty array instead."
- Too many primitives (8). Proposed cut to 4, pending decision:
- Merge
getItemRectByIndexandgetItemViewportRectintogetItemRect. Withoutrootit returns grid coordinates. Withrootit adds the grid's viewport origin. - Keep
getItemCellandgetIndexByCell, the two-way index and cell mapping thatgrid-auto-flow: columnmakes non-trivial. - Drop
getGridDimensions:Math.ceil(length / columns)and friends. Document the formula. - Drop
getItemElementandgetItemIndex. They wrap native DOM calls. Documentroot.querySelector(':scope > [data-index="42"]')andtarget.closest("[data-index]"). - Keep
createItemTracker, the only one that is real work to rewrite (diffing rendered elements without allocating). Or drop it too, ifonRenderplus a query is enough.
- Merge
- VirtualGrid warning, use the reviewed wording (with "its", not "it's"): "Do not set
overflowor a fixed height on<VirtualGrid>itself. After computing, the grid sets its own height, overriding whatever you set, and the page scrolls instead of the grid." - Callbacks: switch
onRender,onViewportScrollandonLayoutChangefrom function props to emitted events (defineEmits:render,viewport-scroll,layout-change). Usage in templates stays@renderand so on. Benchmark the scroll path before and after, sinceviewport-scrollfires on every scroll event. Document them under "Events", not "Props". - Primitives intro, reword in the same voice. Draft: "The grid does not add ARIA roles, focus handling or overlays. Instead, it gives you the positions it already computes, so you can build them yourself. Use the primitives to get an item's rectangle, or its row and column, even when the item is not rendered."
- Run the editorial checklist (
dotfiles/.agents/skills/editorial/references/checklist.md) on every page, item by item, and report it with evidence. It was not run on the first pass, only the banned-word and punctuation greps.
Decided, do not reopen: keep the C-API analogy on all three pages, keep the CSS anchor positioning and "Dispatch your own events" sections in the popovers guide, and do not introduce Tailwind in the docs.
- Benchmarks page (
reference/benchmarks): the 1.1.6 and 1.2.0 tables were written but the page was not opened in a browser. Check the tables render. - The sideways sample in
guides/sizing-and-directionnow uses fixed row tracks (grid-rows-[repeat(2,150px)]) and no height on the grid. The layout was tested by overriding styles on the Introduction demo, not by running the sample itself. - Accessibility guide:
- "Choosing a role pattern" is reference material inside a guide. Move it to Reference.
- The note about Tab not entering the grid describes a break, so make it a warning. Also
cover the case where the focused index is a placeholder, which has no
tabindex. - "NVDA on Windows" and "VoiceOver" in the last step: say what each is, as the examples page does.
- "as above" in the
aria-activedescendantwarning: name the step instead. - Step 3 repeats the whole placeholder slot. Show only the added attribute.
- Sizing guide:
- "Every item then gets the probe's width and height" is wrong. The grid positions items as if they had the probe's size. It does not size them.
- Steps 1 and 2 have no code. The one sample under step 3 covers all three.
grid = useTemplateRef("grid")andref="grid"are unused in the samples.- "Scroll to an item" is a props fact with no steps. Move it to the props table.
- "Check the order" names no action. Link
getItemCellto its anchor.
- Performance guide:
- "The grid itself is cheap" is a bare adjective. Say compared to what.
- The layout-thrashing sample leaves
query,popoverandrootunsourced. - "Handlers that read before they write show none" is wrong. Layout blocks still appear, only the forced-reflow mark goes.
- "multiplies by the few hundred items": multiplies what. Check the re-render claim against the architecture page.
- Floating UI guide:
- Step 1 repeats the
DOMRectfield list from the primitives reference. Link it. - "This is acceptable here" is a bare adjective.
- The
autoUpdatesection explains Floating UI internals. Cut to what the reader does. - The check does not say how to see that the item left the DOM.
flip()at the window's bottom edge was not tested. The maintainer said it is not needed.
- Step 1 repeats the
- Primitives reference:
- "Types" repeats "Query objects". Link the exported types and keep
ItemLayout. - "set
layoutandrootwhen they change" disagrees with the sample, which sets them on every scroll. const current = 0;in the tracker sample has no purpose. Name itanchored.
- "Types" repeats "Query objects". Link the exported types and keep
- VirtualGrid reference:
fetchItemsin the first sample is undefined.- The slot prop
totalis passed byGrid.vueand documented nowhere. Document it or stop passing it. pageProviderDebounceTimeis bolded in the props table, unlike the other rows.
- Changelog:
- "up to version 1.11.0" next to "starts at the fork, with 1.1.x" reads as if 1.1.x were older. Say which upstream version the fork started from.
- Three 1.2.0 entries narrate internals or repeat the docs. One fact per entry.
- Examples page: each demo section is one dense paragraph. Split into what the demo shows,
numbered check steps, and a link to the guide. Link axe DevTools and
@axe-core/playwright. TheSource:links point atmainand 404 until this branch is merged. - Architecture page: name the key prefix (
<keyPrefix>.<index>), reword "After anawait, the ref held the closed instance", and link the events table instead of repeating it. core/README.md: "performant", "better performance" and "Minimum styling opinions" are bare adjectives. "3 scoped slots" is wrong forprobe, which has no props. The caveats paragraph on item size is convoluted. "Scroll Mode" omits the fixed rows column flow needs.- No screen reader was run on the ARIA demos. Attributes and keyboard behaviour were checked in a browser only.
- Not added: a Playwright test that asserts
aria-posinsetafter scrolling. The examples page shows a sample test only.