Skip to content

Create Comprehensive HMR Test Suite #858

@justinvdm

Description

@justinvdm

Goal

Create a dedicated playground example (hmr-test) with a comprehensive end-to-end test suite to validate Hot Module Replacement (HMR) functionality and prevent regressions.

Motivation

Recent development has shown that our HMR logic can be fragile in certain edge cases. While the requestInfo playground provides good baseline coverage for client and server component HMR, we lack a dedicated suite to test more specific scenarios, particularly around CSS and worker updates. This ticket is to track the work to build out that more comprehensive test coverage.

Plan

  1. Create a new playground example named hmr-test.

    • This can be bootstrapped by copying the existing playground/requestInfo.
  2. Develop a new end-to-end test within the hmr-test playground, based on the testing pattern in playground/requestInfo/__tests__/e2e.test.mts.

  3. The test suite must cover HMR for the following file types and scenarios:

    • Worker Change: Modifying src/worker.tsx (e.g., by adding a new route and asserting it becomes available).
    • Global CSS Change: Modifying a global stylesheet that is imported into src/app/Document.tsx via a ?url import.
    • CSS Module Change: Modifying a .module.css file imported into a component.
    • Server Component Change: Modifying a React Server Component.
    • Server Action Change: Modifying a server action/function.
    • Client Component Change: Modifying a client component.

Metadata

Metadata

Assignees

No one assigned

    Labels

    1.xIssues planned for a minor release after 1.0

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions