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
10 changes: 10 additions & 0 deletions .changeset/bump-solid-rc-4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@tanstack/solid-router': patch
'@tanstack/solid-router-devtools': patch
'@tanstack/solid-router-ssr-query': patch
'@tanstack/solid-start': patch
'@tanstack/solid-start-client': patch
'@tanstack/solid-start-server': patch
---

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.
5 changes: 5 additions & 0 deletions .changeset/solid-rsbuild-native-loader.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@tanstack/solid-start': patch
---

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.
5 changes: 5 additions & 0 deletions .changeset/solid-server-fn-abort-signal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@tanstack/solid-start': patch
---

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.
6 changes: 3 additions & 3 deletions benchmarks/bundle-size/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
}
},
"dependencies": {
"@solidjs/web": "^2.0.0-rc.2",
"@solidjs/web": "^2.0.0-rc.4",
"@tanstack/react-router": "workspace:^",
"@tanstack/react-start": "workspace:^",
"@tanstack/solid-router": "workspace:^",
Expand All @@ -45,13 +45,13 @@
"@tanstack/vue-start": "workspace:^",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"solid-js": "^2.0.0-rc.2",
"solid-js": "^2.0.0-rc.4",
"vue": "^3.5.16"
},
"devDependencies": {
"@rsbuild/core": "^2.1.0",
"@rsbuild/plugin-react": "^2.0.0",
"@solidjs/vite-plugin": "^3.0.0-next.32",
"@solidjs/vite-plugin": "^3.0.0-next.35",
"@tanstack/router-plugin": "workspace:^",
"@types/react": "^19.0.8",
"@types/react-dom": "^19.0.3",
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/client-nav/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@
"test:types:vue": "tsc -p ./vue/tsconfig.json --noEmit"
},
"dependencies": {
"@solidjs/web": "^2.0.0-rc.2",
"@solidjs/web": "^2.0.0-rc.4",
"@tanstack/history": "workspace:^",
"@tanstack/react-router": "workspace:^",
"@tanstack/router-core": "workspace:^",
"@tanstack/solid-router": "workspace:^",
"@tanstack/vue-router": "workspace:^",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"solid-js": "^2.0.0-rc.2",
"solid-js": "^2.0.0-rc.4",
"vue": "^3.5.16"
},
"devDependencies": {
"@codspeed/vitest-plugin": "^5.5.0",
"@platformatic/flame": "^1.6.0",
"@solidjs/vite-plugin": "^3.0.0-next.32",
"@solidjs/vite-plugin": "^3.0.0-next.35",
"@tanstack/router-plugin": "workspace:^",
"@testing-library/react": "^16.2.0",
"@types/jsdom": "28.0.0",
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/memory/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@
"#memory-client/lifecycle": "./lifecycle.ts"
},
"dependencies": {
"@solidjs/web": "^2.0.0-rc.2",
"@solidjs/web": "^2.0.0-rc.4",
"@tanstack/react-router": "workspace:*",
"@tanstack/router-core": "workspace:*",
"@tanstack/solid-router": "workspace:*",
"@tanstack/vue-router": "workspace:*",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"solid-js": "^2.0.0-rc.2",
"solid-js": "^2.0.0-rc.4",
"vue": "^3.5.16"
},
"devDependencies": {
"@codspeed/vitest-plugin": "^5.5.0",
"@datadog/pprof": "^5.13.2",
"@platformatic/flame": "^1.6.0",
"@solidjs/vite-plugin": "^3.0.0-next.32",
"@solidjs/vite-plugin": "^3.0.0-next.35",
"@testing-library/react": "^16.2.0",
"@vitejs/plugin-react": "^6.0.1",
"@vitejs/plugin-vue": "^6.0.5",
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/memory/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"#memory-server/flame-runner": "./flame-runner.ts"
},
"dependencies": {
"@solidjs/web": "^2.0.0-rc.2",
"@solidjs/web": "^2.0.0-rc.4",
"@tanstack/react-router": "workspace:*",
"@tanstack/react-start": "workspace:*",
"@tanstack/solid-router": "workspace:*",
Expand All @@ -20,14 +20,14 @@
"@tanstack/vue-start": "workspace:*",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"solid-js": "^2.0.0-rc.2",
"solid-js": "^2.0.0-rc.4",
"vue": "^3.5.16"
},
"devDependencies": {
"@codspeed/vitest-plugin": "^5.5.0",
"@datadog/pprof": "^5.13.2",
"@platformatic/flame": "^1.6.0",
"@solidjs/vite-plugin": "^3.0.0-next.32",
"@solidjs/vite-plugin": "^3.0.0-next.35",
"@vitejs/plugin-react": "^6.0.1",
"@vitejs/plugin-vue-jsx": "^5.1.5",
"@typescript/native": "npm:typescript@^7.0.2",
Expand Down
43 changes: 16 additions & 27 deletions benchmarks/solid-server-functions.ts
Original file line number Diff line number Diff line change
@@ -1,34 +1,24 @@
const origin = 'http://localhost'
const functionHeader = 'X-Server-Function-Id'
const instanceHeader = 'X-Server-Function-Instance'
export const solidServerFunctionFormatHeader = 'X-Server-Function-Format'

type SolidServerFunctionTarget = {
endpoint: string
id: string
}

function resolveSolidServerFunctionTarget(
url: string,
): SolidServerFunctionTarget {
// Since solid-js 2.0.0-rc.4 the server resolves the function id from the
// request url pathname (`<endpoint>/<id>`); the X-Server-Function-Id header
// no longer exists. Requests keep the full function url they were given.
function resolveSolidServerFunctionPathname(url: string) {
const parsed = new URL(url, origin)
const separator = parsed.pathname.lastIndexOf('/') + 1
const id = parsed.pathname.slice(separator)
const id = parsed.pathname.slice(parsed.pathname.lastIndexOf('/') + 1)

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

return {
endpoint: parsed.pathname.slice(0, separator),
id: decodeURIComponent(id),
}
return parsed.pathname
}

function createSolidServerFunctionHeaders(id: string, instance: string) {
function createSolidServerFunctionHeaders(instance: string) {
return new Headers({
'sec-fetch-site': 'same-origin',
[functionHeader]: id,
[instanceHeader]: instance,
})
}
Expand All @@ -38,15 +28,14 @@ export function createSolidServerFunctionGetRequest(
args: Array<unknown>,
instance: string,
) {
const { endpoint, id } = resolveSolidServerFunctionTarget(url)
const pathname = resolveSolidServerFunctionPathname(url)
const search = new URLSearchParams({
id,
args: JSON.stringify(args),
})

return new Request(`${origin}${endpoint}?${search}`, {
return new Request(`${origin}${pathname}?${search}`, {
method: 'GET',
headers: createSolidServerFunctionHeaders(id, instance),
headers: createSolidServerFunctionHeaders(instance),
})
}

Expand All @@ -55,12 +44,12 @@ export function createSolidServerFunctionPostRequest(
args: Array<unknown>,
instance: string,
) {
const { endpoint, id } = resolveSolidServerFunctionTarget(url)
const headers = createSolidServerFunctionHeaders(id, instance)
const pathname = resolveSolidServerFunctionPathname(url)
const headers = createSolidServerFunctionHeaders(instance)
headers.set('content-type', 'application/json')
headers.set(solidServerFunctionFormatHeader, '8')

return new Request(`${origin}${endpoint}`, {
return new Request(`${origin}${pathname}`, {
method: 'POST',
headers,
body: JSON.stringify(args),
Expand All @@ -74,13 +63,13 @@ export function createSolidServerFunctionFormDataRequest(
contentType: string,
instance: string,
) {
const { endpoint, id } = resolveSolidServerFunctionTarget(url)
const pathname = resolveSolidServerFunctionPathname(url)
const search = new URLSearchParams({ args: JSON.stringify(args) })
const headers = createSolidServerFunctionHeaders(id, instance)
const headers = createSolidServerFunctionHeaders(instance)
headers.set('content-type', contentType)
headers.set(solidServerFunctionFormatHeader, '2')

return new Request(`${origin}${endpoint}?${search}`, {
return new Request(`${origin}${pathname}?${search}`, {
method: 'POST',
headers,
body,
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/ssr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"private": true,
"type": "module",
"dependencies": {
"@solidjs/web": "^2.0.0-rc.2",
"@solidjs/web": "^2.0.0-rc.4",
"@tanstack/react-router": "workspace:^",
"@tanstack/react-start": "workspace:^",
"@tanstack/solid-router": "workspace:^",
Expand All @@ -12,12 +12,12 @@
"@tanstack/vue-start": "workspace:^",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"solid-js": "^2.0.0-rc.2",
"solid-js": "^2.0.0-rc.4",
"vue": "^3.5.16"
},
"devDependencies": {
"@codspeed/vitest-plugin": "^5.5.0",
"@solidjs/vite-plugin": "^3.0.0-next.32",
"@solidjs/vite-plugin": "^3.0.0-next.35",
"@vitejs/plugin-react": "^6.0.1",
"@vitejs/plugin-vue-jsx": "^5.1.5",
"seroval": "^1.6.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,25 @@

import { Route as rootRouteImport } from './routes/__root'
import { Route as IndexRouteImport } from './routes/index'
import { Route as PageIdRouteImport } from './routes/page.$id'
import { Route as ApiFnUrlsRouteImport } from './routes/api.fn-urls'
import { Route as PageIdRouteImport } from './routes/page.$id'
import { Route as ApiPingIdRouteImport } from './routes/api.ping.$id'

const IndexRoute = IndexRouteImport.update({
id: '/',
path: '/',
getParentRoute: () => rootRouteImport,
} as any)
const PageIdRoute = PageIdRouteImport.update({
id: '/page/$id',
path: '/page/$id',
getParentRoute: () => rootRouteImport,
} as any)
const ApiFnUrlsRoute = ApiFnUrlsRouteImport.update({
id: '/api/fn-urls',
path: '/api/fn-urls',
getParentRoute: () => rootRouteImport,
} as any)
const PageIdRoute = PageIdRouteImport.update({
id: '/page/$id',
path: '/page/$id',
getParentRoute: () => rootRouteImport,
} as any)
const ApiPingIdRoute = ApiPingIdRouteImport.update({
id: '/api/ping/$id',
path: '/api/ping/$id',
Expand Down Expand Up @@ -78,20 +78,20 @@ declare module '@tanstack/solid-router' {
preLoaderRoute: typeof IndexRouteImport
parentRoute: typeof rootRouteImport
}
'/page/$id': {
id: '/page/$id'
path: '/page/$id'
fullPath: '/page/$id'
preLoaderRoute: typeof PageIdRouteImport
parentRoute: typeof rootRouteImport
}
'/api/fn-urls': {
id: '/api/fn-urls'
path: '/api/fn-urls'
fullPath: '/api/fn-urls'
preLoaderRoute: typeof ApiFnUrlsRouteImport
parentRoute: typeof rootRouteImport
}
'/page/$id': {
id: '/page/$id'
path: '/page/$id'
fullPath: '/page/$id'
preLoaderRoute: typeof PageIdRouteImport
parentRoute: typeof rootRouteImport
}
'/api/ping/$id': {
id: '/api/ping/$id'
path: '/api/ping/$id'
Expand Down
26 changes: 13 additions & 13 deletions benchmarks/ssr/scenarios/server-fns/solid/src/routeTree.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,24 @@

import { Route as rootRouteImport } from './routes/__root'
import { Route as IndexRouteImport } from './routes/index'
import { Route as SsrCallIdRouteImport } from './routes/ssr-call.$id'
import { Route as ApiFnUrlsRouteImport } from './routes/api.fn-urls'
import { Route as SsrCallIdRouteImport } from './routes/ssr-call.$id'

const IndexRoute = IndexRouteImport.update({
id: '/',
path: '/',
getParentRoute: () => rootRouteImport,
} as any)
const SsrCallIdRoute = SsrCallIdRouteImport.update({
id: '/ssr-call/$id',
path: '/ssr-call/$id',
getParentRoute: () => rootRouteImport,
} as any)
const ApiFnUrlsRoute = ApiFnUrlsRouteImport.update({
id: '/api/fn-urls',
path: '/api/fn-urls',
getParentRoute: () => rootRouteImport,
} as any)
const SsrCallIdRoute = SsrCallIdRouteImport.update({
id: '/ssr-call/$id',
path: '/ssr-call/$id',
getParentRoute: () => rootRouteImport,
} as any)

export interface FileRoutesByFullPath {
'/': typeof IndexRoute
Expand Down Expand Up @@ -68,20 +68,20 @@ declare module '@tanstack/solid-router' {
preLoaderRoute: typeof IndexRouteImport
parentRoute: typeof rootRouteImport
}
'/ssr-call/$id': {
id: '/ssr-call/$id'
path: '/ssr-call/$id'
fullPath: '/ssr-call/$id'
preLoaderRoute: typeof SsrCallIdRouteImport
parentRoute: typeof rootRouteImport
}
'/api/fn-urls': {
id: '/api/fn-urls'
path: '/api/fn-urls'
fullPath: '/api/fn-urls'
preLoaderRoute: typeof ApiFnUrlsRouteImport
parentRoute: typeof rootRouteImport
}
'/ssr-call/$id': {
id: '/ssr-call/$id'
path: '/ssr-call/$id'
fullPath: '/ssr-call/$id'
preLoaderRoute: typeof SsrCallIdRouteImport
parentRoute: typeof rootRouteImport
}
}
}

Expand Down
5 changes: 3 additions & 2 deletions docs/router/installation/with-webpack.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,14 @@ export default {
}
```

And in the .babelrc (SWC doesn't support solid-js, see [here](https://www.answeroverflow.com/m/1135200483116593182)), add these presets:
And in the .babelrc (SWC doesn't support solid-js, see [here](https://www.answeroverflow.com/m/1135200483116593182)), add the Solid compiler plugin:

```tsx
// .babelrc

{
"presets": ["babel-preset-solid", "@babel/preset-typescript"]
"presets": ["@babel/preset-typescript"],
"plugins": ["@solidjs/babel-plugin"]
}

```
Expand Down
6 changes: 3 additions & 3 deletions e2e/solid-router/basepath-file-based/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
"test:e2e": "rm -rf port*.txt; playwright test --project=chromium"
},
"dependencies": {
"@solidjs/web": "^2.0.0-rc.2",
"@solidjs/web": "^2.0.0-rc.4",
"@tanstack/router-plugin": "workspace:^",
"@tanstack/solid-router": "workspace:^",
"@tanstack/solid-router-devtools": "workspace:^",
"solid-js": "^2.0.0-rc.2"
"solid-js": "^2.0.0-rc.4"
},
"devDependencies": {
"@playwright/test": "^1.61.0",
"@solidjs/vite-plugin": "^3.0.0-next.32",
"@solidjs/vite-plugin": "^3.0.0-next.35",
"@tanstack/router-e2e-utils": "workspace:^",
"vite": "^8.0.14"
}
Expand Down
Loading
Loading