fix: use SSR format compatible with nginx SSI for props.id (#16820)

* fix: use SSR format compatible with nginx SSI for props.id

* changeset

---------

Co-authored-by: Rich Harris <hello@rich-harris.dev>
pull/16818/head
Brittany Harris 1 day ago committed by GitHub
parent cf35a22568
commit 562623d536
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
"svelte": patch
---
fix: use nginx SSI-compatible comments for `$props.id()`

@ -365,7 +365,7 @@ export function props_id() {
hydrating &&
hydrate_node &&
hydrate_node.nodeType === COMMENT_NODE &&
hydrate_node.textContent?.startsWith(`#`)
hydrate_node.textContent?.startsWith(`$`)
) {
const id = hydrate_node.textContent.substring(1);
hydrate_next();

@ -448,7 +448,7 @@ export function once(get_value) {
*/
export function props_id(renderer) {
const uid = renderer.global.uid();
renderer.push('<!--#' + uid + '-->');
renderer.push('<!--$' + uid + '-->');
return uid;
}

Loading…
Cancel
Save