Skip to content

Commit b2b9979

Browse files
update to solid 2.0.0-beta.21 and @dom-expressions/compiler 0.50.0-next.24
Solid floors move to beta.21 across the catalog and peer/dev ranges; the compiler pin and minimumReleaseAge exclusions move to next.24. The server-functions e2e adapts to two beta.21 runtime changes: server function references now pass the function name as a second argument, and direct endpoint dispatches are POST-only by default. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 5828a6e commit b2b9979

5 files changed

Lines changed: 117 additions & 106 deletions

File tree

.changeset/bump-solid-beta-21.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'vite-plugin-solid': patch
3+
---
4+
5+
update to solid 2.0.0-beta.21 and @dom-expressions/compiler 0.50.0-next.24

examples/server-functions/test/run.mjs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,10 @@ function record(mode, phase, name, ok, detail = '') {
160160
// Dev function IDs are `hash-count-name`; pull the one for `name` out of the
161161
// client-transformed module so the endpoint can be hit directly.
162162
function extractFunctionId(transformedCode, name) {
163-
// The import identifier may be aliased (e.g. createServerReference_1).
163+
// The import identifier may be aliased (e.g. createServerReference_1), and
164+
// newer compilers pass the function name as a second argument after the id.
164165
const match = transformedCode.match(
165-
new RegExp(`createServerReference\\w*\\("([^"]*-${name})"\\)`),
166+
new RegExp(`createServerReference\\w*\\("([^"]*-${name})"`),
166167
);
167168
return match ? match[1] : null;
168169
}
@@ -308,9 +309,13 @@ async function runMode(mode) {
308309
// manifest and load it before dispatching.
309310
const clientModule = await (await fetch(origin + '/src/api.ts')).text();
310311
const functionId = extractFunctionId(clientModule, 'getServerMessage');
312+
// Server functions are POST-only by default as of @solidjs/web
313+
// 2.0.0-beta.21; args still come from the query string when no
314+
// instance header is present.
311315
const cold = functionId
312316
? await fetch(
313317
`${origin}/_server?id=${encodeURIComponent(functionId)}&args=${encodeURIComponent('["turnkey"]')}`,
318+
{ method: 'POST' },
314319
)
315320
: null;
316321
const coldText = cold ? await cold.text() : '';
@@ -500,6 +505,7 @@ async function runEndpointMode() {
500505
const custom = functionId
501506
? await fetch(
502507
`${origin}${endpoint}?id=${encodeURIComponent(functionId)}&args=${encodeURIComponent('["endpoint"]')}`,
508+
{ method: 'POST' },
503509
)
504510
: null;
505511
const customText = custom ? await custom.text() : '';

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@
4646
"dependencies": {
4747
"@ampproject/remapping": "^2.3.0",
4848
"@babel/core": "^7.23.3",
49-
"@dom-expressions/compiler": "0.50.0-next.23",
49+
"@dom-expressions/compiler": "0.50.0-next.24",
5050
"@types/babel__core": "^7.20.4",
51-
"babel-preset-solid": ">=2.0.0-beta.20 <2.0.0-experimental.0",
51+
"babel-preset-solid": ">=2.0.0-beta.21 <2.0.0-experimental.0",
5252
"merge-anything": "^5.1.7",
5353
"vitefu": "^1.0.4"
5454
},
@@ -68,14 +68,14 @@
6868
"prettier": "^3.1.0",
6969
"rollup": "^4.5.0",
7070
"rollup-plugin-cleaner": "^1.0.0",
71-
"solid-js": ">=2.0.0-beta.20 <2.0.0-experimental.0",
71+
"solid-js": ">=2.0.0-beta.21 <2.0.0-experimental.0",
7272
"typescript": "^5.2.2",
7373
"vite": "^7.0.0"
7474
},
7575
"peerDependencies": {
76-
"@solidjs/web": ">=2.0.0-beta.20 <2.0.0-experimental.0",
76+
"@solidjs/web": ">=2.0.0-beta.21 <2.0.0-experimental.0",
7777
"@testing-library/jest-dom": "^5.16.6 || ^5.17.0 || ^6.*",
78-
"solid-js": ">=2.0.0-beta.20 <2.0.0-experimental.0",
78+
"solid-js": ">=2.0.0-beta.21 <2.0.0-experimental.0",
7979
"vite": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0"
8080
},
8181
"peerDependenciesMeta": {

0 commit comments

Comments
 (0)