@oxog/scrollex 1.0.0 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,65 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.0.3] - 2026-11-27
11
+
12
+ ### Changed
13
+ - Releases are cut by the `Publish` workflow from a `v*` tag: it checks the tag against `package.json` and that the version is not already on npm before installing anything, then builds, tests and publishes the tagged commit with a provenance attestation.
14
+ - A prerelease version such as `1.0.4-beta.0` publishes under its own dist-tag (`beta`), so a test release can be installed with `@beta` without moving `latest`.
15
+ - No source file changed since 1.0.2: this release ships the same code with the release process now living in the repository, and `CI` no longer runs on tags, so `Publish` is the only workflow a release triggers.
16
+
17
+ ### Internal
18
+ - CI and tests only, no runtime change: the suite runs on the `vmThreads` pool behind a coverage gate that `CI` enforces; the documentation website is installed with `npm ci`, typechecked and built in `CI`, and the Pages deploy waits for those checks and runs off Node 20; `prismjs` is deduped onto 1.30.0.
19
+ - The `1.0.x` changelog version links point at their tag pages instead of commit ranges.
20
+ - `npm run build` cleans `dist` once, before `tsup` starts: the first tsup config used to clean it while the plugins config was writing `dist/plugins`, which occasionally left `plugins/index.d.ts` and `plugins/index.d.cts` out of the build; the same command now also fails loudly if any of the 12 expected `dist` files is missing after `tsup` finishes, so a partial build can never reach npm.
21
+
22
+ ## [1.0.2] - 2026-11-24
23
+
24
+ ### Changed
25
+ - `engines` reports `>= 18.0.0` again: both published bundles import only `react` and `react/jsx-runtime`, so the Node 22.18 floor that the current test and build tools need is a development-only constraint and no longer warns installers of the package.
26
+ - The toolchain requirement is declared in `devEngines` (`^22.18.0 || ^24.11.0 || >=26.0.0`, `onFail: "warn"`), which npm checks when a contributor installs the project.
27
+ - CI runs on Node 24 and still runs `npm ci`, typecheck, the test suite and the build.
28
+
29
+ ### Security
30
+ - Updated the dev-only dependency tree to clear the reachable Dependabot advisories: `vitest` and `@vitest/coverage-v8` 5.1.1, `tsup` 9.0.0, and the website's React Router 7.18.7, Vite 8.3.8 and `@vitejs/plugin-react` 6.3.0. Nothing shipped changed: `dist` still imports only React.
31
+
32
+ ### Removed
33
+ - Unused `vitepress` devDependency and its `docs:*` scripts, which pointed at a `docs/` directory that does not exist.
34
+
35
+ ## [1.0.1] - 2026-11-24
36
+
37
+ ### Changed
38
+ - `Range.endIndex` is now the last item that is at least partly inside the viewport (inclusive, as documented). It used to be one past it, so a row starting exactly at the edge counted as visible.
39
+ - `useVirtualList` / `createKernel` accept `paddingStart` (`KernelOptions.paddingStart`); `initialScrollOffset` is applied once on mount.
40
+ - `keyboardNav`: with nothing focused, `ArrowDown` / `ArrowRight` focus the first item and other keys no longer move the focus; `Enter` / `Space` only act on a focused item.
41
+ - `VirtualList` ARIA: options carry `aria-setsize` / `aria-posinset` (the position among all items) instead of the unsupported `aria-rowcount` / `aria-rowindex`; a horizontal list exposes `aria-orientation="horizontal"`.
42
+ - `DragHandleProps` handlers are typed with the new `DragEventLike` so they can be spread on React elements; `UseMeasureOptions`, `UseMeasureReturn` and `DragEventLike` are exported.
43
+
44
+ ### Fixed
45
+ - Hooks: `virtualItems` never contains items beyond the data in the render where the data shrinks (`items[virtualItem.index]` no longer throws).
46
+ - A smooth scroll keeps running when a masonry's items, columns or gap change.
47
+ - Item counts: measurements of removed items are dropped when the list shrinks; `measureItem` ignores invalid sizes and indices; entries that are `undefined` are rendered like any other item.
48
+ - Plugins created inline on every render (`plugins={[...]}`) keep their state per list: `infiniteLoaderPlugin` (load in flight), `keyboardNav` (focus), `dragToReorder` (drag in progress), `bidirectional` / `scrollRestoration` (one-time actions).
49
+ - Infinite loading: horizontal lists measure the end along their own axis, and a list that does not fill its viewport asks for more data.
50
+ - Grid: `aria-rowcount` is right right after mounting and after count changes; `overscan` changes take effect.
51
+ - Scroll engine: negative or non-finite animation durations scroll instantly; the position cache follows the clamped scroll position.
52
+ - Debug panel counts and percentage, masonry row visibility, `useMeasureMany` observation and several documentation samples were corrected.
53
+ - `keyboardNav`: `PageUp` / `PageDown` stop at the ends with `loop` on (arrow keys still wrap), and in a grid the focused item's whole row is scrolled into view.
54
+ - `scrollRestoration` restores the position of a new `key` on a list that stays mounted; `EventBus` once-handlers follow the same dispatch snapshot as other handlers.
55
+ - Layout inputs: `columns` that is not a positive whole number (0, a fraction, NaN) and `overscan` that is NaN or negative no longer break or empty the list/grid/masonry; a masonry item with a non-finite height no longer poisons the layout.
56
+ - Website: icon-only controls in the header and footer have accessible names.
57
+ - `columns="auto"` with an unusable `minColumnWidth` (0, negative, NaN) lays out one column instead of crashing the masonry / emptying the grid; `stickyHeaders` follows the axis of a horizontal list; masonry column heights end at each column's last item (no trailing gap) and the renderer reports an empty layout once uninstalled.
58
+ - `kernel.getScrollPosition()` now fills `offset` (position along the list's axis) and `percentage` (0-1); the debug panel's viewport overlay and item boundaries switches are documented as not implemented.
59
+ - Horizontal lists: `infiniteLoaderPlugin`, `autoMeasurerPlugin` and `bidirectional` follow the list's own axis (`scrollLeft` / width) instead of `scrollTop` / height.
60
+ - `infiniteLoaderPlugin` loads for a list that fits its viewport (it looks once at install); `scrollRestoration` waits for data that arrives after mount and no longer overwrites the saved position; `initialScrollOffset` also works when the list is empty at mount.
61
+ - Scroll events of programmatic scrolls carry their delta and direction; a smooth scroll never starts backward (its first frame can precede the start time).
62
+ - Grid and masonry size their columns from the content box of a padded container; `useVirtualGrid` no longer accepts list-only options it ignores (`estimatedItemHeight`, `horizontal`, `paddingStart`, `paddingEnd`, `scrollMargin`); `GridRendererOptions.getContainerWidth` is new.
63
+ - `infiniteLoaderPlugin`'s `reset()` drops the check its debounce window queued for the data being replaced, so a reset list no longer loads for the position it had in the old data.
64
+ - Removing items rebuilds the measured count and size sum from the entries that remain: a shifted measurement that lands on an index that is still measured no longer leaves both overstated.
65
+ - A programmatic scroll stopped from inside a frame (a host that reports the scroll synchronously) really ends: the running frame neither schedules another one nor clears the state of a newer animation.
66
+ - `autoMeasurerPlugin` drops an element's previous index when it is observed for a new one, so an element reused for another row is no longer measured under its stale index.
67
+ - `useLoadMoreWhenShort` handles a rejected `onLoadMore()` (logged as `[Scrollex] Error in onLoadMore:`) instead of leaving an unhandled rejection.
68
+
10
69
  ## [1.0.0] - 2025-12-27
11
70
 
12
71
  ### Added
@@ -39,13 +98,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
39
98
  - `scrollControllerPlugin` - Programmatic scroll control with easing functions
40
99
 
41
100
  #### Optional Plugins
42
- - `debugPanelPlugin` - Visual debugging panel with FPS, render count, and memory stats
101
+ - `debugPanel` - Visual debugging panel with FPS, render count, and memory stats
43
102
 
44
103
  #### Performance Features
45
104
  - Zero runtime dependencies (React is peer dependency only)
46
- - Tree-shakeable exports for minimal bundle size (~3KB core)
105
+ - Tree-shakeable exports for minimal bundle size (~5KB core)
47
106
  - Measurement caching for variable heights
48
- - Object pooling to minimize garbage collection
49
107
  - CSS containment support for rendering optimization
50
108
  - Overscan configuration for smooth scrolling
51
109
 
@@ -60,9 +118,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
60
118
  - Tested with 100,000+ items at consistent 60fps
61
119
  - Supports React 17.0.0 and above
62
120
  - Node.js 18.0.0+ required for development
63
- - Modern browser support (Chrome 80+, Firefox 75+, Safari 13+, Edge 80+)
121
+ - Modern browser support (Chrome 80+, Firefox 75+, Safari 13.1+, Edge 80+)
64
122
 
65
123
  ---
66
124
 
67
- [Unreleased]: https://github.com/ersinkoc/Scrollex/compare/v1.0.0...HEAD
125
+ [Unreleased]: https://github.com/ersinkoc/Scrollex/compare/v1.0.3...HEAD
126
+ [1.0.3]: https://github.com/ersinkoc/Scrollex/compare/v1.0.2...v1.0.3
127
+ [1.0.2]: https://github.com/ersinkoc/Scrollex/compare/v1.0.1...v1.0.2
128
+ [1.0.1]: https://github.com/ersinkoc/Scrollex/compare/v1.0.0...v1.0.1
68
129
  [1.0.0]: https://github.com/ersinkoc/Scrollex/releases/tag/v1.0.0
package/README.md CHANGED
@@ -19,7 +19,7 @@
19
19
 
20
20
  - **Zero Dependencies** - No runtime dependencies, React is a peer dependency
21
21
  - **High Performance** - 100k+ items at 60fps with RAF-based rendering
22
- - **Micro-Kernel Architecture** - Small core (~3KB) with tree-shakeable plugins
22
+ - **Micro-Kernel Architecture** - Small core (~5KB) with tree-shakeable plugins
23
23
  - **Variable Heights** - Auto-measurement for dynamic content
24
24
  - **Infinite Scroll** - Built-in bidirectional infinite loading
25
25
  - **Multiple Layouts** - List, Grid, and Masonry components
@@ -191,25 +191,31 @@ Extend functionality with optional plugins:
191
191
 
192
192
  ```tsx
193
193
  import { VirtualList } from '@oxog/scrollex'
194
- import { infiniteLoaderPlugin, debugPanelPlugin } from '@oxog/scrollex/plugins'
195
-
196
- <VirtualList
197
- data={items}
198
- itemHeight={50}
199
- plugins={[
200
- infiniteLoaderPlugin({
201
- threshold: 200,
202
- onLoadMore: async (direction) => {
203
- const newItems = await fetchMore(direction)
204
- setItems(prev => [...prev, ...newItems])
205
- }
206
- }),
207
- debugPanelPlugin({ position: 'bottom-right' }),
208
- ]}
209
- renderItem={({ item, style }) => (
210
- <div style={style}>{item.name}</div>
211
- )}
212
- />
194
+ import { infiniteLoaderPlugin, debugPanel, DebugPanelOverlay } from '@oxog/scrollex/plugins'
195
+
196
+ // Create the debug panel once (outside render or in useMemo): the overlay reads its state
197
+ const debug = debugPanel({ position: 'bottom-right' })
198
+
199
+ <>
200
+ <VirtualList
201
+ data={items}
202
+ itemHeight={50}
203
+ plugins={[
204
+ infiniteLoaderPlugin({
205
+ threshold: 200,
206
+ onLoadMore: async (direction) => {
207
+ const newItems = await fetchMore(direction)
208
+ setItems(prev => [...prev, ...newItems])
209
+ }
210
+ }),
211
+ debug,
212
+ ]}
213
+ renderItem={({ item, style }) => (
214
+ <div style={style}>{item.name}</div>
215
+ )}
216
+ />
217
+ <DebugPanelOverlay plugin={debug} />
218
+ </>
213
219
  ```
214
220
 
215
221
  ### Available Plugins
@@ -221,7 +227,9 @@ import { infiniteLoaderPlugin, debugPanelPlugin } from '@oxog/scrollex/plugins'
221
227
  | `autoMeasurerPlugin` | Automatic height measurement |
222
228
  | `infiniteLoaderPlugin` | Infinite scroll loading |
223
229
  | `scrollControllerPlugin` | Programmatic scroll control |
224
- | `debugPanelPlugin` | Visual debugging tools |
230
+ | `debugPanel` + `DebugPanelOverlay` | Visual debugging tools |
231
+
232
+ `VirtualList`, `VirtualGrid` and their hooks already register `listRendererPlugin` / `gridRendererPlugin` themselves: passing one in `plugins` throws "already registered". Use them directly only with a kernel.
225
233
 
226
234
  ## Infinite Scroll
227
235
 
@@ -283,7 +291,7 @@ Tested with **100,000+ items** at consistent 60fps.
283
291
 
284
292
  - Chrome 80+
285
293
  - Firefox 75+
286
- - Safari 13+
294
+ - Safari 13.1+
287
295
  - Edge 80+
288
296
 
289
297
  ## Documentation