v2 multi-axis#521
Open
clementroche wants to merge 18 commits into
Open
Conversation
Replace the useState/useEffect subscription in useStore with useSyncExternalStore, the canonical primitive for external stores. Bind subscribe/get as arrow class fields so they keep a stable identity when passed to the hook, and pass get as getServerSnapshot for correct SSR/hydration. Bump the react peer dep to >=18 since useSyncExternalStore is React 18+. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Remove the deprecated top-level autoRaf prop from ReactLenis and rely solely on options.autoRaf, simplifying the lenis setup effect and its dependency array. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Member
Author
Review notes (v2-multi-axis → v2)Automated + manual review of the full diff (23 files, +1496/−552). Logged here for the record. 🚩 Weird / shouldn't be committed
🐞 Bugs to fix before merge
|
Document why lerp completion is quantized: lerping asymptotically approaches the target without reaching it, so QUANTIZE snaps both values to a coarse grid to consider the animation done once within ~0.1 and avoid a never-ending animation. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Windows msys crash dumps (bash.exe.stackdump, playground/bash.exe.stackdump) were tracked in git. Delete them and add *.stackdump to .gitignore so they don't come back. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
scrollTo({ x, y }) fanned out into two scrollAxisTo calls, each handed the
same options — so onStart/onComplete/userData/lock applied once per axis
(callbacks fired twice; snap needed an inFlight workaround). Add a
dispatchScrollTo orchestrator: one call fires onStart once and onComplete
once across all driven axes.
- userData: single operation-scoped tag (get/set), readable until the whole
operation completes; getter no longer aggregates per-axis.
- lock: single instance-wide isLocked flag (get/set), all-or-nothing — drops
the per-axis lock and the OR/AND orientation composition that disagreed
with its own doc.
- offset: applies to every target form including 2D, and accepts
number | { x?, y? } for per-axis offsets.
- immediate: fires both onStart and onComplete.
- scrollAxisTo is now private (gesture handler + orchestrator only).
Document the full instance contract in LENIS-API.md as the source of truth.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Wire up the Snap demo in the two-axis playground with onSnapStart/onSnapComplete logging, map lenis/* to the built d.ts files in tsconfig, and record session permission grants. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ow doc When an axis becomes non-scrollable at runtime, Lenis.checkOverflow now calls updateClassName so `lenis-stopped` reflects the change. Also drop the stale "returns true" line from Axis.checkOverflow's JSDoc (it returns void). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Restore the public `Lenis.isSmooth` getter (isScrolling === 'smooth') removed during the multi-axis work, and document it in LENIS-API.md. - Snap README: fix the slideshow example (boolean `lock: true` + the required `mode: 'directional'`), document the `lock` option and the `align` tuple form, correct the `add(x, y?)` signature, and drop stale `type: 'mandatory'` references. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Merges the multi-axis work into
v2.Commits
refactor(react): useuseSyncExternalStorefor the lenis store (React peer bumped to >=18)refactor(react): drop deprecatedautoRafprop + its typescrollTo as a single logical operation
scrollTo({ x, y })used to fan out into twoscrollAxisTocalls, each handed the same options — soonStart/onComplete/userData/lockapplied once per axis. A newdispatchScrollToorchestrator makes one call = one operation:onStartfires once (first axis to start),onCompleteonce (last axis to settle). 2D snap no longer firesonSnapStart/onSnapCompletetwice.inFlightworkaround rationale).isLockedflag (get/set), all-or-nothing; drops the per-axis lock and the OR/AND orientation composition that contradicted its own doc.number | { x?, y? }for per-axis offsets.onStartandonComplete.scrollAxisTois now private (gesture handler + orchestrator only).Review fixes
emit('gesture', …)no longer forwardsfalseto subscribers (guard moved above the emit).QUANTIZEinanimate.tsdocumented.*.stackdumpcrash dumps and gitignored them.Docs
LENIS-API.md— behavioral source of truth for everyLenisproperty/method and everyscrollTooption.🤖 Generated with Claude Code