Skip to content

feat(nx): support rsbuild in Playwright inference#7221

Merged
beaussan merged 1 commit intoTanStack:mainfrom
beaussan:add-rsbuild-nx-support
Apr 18, 2026
Merged

feat(nx): support rsbuild in Playwright inference#7221
beaussan merged 1 commit intoTanStack:mainfrom
beaussan:add-rsbuild-nx-support

Conversation

@beaussan
Copy link
Copy Markdown
Contributor

@beaussan beaussan commented Apr 18, 2026

Summary

  • add rsbuild as a supported Playwright inference toolchain in the Nx Playwright plugin
  • choose the e2e build command per toolchain (vite or rsbuild) when generating inferred build targets
  • keep existing Vite behavior unchanged while enabling rsbuild-mode project inference

How to use rsbuild with Playwright inference

Add playwrightModes metadata to your package package.json and set toolchain to rsbuild:

{
  "nx": {
    "metadata": {
      "playwrightModes": [
        { "toolchain": "rsbuild", "mode": "spa" },
        { "toolchain": "rsbuild", "mode": "ssr", "shards": 3 }
      ]
    }
  }
}

When inferred targets are generated for an rsbuild mode, the build step uses:

  • rsbuild build && tsc --noEmit

Supported modes remain:

  • ssr
  • spa
  • prerender
  • preview

Summary by CodeRabbit

  • Chores
    • Extended the Playwright testing plugin to support rsbuild as a build toolchain alongside vite. The plugin now automatically selects and executes the appropriate build command based on the configured toolchain, enabling projects to run end-to-end tests with their preferred build system without manual configuration.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 18, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ccff3fbb-b14b-4395-8606-4ed08064984a

📥 Commits

Reviewing files that changed from the base of the PR and between bd97d09 and bee7d25.

📒 Files selected for processing (1)
  • scripts/nx/playwright-plugin.ts

📝 Walkthrough

Walkthrough

The Playwright plugin's build system was extended to support multiple toolchains. A PLAYWRIGHT_BUILD_COMMANDS mapping was introduced to provide toolchain-specific build commands (vite build && tsc --noEmit for Vite; rsbuild build && tsc --noEmit for Rsbuild), and the target generation logic was updated to reference this mapping instead of using a hardcoded command.

Changes

Cohort / File(s) Summary
Playwright Plugin Toolchain Support
scripts/nx/playwright-plugin.ts
Added PLAYWRIGHT_BUILD_COMMANDS mapping to support both vite and rsbuild toolchains. The target generation now selects build commands based on validated toolchain metadata instead of using a fixed vite command string.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 Hops of joy for toolchains new,
Rsbuild joins the vite crew,
Mapping build commands with care,
Flexibility blooming everywhere! 🚀

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding rsbuild support to the Playwright plugin in Nx, which matches the primary objective of the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 and usage tips.

@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud Bot commented Apr 18, 2026

View your CI Pipeline Execution ↗ for commit bee7d25

Command Status Duration Result
nx affected --targets=test:eslint,test:unit,tes... ✅ Succeeded <1s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 1s View ↗

☁️ Nx Cloud last updated this comment at 2026-04-18 20:58:24 UTC

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 18, 2026

More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/@tanstack/arktype-adapter@7221

@tanstack/eslint-plugin-router

npm i https://pkg.pr.new/@tanstack/eslint-plugin-router@7221

@tanstack/eslint-plugin-start

npm i https://pkg.pr.new/@tanstack/eslint-plugin-start@7221

@tanstack/history

npm i https://pkg.pr.new/@tanstack/history@7221

@tanstack/nitro-v2-vite-plugin

npm i https://pkg.pr.new/@tanstack/nitro-v2-vite-plugin@7221

@tanstack/react-router

npm i https://pkg.pr.new/@tanstack/react-router@7221

@tanstack/react-router-devtools

npm i https://pkg.pr.new/@tanstack/react-router-devtools@7221

