fix: dedupe hashes for identical islands (#1660)
This commit is contained in:
parent
c85c7e2188
commit
55c8453fd2
1 changed files with 2 additions and 1 deletions
|
@ -239,7 +239,8 @@ export async function renderComponent(result: SSRResult, displayName: string, Co
|
|||
return html.replace(/\<\/?astro-fragment\>/g, '');
|
||||
}
|
||||
|
||||
const astroId = shorthash.unique(html);
|
||||
// Include componentExport name and componentUrl in hash to dedupe identical islands
|
||||
const astroId = shorthash.unique(`<!--${metadata.componentExport!.value}:${metadata.componentUrl}-->\n${html}`);
|
||||
|
||||
result.scripts.add(await generateHydrateScript({ renderer, astroId, props }, metadata as Required<AstroComponentMetadata>));
|
||||
|
||||
|
|
Loading…
Reference in a new issue