-
-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Virtualizer and WindowVirtualizer #303
Merged
Merged
Conversation
This file contains 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
inokawa
force-pushed
the
composable
branch
23 times, most recently
from
January 5, 2024 05:48
6808292
to
85b08ee
Compare
Closed
takecchi
referenced
this pull request
in cuculus-dev/cuculus
Jan 16, 2024
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [virtua](https://togithub.com/inokawa/virtua) | [`0.18.0` -> `0.20.5`](https://renovatebot.com/diffs/npm/virtua/0.18.0/0.20.5) | [![age](https://developer.mend.io/api/mc/badges/age/npm/virtua/0.20.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/virtua/0.20.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/virtua/0.18.0/0.20.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/virtua/0.18.0/0.20.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | @coderabbitai: ignore --- ### Release Notes <details> <summary>inokawa/virtua (virtua)</summary> ### [`v0.20.5`](https://togithub.com/inokawa/virtua/releases/tag/0.20.5) [Compare Source](https://togithub.com/inokawa/virtua/compare/0.20.4...0.20.5) #### What's Changed - Fix wrong minHeight/minWidth of Vue VList by [@​inokawa](https://togithub.com/inokawa) in [https://github.com/inokawa/virtua/pull/325](https://togithub.com/inokawa/virtua/pull/325) **Full Changelog**: inokawa/virtua@0.20.4...0.20.5 ### [`v0.20.4`](https://togithub.com/inokawa/virtua/releases/tag/0.20.4) [Compare Source](https://togithub.com/inokawa/virtua/compare/0.20.3...0.20.4) #### What's Changed - Fix swr minify issue in Next.js by [@​inokawa](https://togithub.com/inokawa) in [https://github.com/inokawa/virtua/pull/324](https://togithub.com/inokawa/virtua/pull/324) **Full Changelog**: inokawa/virtua@0.20.3...0.20.4 ### [`v0.20.3`](https://togithub.com/inokawa/virtua/releases/tag/0.20.3) [Compare Source](https://togithub.com/inokawa/virtua/compare/0.20.2...0.20.3) #### What's Changed - Improve touch handling in WindowVirtualizer by [@​inokawa](https://togithub.com/inokawa) in [https://github.com/inokawa/virtua/pull/321](https://togithub.com/inokawa/virtua/pull/321) **Full Changelog**: inokawa/virtua@0.20.2...0.20.3 ### [`v0.20.2`](https://togithub.com/inokawa/virtua/releases/tag/0.20.2) [Compare Source](https://togithub.com/inokawa/virtua/compare/0.20.1...0.20.2) #### What's Changed - Revert "Add `contain: content` to container element" by [@​inokawa](https://togithub.com/inokawa) in [https://github.com/inokawa/virtua/pull/318](https://togithub.com/inokawa/virtua/pull/318) **Full Changelog**: inokawa/virtua@0.20.1...0.20.2 ### [`v0.20.1`](https://togithub.com/inokawa/virtua/releases/tag/0.20.1) [Compare Source](https://togithub.com/inokawa/virtua/compare/0.20.0...0.20.1) #### What's Changed - Ignore inappropriate flex style by [@​inokawa](https://togithub.com/inokawa) in [https://github.com/inokawa/virtua/pull/316](https://togithub.com/inokawa/virtua/pull/316) - Update style of Vue VList to be the same as React by [@​inokawa](https://togithub.com/inokawa) in [https://github.com/inokawa/virtua/pull/317](https://togithub.com/inokawa/virtua/pull/317) **Full Changelog**: inokawa/virtua@0.20.0...0.20.1 ### [`v0.20.0`](https://togithub.com/inokawa/virtua/releases/tag/0.20.0) [Compare Source](https://togithub.com/inokawa/virtua/compare/0.19.2...0.20.0) #### BREAKING CHANGES - Incomplete padding support was dropped from `VList`. Use `Virtualizer` and `startMargin`/`endMargin` prop instead. ```tsx // VList <VList style={{ paddingTop:20, paddingBottom: 40 }}> {createRows(1000)} </VList> // Virtualizer <div style={{ overflowY: 'auto', overflowAnchor: "none" }}> <div style={{ height: 20 }}/> <Virtualizer startMargin={20} endMargin={40}> {createRows(1000)} </Virtualizer> <div style={{ height: 40 }}/> </div> ``` - `components.Root` prop of `VList` was removed. Use `Virtualizer` instead. If you want to customize scrollable element, just pass props to wrapper div. If you want to customize inner element, use `as` prop of `Virtualizer`. ```tsx // VList <VList components={{ Root: ViewportComponent }}> {createRows(1000)} </VList> // Virtualizer <div style={{ overflowY: 'auto' }}> <Virtualizer as={ContainerComponent}> {createRows(1000)} </Virtualizer> </div> ``` - `WVList` was renamed and changed to `WindowVirtualizer` because it has similar usability to `Virtualizer`. It's wrapper div was removed so add it by yourself if you need to apply some styles. ```tsx // WVList <div style={{ padding: 200 }}> <WVList style={{ border: "solid 1px gray" }}> {createRows(1000)} </WVList> </div> // WindowVirtualizer <div style={{ padding: 200 }}> <div style={{ border: "solid 1px gray" }}> <WindowVirtualizer>{createRows(1000)}</WindowVirtualizer> </div> </div> ``` - `components.Item` prop of `VList` was renamed to `item` - `initialItemSize` prop was renamed to `itemSize` - `onScrollStop` prop was renamed to `onScrollEnd` #### What's Changed - Add Virtualizer and WindowVirtualizer by [@​inokawa](https://togithub.com/inokawa) in [https://github.com/inokawa/virtua/pull/303](https://togithub.com/inokawa/virtua/pull/303) **Full Changelog**: inokawa/virtua@0.19.2...0.20.0 ### [`v0.19.2`](https://togithub.com/inokawa/virtua/releases/tag/0.19.2) [Compare Source](https://togithub.com/inokawa/virtua/compare/0.19.1...0.19.2) #### What's Changed - Fix bug that scrollOffset can become minus by filtering after scrolling by [@​inokawa](https://togithub.com/inokawa) in [https://github.com/inokawa/virtua/pull/314](https://togithub.com/inokawa/virtua/pull/314) **Full Changelog**: inokawa/virtua@0.19.1...0.19.2 ### [`v0.19.1`](https://togithub.com/inokawa/virtua/releases/tag/0.19.1) [Compare Source](https://togithub.com/inokawa/virtua/compare/0.19.0...0.19.1) #### What's Changed - Improve jump compensation after prepending by [@​inokawa](https://togithub.com/inokawa) in [https://github.com/inokawa/virtua/pull/313](https://togithub.com/inokawa/virtua/pull/313) **Full Changelog**: inokawa/virtua@0.19.0...0.19.1 ### [`v0.19.0`](https://togithub.com/inokawa/virtua/releases/tag/0.19.0) [Compare Source](https://togithub.com/inokawa/virtua/compare/0.18.1...0.19.0) - **BREAKING**: `initialItemCount` prop was renamed to `ssrCount` and now only for SSR #### What's Changed - Remove hidden style from items in SSR before hydration by [@​inokawa](https://togithub.com/inokawa) in [https://github.com/inokawa/virtua/pull/309](https://togithub.com/inokawa/virtua/pull/309) **Full Changelog**: inokawa/virtua@0.18.1...0.19.0 ### [`v0.18.1`](https://togithub.com/inokawa/virtua/releases/tag/0.18.1) [Compare Source](https://togithub.com/inokawa/virtua/compare/0.18.0...0.18.1) #### What's Changed - Refactor cache by [@​inokawa](https://togithub.com/inokawa) in [https://github.com/inokawa/virtua/pull/294](https://togithub.com/inokawa/virtua/pull/294) - Add docs for Vue by [@​inokawa](https://togithub.com/inokawa) in [https://github.com/inokawa/virtua/pull/295](https://togithub.com/inokawa/virtua/pull/295) - Refactor resizer by [@​inokawa](https://togithub.com/inokawa) in [https://github.com/inokawa/virtua/pull/300](https://togithub.com/inokawa/virtua/pull/300) - Use Vue JSX by [@​inokawa](https://togithub.com/inokawa) in [https://github.com/inokawa/virtua/pull/302](https://togithub.com/inokawa/virtua/pull/302) - Add `contain: content` to container element by [@​inokawa](https://togithub.com/inokawa) in [https://github.com/inokawa/virtua/pull/308](https://togithub.com/inokawa/virtua/pull/308) **Full Changelog**: inokawa/virtua@0.18.0...0.18.1 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/cuculus-dev/cuculus). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xMDMuMSIsInVwZGF0ZWRJblZlciI6IjM3LjEyNy4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: takecchi <takecchi.kobayashi@gmail.com>
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.
close #219
close #272
#284
#310
This PR will add new
Virtualizer
component and refactorVList
to use it. And it will also changeWVList
toWindowVirtualizer
(window scrolling version ofVirtualizer
).Why?
This project was started to create an one-fit-all component for list virtualization. However soon I had noticed that list virtualization has varieties of use cases. Supporting both easy usage and complex usage in one component will increase complexity of code and bundle size, and will lose simplicity of API.
So this PR is a first step moving forward. We will keep
VList
as simple solution for many. Otherwise addVirtualizer
to be customizable for advanced usage and composable with any markup/libraries. In the future, we will add more APIs toVirtualizer
to controll virtualization at lower level.