@tanstack/react-router-ssr-query

npm i https://pkg.pr.new/@tanstack/react-router-ssr-query@7221

@tanstack/react-start

npm i https://pkg.pr.new/@tanstack/react-start@7221

@tanstack/react-start-client

npm i https://pkg.pr.new/@tanstack/react-start-client@7221

@tanstack/react-start-rsc

npm i https://pkg.pr.new/@tanstack/react-start-rsc@7221

@tanstack/react-start-server

npm i https://pkg.pr.new/@tanstack/react-start-server@7221

@tanstack/router-cli

npm i https://pkg.pr.new/@tanstack/router-cli@7221

@tanstack/router-core

npm i https://pkg.pr.new/@tanstack/router-core@7221

@tanstack/router-devtools

npm i https://pkg.pr.new/@tanstack/router-devtools@7221

@tanstack/router-devtools-core

npm i https://pkg.pr.new/@tanstack/router-devtools-core@7221

@tanstack/router-generator

npm i https://pkg.pr.new/@tanstack/router-generator@7221

@tanstack/router-plugin

npm i https://pkg.pr.new/@tanstack/router-plugin@7221

@tanstack/router-ssr-query-core

npm i https://pkg.pr.new/@tanstack/router-ssr-query-core@7221

@tanstack/router-utils

npm i https://pkg.pr.new/@tanstack/router-utils@7221

@tanstack/router-vite-plugin

npm i https://pkg.pr.new/@tanstack/router-vite-plugin@7221

@tanstack/solid-router

npm i https://pkg.pr.new/@tanstack/solid-router@7221

@tanstack/solid-router-devtools

npm i https://pkg.pr.new/@tanstack/solid-router-devtools@7221

@tanstack/solid-router-ssr-query

npm i https://pkg.pr.new/@tanstack/solid-router-ssr-query@7221

@tanstack/solid-start

npm i https://pkg.pr.new/@tanstack/solid-start@7221

@tanstack/solid-start-client

npm i https://pkg.pr.new/@tanstack/solid-start-client@7221

@tanstack/solid-start-server

npm i https://pkg.pr.new/@tanstack/solid-start-server@7221

@tanstack/start-client-core

npm i https://pkg.pr.new/@tanstack/start-client-core@7221

@tanstack/start-fn-stubs

npm i https://pkg.pr.new/@tanstack/start-fn-stubs@7221

@tanstack/start-plugin-core

npm i https://pkg.pr.new/@tanstack/start-plugin-core@7221

@tanstack/start-server-core

npm i https://pkg.pr.new/@tanstack/start-server-core@7221

@tanstack/start-static-server-functions

npm i https://pkg.pr.new/@tanstack/start-static-server-functions@7221

@tanstack/start-storage-context

npm i https://pkg.pr.new/@tanstack/start-storage-context@7221

@tanstack/valibot-adapter

npm i https://pkg.pr.new/@tanstack/valibot-adapter@7221

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/@tanstack/virtual-file-routes@7221

@tanstack/vue-router

npm i https://pkg.pr.new/@tanstack/vue-router@7221

@tanstack/vue-router-devtools

npm i https://pkg.pr.new/@tanstack/vue-router-devtools@7221

@tanstack/vue-router-ssr-query

npm i https://pkg.pr.new/@tanstack/vue-router-ssr-query@7221

@tanstack/vue-start

npm i https://pkg.pr.new/@tanstack/vue-start@7221

@tanstack/vue-start-client

npm i https://pkg.pr.new/@tanstack/vue-start-client@7221

@tanstack/vue-start-server

npm i https://pkg.pr.new/@tanstack/vue-start-server@7221

@tanstack/zod-adapter

npm i https://pkg.pr.new/@tanstack/zod-adapter@7221

commit: bee7d25

@beaussan beaussan marked this pull request as ready for review April 18, 2026 21:01
@beaussan beaussan merged commit 24b11a9 into TanStack:main Apr 18, 2026
7 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.

1 participant