This guide provides essential tips for contributors working on the RSC plugin.
Tests use Playwright and are located in e2e/ and use examples as test apps.
examples/basic- comprehensive test suite for the RSC pluginexamples/starter- lightweight base template for writing more targeted tests usingsetupInlineFixtureutilityexamples/e2e/temp/- base directory for test projects
Expanding examples/basic (for comprehensive features)
Best for features that should be part of the main test suite. examples/basic is mainly used for e2e testing:
- Add your test case files to
examples/basic/src/routes/ - Update the routing in
examples/basic/src/routes/root.tsx - Add corresponding tests in
e2e/basic.test.ts
Using setupInlineFixture (for specific edge cases)
Best for testing specific edge cases or isolated features. See e2e/ssr-thenable.test.ts for the pattern.
# Build packages
pnpm dev # pnpm -C packages/plugin-rsc dev
# Type check
pnpm -C packages/plugin-rsc tsc-dev
# Run examples
pnpm -C packages/plugin-rsc/examples/basic dev # build / preview
pnpm -C packages/plugin-rsc/examples/starter dev # build / preview
# Run all e2e tests
pnpm -C packages/plugin-rsc test-e2e
# Run with UI (this allows filtering interactively)
pnpm -C packages/plugin-rsc test-e2e --ui
# Run specific test file
pnpm -C packages/plugin-rsc test-e2e basic
# Run with filter/grep
pnpm -C packages/plugin-rsc test-e2e -g "hmr"
# Test projects created with `setupInlineFixture` are locally runnable. For example:
pnpm -C packages/plugin-rsc/examples/e2e/temp/react-compiler dev- Prefer
setupInlineFixturefor new tests - it's more maintainable and faster - The
examples/basicproject contains comprehensive test scenarios - Dependencies for temp test projects are managed in
examples/e2e/package.json