Skip to content

enhancement: reimplement createInfiniteScroll#969

Open
davedbase wants to merge 12 commits into
solidjs-community:nextfrom
davedbase:v2/create-infinite-scroll-improvement
Open

enhancement: reimplement createInfiniteScroll#969
davedbase wants to merge 12 commits into
solidjs-community:nextfrom
davedbase:v2/create-infinite-scroll-improvement

Conversation

@davedbase

@davedbase davedbase commented Jul 5, 2026

Copy link
Copy Markdown
Member

I've gone ahead and reimplemented createInfiniteScroll mostly to account for better error handling as referenced in issue #797. I also noticed we could do a better job of supporting Solid2 capabilities. This PR is meant to explore deeper use and exploration for infinite load pagination with the new API and capabilities.

Summary by CodeRabbit

  • New Features

    • Infinite scroll now loads each page independently, with per-page loading, error, and retry states.
    • Added a reset option to restart infinite scrolling from the beginning.
    • Pagination automatically adjusts when the total page count changes.
  • Bug Fixes

    • Failed page loads no longer stop infinite scrolling permanently; you can retry and continue.
    • Reducing the number of pages now correctly clears pages that are no longer needed.
  • Documentation

    • Updated pagination examples and API docs to match the new behavior.

@davedbase davedbase added the enhancement New feature or request label Jul 5, 2026
@changeset-bot

changeset-bot Bot commented Jul 5, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: ca1ee76

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1fd51f34-f599-4d05-a29e-b4a2be0b1319

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@davedbase davedbase changed the title patch: reimplement createInfiniteScroll enhancement: reimplement createInfiniteScroll Jul 5, 2026
@davedbase davedbase changed the base branch from main to next July 5, 2026 16:32
@davedbase davedbase mentioned this pull request Jul 5, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.changeset/pagination-solid2-migration.md:
- Line 15: The changeset note references the wrong issue number for this
pagination rework. Update the release note text in the changeset entry so the
“resolves” reference matches the intended issue, replacing the current issue
identifier with `#797`. Keep the rest of the `createInfiniteScroll` summary
unchanged.

In `@packages/pagination/README.md`:
- Around line 221-223: Update the `reset()` documentation in the pagination
README to make it clear that it does not abort the underlying network request.
Reword the description around `reset()` so it says it disposes the reactive page
state and ignores any late result via the stale-request check in the pagination
flow, rather than implying the in-flight fetch is canceled. Keep the
clarification aligned with the `reset()` behavior and the `thisRequest !==
request` logic used by the page fetcher.

In `@packages/pagination/src/index.ts`:
- Around line 456-473: The request handling in the pagination fetch flow can
still update shared state after a page scope has been disposed, and synchronous
fetcher throws are not normalized. In the startRequest logic in the pagination
module, wrap fetcher(index) so sync failures become promise rejections, and add
a disposal check before any then/catch state updates so stale requests cannot
call setEnd, setFetching, setError, or reobserve after cleanup.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 469df13e-baf5-47ff-9c4a-c76f746f9e01

📥 Commits

Reviewing files that changed from the base of the PR and between a896536 and d72a897.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (8)
  • .changeset/pagination-solid2-migration.md
  • package.json
  • packages/pagination/README.md
  • packages/pagination/src/index.ts
  • packages/pagination/stories/pagination.stories.tsx
  • packages/pagination/test/index.test.ts
  • packages/pagination/test/server.test.ts
  • pnpm-workspace.yaml

Comment thread .changeset/pagination-solid2-migration.md Outdated
Comment thread packages/pagination/README.md Outdated
Comment thread packages/pagination/src/index.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant