Skip to content

Commit 370fb40

Browse files
fix: Split Start plugin core
1 parent 1248e44 commit 370fb40

20 files changed

Lines changed: 148 additions & 43 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
'@tanstack/start-plugin-core': minor
3+
'@tanstack/react-start': patch
4+
'@tanstack/react-start-rsc': patch
5+
'@tanstack/solid-start': patch
6+
'@tanstack/vue-start': patch
7+
---
8+
9+
Split Start plugin core bundler APIs into explicit Vite and Rsbuild subpaths so projects only need the bundler they use. Mark both `vite` and `@rsbuild/core` peers as optional where Start exposes both integrations.

‎packages/react-start-rsc/src/plugin/vite.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { fileURLToPath } from 'node:url'
22
import path from 'pathe'
3-
import { createVirtualModule } from '@tanstack/start-plugin-core'
3+
import { createVirtualModule } from '@tanstack/start-plugin-core/vite'
44
import type {
55
TanStackStartVitePluginCoreOptions,
66
ViteRscForwardSsrResolverStrategy,
7-
} from '@tanstack/start-plugin-core'
7+
} from '@tanstack/start-plugin-core/vite'
88
import type { PluginOption, UserConfig } from 'vite'
99

1010
const isClientEnvironment = (env: { config: { consumer: string } }) =>

‎packages/react-start/package.json‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,9 @@
176176
},
177177
"@vitejs/plugin-rsc": {
178178
"optional": true
179+
},
180+
"vite": {
181+
"optional": true
179182
}
180183
},
181184
"devDependencies": {

‎packages/react-start/src/plugin/rsbuild.ts‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import {
2-
START_ENVIRONMENT_NAMES,
2+
RSBUILD_ENVIRONMENT_NAMES,
33
tanStackStartRsbuild,
4-
} from '@tanstack/start-plugin-core'
4+
} from '@tanstack/start-plugin-core/rsbuild'
55
import { reactStartDefaultEntryPaths } from './shared'
6-
import type { TanStackStartRsbuildPluginCoreOptions } from '@tanstack/start-plugin-core/rsbuild/types'
7-
import type { TanStackStartRsbuildInputConfig } from '@tanstack/start-plugin-core'
6+
import type {
7+
TanStackStartRsbuildInputConfig,
8+
TanStackStartRsbuildPluginCoreOptions,
9+
} from '@tanstack/start-plugin-core/rsbuild'
810
import type { RsbuildPlugin } from '@rsbuild/core'
911

1012
export function tanstackStart(
@@ -15,7 +17,7 @@ export function tanstackStart(
1517
let corePluginOpts: TanStackStartRsbuildPluginCoreOptions = {
1618
framework: 'react',
1719
defaultEntryPaths: reactStartDefaultEntryPaths,
18-
providerEnvironmentName: START_ENVIRONMENT_NAMES.server,
20+
providerEnvironmentName: RSBUILD_ENVIRONMENT_NAMES.server,
1921
ssrIsProvider: true,
2022
}
2123

@@ -47,7 +49,7 @@ function configureRscRsbuild(): {
4749
serializationAdapters: TanStackStartRsbuildPluginCoreOptions['serializationAdapters']
4850
} {
4951
return {
50-
providerEnvironmentName: START_ENVIRONMENT_NAMES.server,
52+
providerEnvironmentName: RSBUILD_ENVIRONMENT_NAMES.server,
5153
serializationAdapters: [
5254
{
5355
client: {

‎packages/react-start/src/plugin/vite.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import {
22
START_ENVIRONMENT_NAMES,
33
tanStackStartVite,
4-
} from '@tanstack/start-plugin-core'
4+
} from '@tanstack/start-plugin-core/vite'
55
import type {
66
TanStackStartViteInputConfig,
77
TanStackStartVitePluginCoreOptions,
8-
} from '@tanstack/start-plugin-core'
8+
} from '@tanstack/start-plugin-core/vite'
99
import {
1010
configureRsc,
1111
reactStartRscVitePlugin,

‎packages/solid-start/package.json‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@
135135
"peerDependenciesMeta": {
136136
"@rsbuild/core": {
137137
"optional": true
138+
},
139+
"vite": {
140+
"optional": true
138141
}
139142
},
140143
"bin": {

‎packages/solid-start/src/plugin/rsbuild.ts‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import {
2-
START_ENVIRONMENT_NAMES,
2+
RSBUILD_ENVIRONMENT_NAMES,
33
tanStackStartRsbuild,
4-
} from '@tanstack/start-plugin-core'
4+
} from '@tanstack/start-plugin-core/rsbuild'
55
import { solidStartDefaultEntryPaths } from './shared'
6-
import type { TanStackStartRsbuildPluginCoreOptions } from '@tanstack/start-plugin-core/rsbuild/types'
7-
import type { TanStackStartRsbuildInputConfig } from '@tanstack/start-plugin-core'
6+
import type {
7+
TanStackStartRsbuildInputConfig,
8+
TanStackStartRsbuildPluginCoreOptions,
9+
} from '@tanstack/start-plugin-core/rsbuild'
810
import type { RsbuildPlugin } from '@rsbuild/core'
911

1012
export function tanstackStart(
@@ -13,7 +15,7 @@ export function tanstackStart(
1315
const corePluginOpts: TanStackStartRsbuildPluginCoreOptions = {
1416
framework: 'solid',
1517
defaultEntryPaths: solidStartDefaultEntryPaths,
16-
providerEnvironmentName: START_ENVIRONMENT_NAMES.server,
18+
providerEnvironmentName: RSBUILD_ENVIRONMENT_NAMES.server,
1719
ssrIsProvider: true,
1820
rsbuild: {
1921
environments: {

‎packages/solid-start/src/plugin/vite.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import {
22
START_ENVIRONMENT_NAMES,
33
tanStackStartVite,
4-
} from '@tanstack/start-plugin-core'
4+
} from '@tanstack/start-plugin-core/vite'
55
import type {
66
TanStackStartViteInputConfig,
77
TanStackStartVitePluginCoreOptions,
8-
} from '@tanstack/start-plugin-core'
8+
} from '@tanstack/start-plugin-core/vite'
99
import { solidStartDefaultEntryPaths } from './shared'
1010
import type { PluginOption } from 'vite'
1111

‎packages/start-plugin-core/package.json‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,18 @@
5656
"default": "./dist/esm/utils.js"
5757
}
5858
},
59+
"./vite": {
60+
"import": {
61+
"types": "./dist/esm/vite/index.d.ts",
62+
"default": "./dist/esm/vite/index.js"
63+
}
64+
},
65+
"./rsbuild": {
66+
"import": {
67+
"types": "./dist/esm/rsbuild/index.d.ts",
68+
"default": "./dist/esm/rsbuild/index.js"
69+
}
70+
},
5971
"./rsbuild/types": {
6072
"import": {
6173
"types": "./dist/esm/rsbuild/types.d.ts",
@@ -111,6 +123,9 @@
111123
"peerDependenciesMeta": {
112124
"@rsbuild/core": {
113125
"optional": true
126+
},
127+
"vite": {
128+
"optional": true
114129
}
115130
}
116131
}

‎packages/start-plugin-core/src/import-protection/utils.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
relative,
55
resolve as resolvePath,
66
} from 'node:path'
7-
import { normalizePath } from 'vite'
7+
import { normalizePath } from '../utils'
88

99
import {
1010
IMPORT_PROTECTION_DEBUG,

0 commit comments

Comments
 (0)