Skip to content

Commit 22fd367

Browse files
brenelzclaude
andauthored
chore(solid): bump to solid-js 2.0.0-rc.4 and @solidjs/vite-plugin 3.0.0-next.35 (#8189)
* chore(solid): bump to solid-js 2.0.0-rc.4 and @solidjs/vite-plugin 3.0.0-next.35 Also: - Migrate the webpack example and docs off the deleted babel-preset-solid onto @solidjs/babel-plugin (compiler packages were renamed in rc.3). - Bump @rsbuild/plugin-solid to ^2.0.0-beta.2 so the rsbuild path compiles with the rc-line preset. - Adapt the server function transport to rc.4: function ids resolve from the request url pathname (X-Server-Function header removed), and the client reference derives its url from the configured endpoint. - Wire per-call AbortSignals through Solid's new invoke() channel and re-enable the previously skipped abort e2e tests. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(solid-start): rc.4 CI fallout — rsbuild native loader ssr mode, benchmark wire protocol - @rsbuild/plugin-solid >= 2.0.0-beta.1 compiles through its own solid loader (native compiler) instead of registering babel-preset-solid, so the babel preset patch never fired and node-target rsbuild bundles were compiled in dom mode, throwing "Client-only API called on the server side" at import. Patch the loader's solid options (generate ssr on node targets, hydratable) alongside the legacy preset patch. - The benchmark server-function request builders still spoke the pre-rc.4 wire protocol (id in the removed X-Server-Function-Id header, bare endpoint url). Ids now ride the url pathname. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * chore(solid): bump @tanstack/solid-query to 6.0.0-rc.1 The rc.1 adapter is rewritten onto Solid 2.0's native async model (TanStack/query#11308) and peer-requires solid-js >=2.0.0-rc.4, so it rides this branch's rc.4 bump. Catalog entry plus the non-catalogued solid-query-devtools pins move in lockstep. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent 5f65783 commit 22fd367

123 files changed

Lines changed: 2017 additions & 1590 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/bump-solid-rc-4.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@tanstack/solid-router': patch
3+
'@tanstack/solid-router-devtools': patch
4+
'@tanstack/solid-router-ssr-query': patch
5+
'@tanstack/solid-start': patch
6+
'@tanstack/solid-start-client': patch
7+
'@tanstack/solid-start-server': patch
8+
---
9+
10+
Bump solid-js and @solidjs/web to ^2.0.0-rc.4 and @solidjs/vite-plugin to ^3.0.0-next.35 across the monorepo.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tanstack/solid-start': patch
3+
---
4+
5+
Patch @rsbuild/plugin-solid's native `solid` loader options for SSR builds. Since 2.0.0-beta.1 the plugin compiles through its own loader (native compiler by default) instead of registering babel-preset-solid, so the babel preset patch never fired and node-target bundles were compiled in dom mode, crashing at import with "Client-only API called on the server side". The rsbuild start plugin now patches the loader's `solid` options (`generate: 'ssr'` on node targets, `hydratable: true`) alongside the legacy babel preset patch.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tanstack/solid-start': patch
3+
---
4+
5+
Support per-call AbortSignals for Solid server functions. solid-js 2.0.0-rc.4 added the per-call invocation channel (`invoke(fn, { signal }, ...args)`) and moved server function id resolution from the `X-Server-Function` header to the request url pathname; the client rpc now rides that channel when a `signal` is passed to a server function, and the server handler resolves/normalizes ids via the url. The previously skipped abort e2e tests are re-enabled.

benchmarks/bundle-size/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
}
3737
},
3838
"dependencies": {
39-
"@solidjs/web": "^2.0.0-rc.2",
39+
"@solidjs/web": "^2.0.0-rc.4",
4040
"@tanstack/react-router": "workspace:^",
4141
"@tanstack/react-start": "workspace:^",
4242
"@tanstack/solid-router": "workspace:^",
@@ -45,13 +45,13 @@
4545
"@tanstack/vue-start": "workspace:^",
4646
"react": "^19.0.0",
4747
"react-dom": "^19.0.0",
48-
"solid-js": "^2.0.0-rc.2",
48+
"solid-js": "^2.0.0-rc.4",
4949
"vue": "^3.5.16"
5050
},
5151
"devDependencies": {
5252
"@rsbuild/core": "^2.1.0",
5353
"@rsbuild/plugin-react": "^2.0.0",
54-
"@solidjs/vite-plugin": "^3.0.0-next.32",
54+
"@solidjs/vite-plugin": "^3.0.0-next.35",
5555
"@tanstack/router-plugin": "workspace:^",
5656
"@types/react": "^19.0.8",
5757
"@types/react-dom": "^19.0.3",

benchmarks/client-nav/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,21 @@
1919
"test:types:vue": "tsc -p ./vue/tsconfig.json --noEmit"
2020
},
2121
"dependencies": {
22-
"@solidjs/web": "^2.0.0-rc.2",
22+
"@solidjs/web": "^2.0.0-rc.4",
2323
"@tanstack/history": "workspace:^",
2424
"@tanstack/react-router": "workspace:^",
2525
"@tanstack/router-core": "workspace:^",
2626
"@tanstack/solid-router": "workspace:^",
2727
"@tanstack/vue-router": "workspace:^",
2828
"react": "^19.0.0",
2929
"react-dom": "^19.0.0",
30-
"solid-js": "^2.0.0-rc.2",
30+
"solid-js": "^2.0.0-rc.4",
3131
"vue": "^3.5.16"
3232
},
3333
"devDependencies": {
3434
"@codspeed/vitest-plugin": "^5.5.0",
3535
"@platformatic/flame": "^1.6.0",
36-
"@solidjs/vite-plugin": "^3.0.0-next.32",
36+
"@solidjs/vite-plugin": "^3.0.0-next.35",
3737
"@tanstack/router-plugin": "workspace:^",
3838
"@testing-library/react": "^16.2.0",
3939
"@types/jsdom": "28.0.0",

benchmarks/memory/client/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@
1212
"#memory-client/lifecycle": "./lifecycle.ts"
1313
},
1414
"dependencies": {
15-
"@solidjs/web": "^2.0.0-rc.2",
15+
"@solidjs/web": "^2.0.0-rc.4",
1616
"@tanstack/react-router": "workspace:*",
1717
"@tanstack/router-core": "workspace:*",
1818
"@tanstack/solid-router": "workspace:*",
1919
"@tanstack/vue-router": "workspace:*",
2020
"react": "^19.0.0",
2121
"react-dom": "^19.0.0",
22-
"solid-js": "^2.0.0-rc.2",
22+
"solid-js": "^2.0.0-rc.4",
2323
"vue": "^3.5.16"
2424
},
2525
"devDependencies": {
2626
"@codspeed/vitest-plugin": "^5.5.0",
2727
"@datadog/pprof": "^5.13.2",
2828
"@platformatic/flame": "^1.6.0",
29-
"@solidjs/vite-plugin": "^3.0.0-next.32",
29+
"@solidjs/vite-plugin": "^3.0.0-next.35",
3030
"@testing-library/react": "^16.2.0",
3131
"@vitejs/plugin-react": "^6.0.1",
3232
"@vitejs/plugin-vue": "^6.0.5",

benchmarks/memory/server/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"#memory-server/flame-runner": "./flame-runner.ts"
1212
},
1313
"dependencies": {
14-
"@solidjs/web": "^2.0.0-rc.2",
14+
"@solidjs/web": "^2.0.0-rc.4",
1515
"@tanstack/react-router": "workspace:*",
1616
"@tanstack/react-start": "workspace:*",
1717
"@tanstack/solid-router": "workspace:*",
@@ -20,14 +20,14 @@
2020
"@tanstack/vue-start": "workspace:*",
2121
"react": "^19.0.0",
2222
"react-dom": "^19.0.0",
23-
"solid-js": "^2.0.0-rc.2",
23+
"solid-js": "^2.0.0-rc.4",
2424
"vue": "^3.5.16"
2525
},
2626
"devDependencies": {
2727
"@codspeed/vitest-plugin": "^5.5.0",
2828
"@datadog/pprof": "^5.13.2",
2929
"@platformatic/flame": "^1.6.0",
30-
"@solidjs/vite-plugin": "^3.0.0-next.32",
30+
"@solidjs/vite-plugin": "^3.0.0-next.35",
3131
"@vitejs/plugin-react": "^6.0.1",
3232
"@vitejs/plugin-vue-jsx": "^5.1.5",
3333
"@typescript/native": "npm:typescript@^7.0.2",

benchmarks/solid-server-functions.ts

Lines changed: 16 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,24 @@
11
const origin = 'http://localhost'
2-
const functionHeader = 'X-Server-Function-Id'
32
const instanceHeader = 'X-Server-Function-Instance'
43
export const solidServerFunctionFormatHeader = 'X-Server-Function-Format'
54

6-
type SolidServerFunctionTarget = {
7-
endpoint: string
8-
id: string
9-
}
10-
11-
function resolveSolidServerFunctionTarget(
12-
url: string,
13-
): SolidServerFunctionTarget {
5+
// Since solid-js 2.0.0-rc.4 the server resolves the function id from the
6+
// request url pathname (`<endpoint>/<id>`); the X-Server-Function-Id header
7+
// no longer exists. Requests keep the full function url they were given.
8+
function resolveSolidServerFunctionPathname(url: string) {
149
const parsed = new URL(url, origin)
15-
const separator = parsed.pathname.lastIndexOf('/') + 1
16-
const id = parsed.pathname.slice(separator)
10+
const id = parsed.pathname.slice(parsed.pathname.lastIndexOf('/') + 1)
1711

1812
if (!id) {
1913
throw new Error(`Unable to resolve Solid server function id from ${url}`)
2014
}
2115

22-
return {
23-
endpoint: parsed.pathname.slice(0, separator),
24-
id: decodeURIComponent(id),
25-
}
16+
return parsed.pathname
2617
}
2718

28-
function createSolidServerFunctionHeaders(id: string, instance: string) {
19+
function createSolidServerFunctionHeaders(instance: string) {
2920
return new Headers({
3021
'sec-fetch-site': 'same-origin',
31-
[functionHeader]: id,
3222
[instanceHeader]: instance,
3323
})
3424
}
@@ -38,15 +28,14 @@ export function createSolidServerFunctionGetRequest(
3828
args: Array<unknown>,
3929
instance: string,
4030
) {
41-
const { endpoint, id } = resolveSolidServerFunctionTarget(url)
31+
const pathname = resolveSolidServerFunctionPathname(url)
4232
const search = new URLSearchParams({
43-
id,
4433
args: JSON.stringify(args),
4534
})
4635

47-
return new Request(`${origin}${endpoint}?${search}`, {
36+
return new Request(`${origin}${pathname}?${search}`, {
4837
method: 'GET',
49-
headers: createSolidServerFunctionHeaders(id, instance),
38+
headers: createSolidServerFunctionHeaders(instance),
5039
})
5140
}
5241

@@ -55,12 +44,12 @@ export function createSolidServerFunctionPostRequest(
5544
args: Array<unknown>,
5645
instance: string,
5746
) {
58-
const { endpoint, id } = resolveSolidServerFunctionTarget(url)
59-
const headers = createSolidServerFunctionHeaders(id, instance)
47+
const pathname = resolveSolidServerFunctionPathname(url)
48+
const headers = createSolidServerFunctionHeaders(instance)
6049
headers.set('content-type', 'application/json')
6150
headers.set(solidServerFunctionFormatHeader, '8')
6251

63-
return new Request(`${origin}${endpoint}`, {
52+
return new Request(`${origin}${pathname}`, {
6453
method: 'POST',
6554
headers,
6655
body: JSON.stringify(args),
@@ -74,13 +63,13 @@ export function createSolidServerFunctionFormDataRequest(
7463
contentType: string,
7564
instance: string,
7665
) {
77-
const { endpoint, id } = resolveSolidServerFunctionTarget(url)
66+
const pathname = resolveSolidServerFunctionPathname(url)
7867
const search = new URLSearchParams({ args: JSON.stringify(args) })
79-
const headers = createSolidServerFunctionHeaders(id, instance)
68+
const headers = createSolidServerFunctionHeaders(instance)
8069
headers.set('content-type', contentType)
8170
headers.set(solidServerFunctionFormatHeader, '2')
8271

83-
return new Request(`${origin}${endpoint}?${search}`, {
72+
return new Request(`${origin}${pathname}?${search}`, {
8473
method: 'POST',
8574
headers,
8675
body,

benchmarks/ssr/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"private": true,
44
"type": "module",
55
"dependencies": {
6-
"@solidjs/web": "^2.0.0-rc.2",
6+
"@solidjs/web": "^2.0.0-rc.4",
77
"@tanstack/react-router": "workspace:^",
88
"@tanstack/react-start": "workspace:^",
99
"@tanstack/solid-router": "workspace:^",
@@ -12,12 +12,12 @@
1212
"@tanstack/vue-start": "workspace:^",
1313
"react": "^19.0.0",
1414
"react-dom": "^19.0.0",
15-
"solid-js": "^2.0.0-rc.2",
15+
"solid-js": "^2.0.0-rc.4",
1616
"vue": "^3.5.16"
1717
},
1818
"devDependencies": {
1919
"@codspeed/vitest-plugin": "^5.5.0",
20-
"@solidjs/vite-plugin": "^3.0.0-next.32",
20+
"@solidjs/vite-plugin": "^3.0.0-next.35",
2121
"@vitejs/plugin-react": "^6.0.1",
2222
"@vitejs/plugin-vue-jsx": "^5.1.5",
2323
"seroval": "^1.6.2",

benchmarks/ssr/scenarios/global-middleware/solid/src/routeTree.gen.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,25 @@
1010

1111
import { Route as rootRouteImport } from './routes/__root'
1212
import { Route as IndexRouteImport } from './routes/index'
13-
import { Route as PageIdRouteImport } from './routes/page.$id'
1413
import { Route as ApiFnUrlsRouteImport } from './routes/api.fn-urls'
14+
import { Route as PageIdRouteImport } from './routes/page.$id'
1515
import { Route as ApiPingIdRouteImport } from './routes/api.ping.$id'
1616

1717
const IndexRoute = IndexRouteImport.update({
1818
id: '/',
1919
path: '/',
2020
getParentRoute: () => rootRouteImport,
2121
} as any)
22-
const PageIdRoute = PageIdRouteImport.update({
23-
id: '/page/$id',
24-
path: '/page/$id',
25-
getParentRoute: () => rootRouteImport,
26-
} as any)
2722
const ApiFnUrlsRoute = ApiFnUrlsRouteImport.update({
2823
id: '/api/fn-urls',
2924
path: '/api/fn-urls',
3025
getParentRoute: () => rootRouteImport,
3126
} as any)
27+
const PageIdRoute = PageIdRouteImport.update({
28+
id: '/page/$id',
29+
path: '/page/$id',
30+
getParentRoute: () => rootRouteImport,
31+
} as any)
3232
const ApiPingIdRoute = ApiPingIdRouteImport.update({
3333
id: '/api/ping/$id',
3434
path: '/api/ping/$id',
@@ -78,20 +78,20 @@ declare module '@tanstack/solid-router' {
7878
preLoaderRoute: typeof IndexRouteImport
7979
parentRoute: typeof rootRouteImport
8080
}
81-
'/page/$id': {
82-
id: '/page/$id'
83-
path: '/page/$id'
84-
fullPath: '/page/$id'
85-
preLoaderRoute: typeof PageIdRouteImport
86-
parentRoute: typeof rootRouteImport
87-
}
8881
'/api/fn-urls': {
8982
id: '/api/fn-urls'
9083
path: '/api/fn-urls'
9184
fullPath: '/api/fn-urls'
9285
preLoaderRoute: typeof ApiFnUrlsRouteImport
9386
parentRoute: typeof rootRouteImport
9487
}
88+
'/page/$id': {
89+
id: '/page/$id'
90+
path: '/page/$id'
91+
fullPath: '/page/$id'
92+
preLoaderRoute: typeof PageIdRouteImport
93+
parentRoute: typeof rootRouteImport
94+
}
9595
'/api/ping/$id': {
9696
id: '/api/ping/$id'
9797
path: '/api/ping/$id'

0 commit comments

Comments
 (0)