Skip to content

Conversation

@976520
Copy link
Owner

@976520 976520 commented Dec 22, 2025

No description provided.

@976520 976520 self-assigned this Dec 22, 2025
@976520 976520 marked this pull request as draft December 22, 2025 06:19
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @976520, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the @scrolloop/react package by introducing comprehensive Server-Side Rendering (SSR) support for the InfiniteList component. It includes a dedicated testing suite using Playwright for end-to-end validation of the SSR and hydration process, ensuring the component behaves as expected in both server and client environments. The changes involve refactoring the component's SSR logic, adding new build and server dependencies, and setting up a robust testing framework to maintain the quality and reliability of the SSR implementation.

Highlights

  • SSR Implementation & Refinement: The InfiniteList component now explicitly supports Server-Side Rendering, with the isSSR prop being renamed to isServerSide for clarity and consistency. The internal logic has been updated to leverage this new prop and a dedicated server-side environment detection utility.
  • Dedicated SSR/E2E Testing Infrastructure: New test files and configurations have been introduced to thoroughly validate the SSR and hydration behavior of the InfiniteList component. This includes Playwright configurations (playwright.config.ts), client-side hydration logic (client.tsx), an Express server for SSR (server.ts), and both Playwright E2E tests (ssr.e2e.test.ts) and Vitest unit tests (ssr.test.ts) specifically for SSR.
  • New Development Dependencies: The project now integrates several new development dependencies, including @playwright/test for end-to-end testing, express for the SSR test server, esbuild for client-side bundling within the test environment, and tsx for running TypeScript files directly.
  • Server-Side Environment Detection Utility: A new utility function isServerSide() has been added to packages/react/src/utils/isServerSide.ts to reliably determine if the code is executing in a server-side context, improving the robustness of SSR logic.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/ci.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces Server-Side Rendering (SSR) capabilities and adds a comprehensive testing suite, including unit, integration, and end-to-end tests with Playwright. The changes are well-implemented, particularly the renaming of isSSR to isServerSide for better clarity and the robust test cases for hydration. I have a few suggestions to improve maintainability and robustness, mainly around reducing code duplication in test files, refining configurations, and improving type safety. Overall, this is a great addition to the project.

Comment on lines +42 to +57
const initialData: TestItem[] = Array(50)
.fill(0)
.map((_, i) => ({ id: i, name: `Item ${i}` }));

const fetchPage = async (
page: number,
size: number
): Promise<PageResponse<TestItem>> => {
const start = page * size;
const end = start + size;
return {
items: initialData.slice(start, end),
total: initialData.length,
hasMore: end < initialData.length,
};
};
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The initialData and fetchPage logic is duplicated in client.tsx and ssr.test.ts. To improve maintainability and avoid inconsistencies, consider extracting this shared logic into a separate utility file within the src/__tests__/ssr/ directory, for example test-data.ts, and import it where needed.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@976520 976520 marked this pull request as ready for review December 23, 2025 01:30
@github-actions
Copy link

📊 Test Coverage Report (vitest)

Package Statements Branches Functions Lines
@scrolloop/core 188/188 (100%) 46/46 (100%) 23/23 (100%) 188/188 (100%)
@scrolloop/react 604/950 (63.57%) 112/133 (84.21%) 7/21 (33.33%) 604/950 (63.57%)
@scrolloop/react-native 0/237 (0%) 1/4 (25%) 1/4 (25%) 0/237 (0%)
@scrolloop/shared 0/119 (0%) 1/7 (14.28%) 1/7 (14.28%) 0/119 (0%)

@976520 976520 merged commit 0e8d873 into develop Dec 23, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants