# @solid-primitives/scroll ## 3.0.0 ### Major Changes - 4cb6ec9: Migrate to Solid.js v2.0 (beta.14) ## Breaking Changes **Peer dependency**: `solid-js@^2.0.0-beta.14` and `@solidjs/web@^2.0.0-beta.14` are now required. ### `@solid-primitives/scroll` - `isServer` now imported from `@solidjs/web` (not `solid-js/web`) - `onMount` replaced with `onSettled` for post-render position refresh - `sharedConfig.context` replaced with `sharedConfig.hydrating` for hydration detection - Internal signal pattern replaced: Solid 2.0's `createSignal(fn)` creates a derived signal rather than storing a function value; now uses a version counter to drive memo re-evaluation on scroll events - Signal uses `{ ownedWrite: true }` to allow writes from DOM event handlers within reactive scopes - Tests updated: `createComputed` removed (no longer in Solid 2.0), replaced with direct reactive reads and `flush()` for synchronous assertions; `createSignal` in tests uses `{ ownedWrite: true }` - README: `onMount` example updated to `onSettled` ### Patch Changes - b7ef2f3: `createPreventScroll`'s active-instance stack and body-style ref-counts now live in a `globalRegistry` (keyed on `globalThis`, not module-scope bindings), so they stay correct even if the app's dependency graph ends up with more than one copy of this package installed — module-scope state would otherwise be split across copies, breaking the "topmost instance" ref-counting. Also replaced a hand-rolled `contains()` helper with the equivalent one already exported from `@solid-primitives/utils`. No API changes. - 855bc1b: `createPreventScroll` now locks scroll on `document.documentElement` instead of ``. Locking `` could break `position: sticky` elements, since sticky positioning is computed relative to the nearest scrolling ancestor — when that ancestor was `` instead of the viewport, sticky children would unstick while scroll was prevented. Scrollbar-width, padding/margin compensation, and scroll-position restoration are all computed against `documentElement` now as well. - dd165cd: Make client-only effects transparent to Solid 2 hydration and call hydratable helpers’ onSettled on both server and client so later nodes bind correctly. - 50e36c9: Bump the `solid-js`/`@solidjs/web` peer and dev dependency range to `2.0.0-beta.20`. No API or behavior changes; beta.19/beta.20 introduced no breaking changes upstream (internal tree-shaking work, a new `solid-js/refresh` HMR entry point, and SSR/hydration/`lazy()` bug fixes). - c98cb2d: Bump the `solid-js`/`@solidjs/web`/`@solidjs/signals`/`babel-preset-solid` peer and dev dependency range to `2.0.0-rc.0`. No API or behavior changes on our end — this tracks upstream's move from the beta series into the release candidate. - 1b703e1: Bump the `solid-js`/`@solidjs/web`/`@solidjs/signals` peer and dev dependency range to `2.0.0-rc.14`. - 638c530: Bump the `solid-js`/`@solidjs/web`/`@solidjs/signals` peer and dev dependency range to `2.0.0-rc.9`, and `babel-preset-solid` to `2.0.0-rc.2`. Two behavior fixes were needed to keep up with upstream changes in this range: - `@solid-primitives/deep`: `captureStoreUpdates` no longer missed property changes. As of `2.0.0-rc.1` a store's `[$TRACK]` only fires for structural changes (key additions/removals), so leaf value changes stopped being reported. Each node's direct property values are now tracked individually. Updates are still reported at the shallowest node that actually changed. - `@solid-primitives/storage`: `makePersisted` no longer persists stale data. Signal writes stay pending until the next flush in `2.0.0-rc.1`+, so reading the value back inside the setter returned the _previous_ one — persisting stale data, or removing the stored entry entirely when the previous value was nullish. The value returned by the setter is now persisted directly. - 04a170e: Import `sharedConfig` and `createOwner` from `solid-js/internal`, where `solid-js@2.0.0` declares them. They resolve to the same objects as before; this only fixes type resolution (and the JSR type check). - Updated dependencies [89c5324] - Updated dependencies [cc30d55] - Updated dependencies [5fc4efa] - Updated dependencies [a47cf15] - Updated dependencies [ab4c926] - Updated dependencies [4a5bf32] - Updated dependencies [dd165cd] - Updated dependencies [7ee755d] - Updated dependencies [50e36c9] - Updated dependencies [c98cb2d] - Updated dependencies [1b703e1] - Updated dependencies [638c530] - Updated dependencies [04a170e] - Updated dependencies [91a92aa] - Updated dependencies [b7ef2f3] - Updated dependencies [5c23fda] - @solid-primitives/utils@7.0.0 - @solid-primitives/event-listener@3.0.0 - @solid-primitives/rootless@2.0.0 - @solid-primitives/static-store@1.0.0 ## 3.0.0-next.7 ### Patch Changes - dd165cd: Make client-only effects transparent to Solid 2 hydration and call hydratable helpers’ onSettled on both server and client so later nodes bind correctly. - Updated dependencies [dd165cd] - @solid-primitives/event-listener@3.0.0-next.8 - @solid-primitives/utils@7.0.0-next.7 - @solid-primitives/static-store@1.0.0-next.5 ## 3.0.0-next.6 ### Patch Changes - 1b703e1: Bump the `solid-js`/`@solidjs/web`/`@solidjs/signals` peer and dev dependency range to `2.0.0-rc.14`. - Updated dependencies [1b703e1] - @solid-primitives/event-listener@3.0.0-next.7 - @solid-primitives/rootless@2.0.0-next.4 - @solid-primitives/static-store@1.0.0-next.4 - @solid-primitives/utils@7.0.0-next.6 ## 3.0.0-next.5 ### Patch Changes - 638c530: Bump the `solid-js`/`@solidjs/web`/`@solidjs/signals` peer and dev dependency range to `2.0.0-rc.9`, and `babel-preset-solid` to `2.0.0-rc.2`. Two behavior fixes were needed to keep up with upstream changes in this range: - `@solid-primitives/deep`: `captureStoreUpdates` no longer missed property changes. As of `2.0.0-rc.1` a store's `[$TRACK]` only fires for structural changes (key additions/removals), so leaf value changes stopped being reported. Each node's direct property values are now tracked individually. Updates are still reported at the shallowest node that actually changed. - `@solid-primitives/storage`: `makePersisted` no longer persists stale data. Signal writes stay pending until the next flush in `2.0.0-rc.1`+, so reading the value back inside the setter returned the _previous_ one — persisting stale data, or removing the stored entry entirely when the previous value was nullish. The value returned by the setter is now persisted directly. - Updated dependencies [7ee755d] - Updated dependencies [638c530] - @solid-primitives/utils@7.0.0-next.5 - @solid-primitives/event-listener@3.0.0-next.6 - @solid-primitives/rootless@2.0.0-next.3 - @solid-primitives/static-store@1.0.0-next.3 ## 3.0.0-next.4 ### Patch Changes - Bump the `solid-js`/`@solidjs/web`/`@solidjs/signals`/`babel-preset-solid` peer and dev dependency range to `2.0.0-rc.0`. No API or behavior changes on our end — this tracks upstream's move from the beta series into the release candidate. - Updated dependencies - @solid-primitives/event-listener@3.0.0-next.3 - @solid-primitives/rootless@2.0.0-next.2 - @solid-primitives/static-store@1.0.0-next.2 - @solid-primitives/utils@7.0.0-next.4 ## 3.0.0-next.3 ### Patch Changes - 855bc1b: `createPreventScroll` now locks scroll on `document.documentElement` instead of ``. Locking `` could break `position: sticky` elements, since sticky positioning is computed relative to the nearest scrolling ancestor — when that ancestor was `` instead of the viewport, sticky children would unstick while scroll was prevented. Scrollbar-width, padding/margin compensation, and scroll-position restoration are all computed against `documentElement` now as well. ## 3.0.0-next.2 ### Patch Changes - b7ef2f3: `createPreventScroll`'s active-instance stack and body-style ref-counts now live in a `globalRegistry` (keyed on `globalThis`, not module-scope bindings), so they stay correct even if the app's dependency graph ends up with more than one copy of this package installed — module-scope state would otherwise be split across copies, breaking the "topmost instance" ref-counting. Also replaced a hand-rolled `contains()` helper with the equivalent one already exported from `@solid-primitives/utils`. No API changes. - Updated dependencies [b7ef2f3] - @solid-primitives/utils@7.0.0-next.3 ## 3.0.0-next.1 ### Patch Changes - 50e36c9: Bump the `solid-js`/`@solidjs/web` peer and dev dependency range to `2.0.0-beta.20`. No API or behavior changes; beta.19/beta.20 introduced no breaking changes upstream (internal tree-shaking work, a new `solid-js/refresh` HMR entry point, and SSR/hydration/`lazy()` bug fixes). - Updated dependencies [50e36c9] - @solid-primitives/event-listener@3.0.0-next.2 - @solid-primitives/rootless@2.0.0-next.1 - @solid-primitives/static-store@1.0.0-next.1 - @solid-primitives/utils@7.0.0-next.2 ## 3.0.0-next.0 ### Major Changes - 4cb6ec9: Migrate to Solid.js v2.0 (beta.14) ## Breaking Changes **Peer dependency**: `solid-js@^2.0.0-beta.14` and `@solidjs/web@^2.0.0-beta.14` are now required. ### `@solid-primitives/scroll` - `isServer` now imported from `@solidjs/web` (not `solid-js/web`) - `onMount` replaced with `onSettled` for post-render position refresh - `sharedConfig.context` replaced with `sharedConfig.hydrating` for hydration detection - Internal signal pattern replaced: Solid 2.0's `createSignal(fn)` creates a derived signal rather than storing a function value; now uses a version counter to drive memo re-evaluation on scroll events - Signal uses `{ ownedWrite: true }` to allow writes from DOM event handlers within reactive scopes - Tests updated: `createComputed` removed (no longer in Solid 2.0), replaced with direct reactive reads and `flush()` for synchronous assertions; `createSignal` in tests uses `{ ownedWrite: true }` - README: `onMount` example updated to `onSettled` ### Patch Changes - Updated dependencies [89c5324] - Updated dependencies [4a5bf32] - @solid-primitives/utils@7.0.0-next.0 - @solid-primitives/event-listener@3.0.0-next.0 - @solid-primitives/rootless@2.0.0-next.0 - @solid-primitives/static-store@1.0.0-next.0 ## 2.1.5 ### Patch Changes - @solid-primitives/event-listener@2.4.5 - @solid-primitives/rootless@1.5.3 - @solid-primitives/static-store@0.1.3 ## 2.1.4 ### Patch Changes - f32f209: Update author email for David Di Biase. - Updated dependencies [f32f209] - @solid-primitives/event-listener@2.4.4 ## 2.1.3 ### Patch Changes - Updated dependencies [48d890d] - @solid-primitives/event-listener@2.4.3 ## 2.1.2 ### Patch Changes - 396812d: Enable verbatimModuleSyntax -> add `type` keyword to all type imports. - Updated dependencies [396812d] - @solid-primitives/event-listener@2.4.2 - @solid-primitives/static-store@0.1.2 - @solid-primitives/rootless@1.5.2 ## 2.1.1 ### Patch Changes - 53f08cc: fix: Move `"@solid-primitives/source"` export condition under import in package.json (Fixes #774, Fixes #749) - Updated dependencies [53f08cc] - @solid-primitives/event-listener@2.4.1 - @solid-primitives/static-store@0.1.1 - @solid-primitives/rootless@1.5.1 ## 2.1.0 ### Minor Changes - ea09f71: Remove CJS support. The package is ESM only now. ### Patch Changes - Updated dependencies [ea09f71] - @solid-primitives/event-listener@2.4.0 - @solid-primitives/static-store@0.1.0 - @solid-primitives/rootless@1.5.0 ## 2.0.24 ### Patch Changes - Updated dependencies [56d9511] - @solid-primitives/static-store@0.0.9 ## 2.0.23 ### Patch Changes - 74db287: Correct the "homepage" field in package.json - Updated dependencies [74db287] - @solid-primitives/event-listener@2.3.3 - @solid-primitives/rootless@1.4.5 - @solid-primitives/static-store@0.0.8 ## 2.0.22 ### Patch Changes - @solid-primitives/event-listener@2.3.2 - @solid-primitives/rootless@1.4.4 - @solid-primitives/static-store@0.0.7 ## 2.0.21 ### Patch Changes - d23dd74: Add type exports for cjs - Updated dependencies [d23dd74] - @solid-primitives/event-listener@2.3.1 - @solid-primitives/rootless@1.4.3 - @solid-primitives/static-store@0.0.6 ## 2.0.20 ### Patch Changes - Updated dependencies [b4398ee0] - @solid-primitives/event-listener@2.3.0 ## 2.0.19 ### Patch Changes - fc659d33: Fix `useWindowScrollPosition` on the server. (fixes #494) ## 2.0.18 ### Patch Changes - @solid-primitives/event-listener@2.2.14 - @solid-primitives/rootless@1.4.2 - @solid-primitives/static-store@0.0.5 ## 2.0.17 ### Patch Changes - @solid-primitives/event-listener@2.2.13 - @solid-primitives/rootless@1.4.1 - @solid-primitives/static-store@0.0.4 ## 2.0.16 ### Patch Changes - Updated dependencies [f03c47b0] - @solid-primitives/event-listener@2.2.12 ## 2.0.15 ### Patch Changes - Updated dependencies [5ea65ea9] - @solid-primitives/rootless@1.4.0 - @solid-primitives/event-listener@2.2.11 - @solid-primitives/static-store@0.0.3 ## 2.0.14 ### Patch Changes - 54c33ba5: use passive event listener for createScrollPosition ## 2.0.13 ### Patch Changes - 2f6d3732: Use the static-store package for creating reactive objects. Minor overall improvements - @solid-primitives/event-listener@2.2.10 - @solid-primitives/rootless@1.3.2 - @solid-primitives/static-store@0.0.2 ## 2.0.12 ### Patch Changes - 3fad3789: Revert from publishing separate server, development, and production builds that has to rely on export conditions to publishing a single build that can be used in any environment. Envs will be checked at with `isDev`and `isServer` consts exported by `"solid-js/web"` so it's still tree-shakeable. - Updated dependencies [3fad3789] - @solid-primitives/event-listener@2.2.9 - @solid-primitives/rootless@1.3.1 - @solid-primitives/utils@5.5.1 ## 2.0.11 ### Patch Changes - 464248f7: Improve behavior of primitives under hydration. - Updated dependencies [464248f7] - Updated dependencies [464248f7] - @solid-primitives/rootless@1.3.0 - @solid-primitives/utils@5.5.0 ## 2.0.10 ### Patch Changes - Updated dependencies [d6559a32] - @solid-primitives/utils@5.4.0 - @solid-primitives/event-listener@2.2.8 - @solid-primitives/rootless@1.2.6 ## 2.0.10-beta.0 ### Patch Changes - Updated dependencies [d6559a32] - @solid-primitives/utils@5.4.0-beta.0 - @solid-primitives/event-listener@2.2.8-beta.0 - @solid-primitives/rootless@1.2.6-beta.0 ## 2.0.9 ### Patch Changes - 865d5ee9: Fix build. (remove keepNames option) - Updated dependencies [865d5ee9] - @solid-primitives/event-listener@2.2.7 - @solid-primitives/rootless@1.2.5 - @solid-primitives/utils@5.2.1 ## 2.0.8 ### Patch Changes - Updated dependencies [c2866ea6] - Updated dependencies [c2866ea6] - @solid-primitives/event-listener@2.2.6 - @solid-primitives/rootless@1.2.3 - @solid-primitives/utils@5.0.0 ## 2.0.7 ### Patch Changes - dd2d7d1c: Improve export conditions. - Updated dependencies [dd2d7d1c] - @solid-primitives/event-listener@2.2.5 - @solid-primitives/rootless@1.2.2 - @solid-primitives/utils@4.0.1 ## 2.0.6 ### Patch Changes - Updated dependencies [9ed32b38] - @solid-primitives/utils@4.0.0 - @solid-primitives/event-listener@2.2.4 - @solid-primitives/rootless@1.2.1 ## 2.0.5 ### Patch Changes - b662fe9f: Improve package export contidions for SSR (node, workers, deno) - Updated dependencies [e36ed229] - Updated dependencies [a372d0e7] - Updated dependencies [b662fe9f] - Updated dependencies [abb8063c] - Updated dependencies [abb8063c] - @solid-primitives/rootless@1.2.0 - @solid-primitives/utils@3.1.0 - @solid-primitives/event-listener@2.2.3 ## 2.0.4 ### Patch Changes - 7ac41ed: Update to solid-js version 1.5 - Updated dependencies [7ac41ed] - @solid-primitives/event-listener@2.2.2 - @solid-primitives/rootless@1.1.3 - @solid-primitives/utils@3.0.2 ## 2.0.3 ### Patch Changes - Updated dependencies [73b6a34] - @solid-primitives/utils@3.0.0 - @solid-primitives/event-listener@2.2.1 - @solid-primitives/rootless@1.1.2 ## Changelog up to version 2.0.2 0.0.100 Initial porting of the scroll primitive. 1.0.4 Released new version with CJS and SSR support. 1.0.5 Updated to Solid 1.3 2.0.0 - **stage-2** Rename `createScrollObserver` to `createScrollPosition` and add y scroll axis to the returned value, making it a store-like object. Add `getScrollPosition` as a separately exported helper.