Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/rsbuild-rule-use-falsy-loaders.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@tanstack/start-plugin-core': patch
---

fix: the Rsbuild RSC integration skips falsy entries in a rule's `use` array (Rspack's conditionally disabled loaders) instead of treating them as loaders.
2 changes: 1 addition & 1 deletion benchmarks/bundle-size/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"vue": "^3.5.16"
},
"devDependencies": {
"@rsbuild/core": "^2.1.0",
"@rsbuild/core": "^2.3.1",
"@rsbuild/plugin-react": "^2.0.0",
"@tanstack/router-plugin": "workspace:^",
"@types/react": "^19.0.8",
Expand Down
2 changes: 1 addition & 1 deletion e2e/react-router/rspack-basic-file-based/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"devDependencies": {
"@playwright/test": "^1.61.0",
"@rsbuild/core": "^2.1.0",
"@rsbuild/core": "^2.3.1",
"@rsbuild/plugin-react": "^2.0.0",
"@tailwindcss/postcss": "^4.2.2",
"@tanstack/router-e2e-utils": "workspace:^",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"devDependencies": {
"@playwright/test": "^1.61.0",
"@rsbuild/core": "^2.1.0",
"@rsbuild/core": "^2.3.1",
"@rsbuild/plugin-react": "^2.0.0",
"@tailwindcss/postcss": "^4.2.2",
"@tanstack/router-e2e-utils": "workspace:^",
Expand Down
2 changes: 1 addition & 1 deletion e2e/react-start/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
},
"devDependencies": {
"@playwright/test": "^1.61.0",
"@rsbuild/core": "^2.1.0",
"@rsbuild/core": "^2.3.1",
"@rsbuild/plugin-react": "^2.0.0",
"@tailwindcss/postcss": "^4.2.2",
"@tailwindcss/vite": "^4.2.2",
Expand Down
2 changes: 1 addition & 1 deletion e2e/react-start/css-inline/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
"devDependencies": {
"@playwright/test": "^1.61.0",
"@rsbuild/core": "^2.1.0",
"@rsbuild/core": "^2.3.1",
"@rsbuild/plugin-react": "^2.0.0",
"@tanstack/router-e2e-utils": "workspace:^",
"@types/node": "^22.10.2",
Expand Down
2 changes: 1 addition & 1 deletion e2e/react-start/custom-server-rsbuild/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"devDependencies": {
"@playwright/test": "^1.61.0",
"@rsbuild/core": "^2.1.0",
"@rsbuild/core": "^2.3.1",
"@rsbuild/plugin-react": "^2.0.0",
"@tailwindcss/postcss": "^4.2.2",
"@tanstack/router-e2e-utils": "workspace:^",
Expand Down
2 changes: 1 addition & 1 deletion e2e/react-start/deferred-hydration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"react-dom": "^19.0.0"
},
"devDependencies": {
"@rsbuild/core": "^2.1.0",
"@rsbuild/core": "^2.3.1",
"@rsbuild/plugin-react": "^2.0.0",
"@tanstack/router-e2e-utils": "workspace:^",
"@types/node": "^22.10.2",
Expand Down
2 changes: 1 addition & 1 deletion e2e/react-start/hmr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"devDependencies": {
"@playwright/test": "^1.61.0",
"@rsbuild/core": "^2.1.0",
"@rsbuild/core": "^2.3.1",
"@rsbuild/plugin-react": "^2.0.0",
"@tailwindcss/postcss": "^4.2.2",
"@tailwindcss/vite": "^4.2.2",
Expand Down
2 changes: 1 addition & 1 deletion e2e/react-start/import-protection/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
"devDependencies": {
"@playwright/test": "^1.61.0",
"@rsbuild/core": "^2.1.0",
"@rsbuild/core": "^2.3.1",
"@rsbuild/plugin-react": "^2.0.0",
"@tanstack/router-e2e-utils": "workspace:^",
"@types/node": "^22.10.2",
Expand Down
2 changes: 1 addition & 1 deletion e2e/react-start/response-reconciliation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"devDependencies": {
"@playwright/test": "^1.57.0",
"@rsbuild/core": "^2.0.8",
"@rsbuild/core": "^2.3.1",
"@rsbuild/plugin-react": "^2.0.0",
"@tanstack/router-e2e-utils": "workspace:^",
"@types/node": "25.0.9",
Expand Down
2 changes: 1 addition & 1 deletion e2e/react-start/rsbuild/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"devDependencies": {
"@playwright/test": "^1.61.0",
"@rsbuild/core": "^2.1.0",
"@rsbuild/core": "^2.3.1",
"@rsbuild/plugin-react": "^2.0.0",
"@tanstack/router-e2e-utils": "workspace:^",
"@types/node": "^22.10.2",
Expand Down
2 changes: 1 addition & 1 deletion e2e/react-start/rsc-rsbuild/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"devDependencies": {
"@playwright/test": "^1.61.0",
"@rsbuild/core": "^2.1.0",
"@rsbuild/core": "^2.3.1",
"@rsbuild/plugin-react": "^2.0.0",
"@tanstack/router-e2e-utils": "workspace:^",
"@types/node": "^22.10.2",
Expand Down
2 changes: 1 addition & 1 deletion e2e/react-start/rsc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
},
"devDependencies": {
"@playwright/test": "^1.61.0",
"@rsbuild/core": "^2.1.0",
"@rsbuild/core": "^2.3.1",
"@rsbuild/plugin-react": "^2.0.0",
"@tanstack/eslint-plugin-start": "workspace:^",
"@tanstack/router-e2e-utils": "workspace:^",
Expand Down
2 changes: 1 addition & 1 deletion e2e/react-start/server-functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
},
"devDependencies": {
"@playwright/test": "^1.61.0",
"@rsbuild/core": "^2.1.0",
"@rsbuild/core": "^2.3.1",
"@rsbuild/plugin-react": "^2.0.0",
"@tailwindcss/postcss": "^4.2.2",
"@tailwindcss/vite": "^4.2.2",
Expand Down
2 changes: 1 addition & 1 deletion e2e/react-start/session-handling/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
},
"devDependencies": {
"@playwright/test": "^1.57.0",
"@rsbuild/core": "^2.0.8",
"@rsbuild/core": "^2.3.1",
"@rsbuild/plugin-react": "^2.0.0",
"@tanstack/router-e2e-utils": "workspace:^",
"@types/node": "25.0.9",
Expand Down
2 changes: 1 addition & 1 deletion e2e/solid-router/rspack-basic-file-based/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"devDependencies": {
"@playwright/test": "^1.61.0",
"@rsbuild/core": "^2.1.0",
"@rsbuild/core": "^2.3.1",
"@rsbuild/plugin-babel": "^1.1.2",
"@rsbuild/plugin-solid": "^1.1.1",
"@tailwindcss/postcss": "^4.2.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"devDependencies": {
"@playwright/test": "^1.61.0",
"@rsbuild/core": "^2.1.0",
"@rsbuild/core": "^2.3.1",
"@rsbuild/plugin-babel": "^1.1.2",
"@rsbuild/plugin-solid": "^1.1.1",
"@tailwindcss/postcss": "^4.2.2",
Expand Down
2 changes: 1 addition & 1 deletion e2e/solid-start/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
},
"devDependencies": {
"@playwright/test": "^1.61.0",
"@rsbuild/core": "^2.1.0",
"@rsbuild/core": "^2.3.1",
"@rsbuild/plugin-babel": "^1.1.2",
"@rsbuild/plugin-solid": "^1.1.1",
"@tailwindcss/postcss": "^4.2.2",
Expand Down
2 changes: 1 addition & 1 deletion e2e/solid-start/deferred-hydration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"solid-js": "^1.9.10"
},
"devDependencies": {
"@rsbuild/core": "^2.1.0",
"@rsbuild/core": "^2.3.1",
"@rsbuild/plugin-babel": "^1.1.2",
"@rsbuild/plugin-solid": "^1.1.1",
"@tanstack/router-e2e-utils": "workspace:^",
Expand Down
2 changes: 1 addition & 1 deletion e2e/vue-router/rspack-basic-file-based/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"devDependencies": {
"@playwright/test": "^1.61.0",
"@rsbuild/core": "^2.1.0",
"@rsbuild/core": "^2.3.1",
"@rsbuild/plugin-babel": "^1.1.2",
"@rsbuild/plugin-vue": "^1.2.7",
"@rsbuild/plugin-vue-jsx": "^2.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"devDependencies": {
"@playwright/test": "^1.61.0",
"@rsbuild/core": "^2.1.0",
"@rsbuild/core": "^2.3.1",
"@rsbuild/plugin-babel": "^1.1.2",
"@rsbuild/plugin-vue": "^1.2.7",
"@rsbuild/plugin-vue-jsx": "^2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion e2e/vue-start/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
},
"devDependencies": {
"@playwright/test": "^1.61.0",
"@rsbuild/core": "^2.1.0",
"@rsbuild/core": "^2.3.1",
"@rsbuild/plugin-babel": "^1.1.2",
"@rsbuild/plugin-vue": "^1.2.7",
"@rsbuild/plugin-vue-jsx": "^2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/react/quickstart-rspack-file-based/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"tailwindcss": "^4.2.2"
},
"devDependencies": {
"@rsbuild/core": "^2.1.0",
"@rsbuild/core": "^2.3.1",
"@rsbuild/plugin-react": "^2.0.0",
"@tanstack/router-plugin": "^1.169.0",
"@types/react": "^19.0.8",
Expand Down
2 changes: 1 addition & 1 deletion examples/react/start-basic-rsbuild/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"zod": "^4.4.3"
},
"devDependencies": {
"@rsbuild/core": "^2.0.11",
"@rsbuild/core": "^2.3.1",
"@rsbuild/plugin-react": "^2.0.0",
"@rsbuild/plugin-tailwindcss": "^2.0.3",
"@types/node": "25.0.9",
Expand Down
2 changes: 1 addition & 1 deletion examples/solid/quickstart-rspack-file-based/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"tailwindcss": "^4.2.2"
},
"devDependencies": {
"@rsbuild/core": "^2.1.0",
"@rsbuild/core": "^2.3.1",
"@rsbuild/plugin-babel": "^1.1.2",
"@rsbuild/plugin-solid": "^1.1.1",
"@tanstack/router-plugin": "^1.169.0",
Expand Down
12 changes: 10 additions & 2 deletions packages/start-plugin-core/src/rsbuild/swc-rsc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type { ModifyRspackConfigFn, Rspack } from '@rsbuild/core'

type RspackConfig = Parameters<ModifyRspackConfigFn>[0]
type RspackRule = Rspack.RuleSetRule
type Falsy = false | 0 | '' | null | undefined

/**
* Walk the rspack config's module.rules and inject
Expand All @@ -27,7 +28,12 @@ export function enableSwcReactServerComponents(
return []
}

return typeof use === 'function' ? [] : Array.isArray(use) ? use : [use]
const loaders =
typeof use === 'function' ? [] : Array.isArray(use) ? use : [use]
// Rspack allows falsy entries in `use` for conditionally disabled loaders.
return loaders.filter(
(loader): loader is Exclude<typeof loader, Falsy> => !!loader,
)
}
const getLoaderPath = (
loader: ReturnType<typeof getRuleLoaders>[number],
Expand Down Expand Up @@ -66,7 +72,9 @@ export function enableSwcReactServerComponents(
}

if (Array.isArray(use)) {
return use.map((loader) => cloneLoader(loader)) as RspackRule['use']
return use.map((loader) =>
loader ? cloneLoader(loader) : loader,
) as RspackRule['use']
}

return cloneLoader(use) as RspackRule['use']
Expand Down
Loading
Loading