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/drop-internal-nonce-helpers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@solidjs/web": patch
---

Remove the internal `scriptNonce`/`styleNonce` exports from the server build. They stayed exported after #4016 only because `@solidjs/vite-plugin` ≤ 3.0.0-next.49 imported them. 3.0.0-next.50 projects the nonce itself (solidjs/solid-vite-plugin#409). Apps must use `@solidjs/vite-plugin` 3.0.0-next.50 or later with this release.
2 changes: 1 addition & 1 deletion examples/board/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"unstorage": "^1.17.5"
},
"devDependencies": {
"@solidjs/vite-plugin": "3.0.0-next.49",
"@solidjs/vite-plugin": "3.0.0-next.50",
"@vitejs/plugin-basic-ssl": "^2.3.0",
"vite": "^8.0.0"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/chat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"unstorage": "^1.17.5"
},
"devDependencies": {
"@solidjs/vite-plugin": "3.0.0-next.49",
"@solidjs/vite-plugin": "3.0.0-next.50",
"@vitejs/plugin-basic-ssl": "^2.3.0",
"vite": "^8.0.0"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/effect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"effect": "^3.22.0"
},
"devDependencies": {
"@solidjs/vite-plugin": "3.0.0-next.49",
"@solidjs/vite-plugin": "3.0.0-next.50",
"@solidjs/web": "workspace:*",
"@types/node": "^25.6.0",
"solid-js": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion examples/hackernews-spa/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"solid-js": "workspace:*"
},
"devDependencies": {
"@solidjs/vite-plugin": "3.0.0-next.49",
"@solidjs/vite-plugin": "3.0.0-next.50",
"vite": "^8.0.0"
}
}
2 changes: 1 addition & 1 deletion examples/hackernews/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"solid-js": "workspace:*"
},
"devDependencies": {
"@solidjs/vite-plugin": "3.0.0-next.49",
"@solidjs/vite-plugin": "3.0.0-next.50",
"vite": "^8.0.0"
}
}
2 changes: 1 addition & 1 deletion examples/migrating-element/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"typecheck": "tsc --noEmit -p tsconfig.json"
},
"devDependencies": {
"@solidjs/vite-plugin": "3.0.0-next.49",
"@solidjs/vite-plugin": "3.0.0-next.50",
"@solidjs/web": "workspace:*",
"@types/node": "^25.6.0",
"solid-js": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion examples/notes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"unstorage": "^1.17.5"
},
"devDependencies": {
"@solidjs/vite-plugin": "3.0.0-next.49",
"@solidjs/vite-plugin": "3.0.0-next.50",
"vite": "^8.0.0"
}
}
2 changes: 1 addition & 1 deletion examples/rendering/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"clean": "rimraf */dist/"
},
"devDependencies": {
"@solidjs/vite-plugin": "3.0.0-next.49",
"@solidjs/vite-plugin": "3.0.0-next.50",
"@solidjs/web": "workspace:*",
"@types/node": "^25.6.0",
"rimraf": "^3.0.2",
Expand Down
2 changes: 1 addition & 1 deletion examples/room/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"solid-js": "workspace:*"
},
"devDependencies": {
"@solidjs/vite-plugin": "3.0.0-next.49",
"@solidjs/vite-plugin": "3.0.0-next.50",
"@vitejs/plugin-basic-ssl": "^2.3.0",
"vite": "^8.0.0"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/sierpinski/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"typecheck": "tsc --noEmit -p tsconfig.json"
},
"devDependencies": {
"@solidjs/vite-plugin": "3.0.0-next.49",
"@solidjs/vite-plugin": "3.0.0-next.50",
"@solidjs/web": "workspace:*",
"@types/node": "^25.6.0",
"solid-js": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion examples/todos-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"unstorage": "^1.17.5"
},
"devDependencies": {
"@solidjs/vite-plugin": "3.0.0-next.49",
"@solidjs/vite-plugin": "3.0.0-next.50",
"vite": "^8.0.0"
}
}
2 changes: 1 addition & 1 deletion examples/todos/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"typecheck": "tsc --noEmit -p tsconfig.json"
},
"devDependencies": {
"@solidjs/vite-plugin": "3.0.0-next.49",
"@solidjs/vite-plugin": "3.0.0-next.50",
"@solidjs/web": "workspace:*",
"@types/node": "^25.6.0",
"solid-js": "workspace:*",
Expand Down
27 changes: 2 additions & 25 deletions packages/web/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1450,29 +1450,6 @@ function destinationNonce(nonce, destination) {
return typeof value === "string" && value ? value : undefined;
}

/**
* The script half of a `CSPNonce`. The surfaces that emit one script take a
* `CSPNonce` and project it themselves; this stays exported only for
* `@solidjs/vite-plugin`'s generated handler, which still imports it.
* @internal
*/
export function scriptNonce(nonce?: CSPNonce): string | undefined;

export function scriptNonce(nonce) {
return destinationNonce(nonce, "script");
}

/**
* The style half of a `CSPNonce`. Exported only for
* `@solidjs/vite-plugin`'s generated handler, which still imports it.
* @internal
*/
export function styleNonce(nonce?: CSPNonce): string | undefined;

export function styleNonce(nonce) {
return destinationNonce(nonce, "style");
}

// Attribute names are ASCII case-insensitive, so a caller-supplied `Nonce`
// counts as one too.
function hasNonceProp(props) {
Expand Down Expand Up @@ -3502,7 +3479,7 @@ export function HydrationScript(props) {
nonce: sharedConfig.context && sharedConfig.context.nonce,
...props
};
return ssr(hydrationBootstrap(eventNames, scriptNonce(nonce), true));
return ssr(hydrationBootstrap(eventNames, destinationNonce(nonce, "script"), true));
}
export function ssrGroup<T extends () => any[]>(fn: T, n: number): T;

Expand Down Expand Up @@ -5895,7 +5872,7 @@ export function generateHydrationScript(options?: {
// `unhandledrejection` from the inline script alone, and a handler attached
// later only revokes the report. A consumer still meets the rejection.
export function generateHydrationScript({ eventNames, nonce } = {}) {
return hydrationBootstrap(eventNames, scriptNonce(nonce), false);
return hydrationBootstrap(eventNames, destinationNonce(nonce, "script"), false);
}

// `ledger` (#3971): only an in-render <HydrationScript /> declares `_$HY.s`,
Expand Down
54 changes: 27 additions & 27 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading