-
Notifications
You must be signed in to change notification settings - Fork 87
Create Comprehensive HMR Test Suite #858
Description
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
-
Create a new playground example named
hmr-test.- This can be bootstrapped by copying the existing
playground/requestInfo.
- This can be bootstrapped by copying the existing
-
Develop a new end-to-end test within the
hmr-testplayground, based on the testing pattern inplayground/requestInfo/__tests__/e2e.test.mts. -
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.tsxvia a?urlimport. - CSS Module Change: Modifying a
.module.cssfile 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.
- Worker Change: Modifying