From 30982078e666f54429fa7b6e0014c505512af024 Mon Sep 17 00:00:00 2001 From: "Fred K. Schott" Date: Tue, 5 Dec 2023 04:14:04 -0800 Subject: [PATCH] filter out internal island props (#9304) --- .../src/runtime/client/dev-overlay/plugins/xray.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/astro/src/runtime/client/dev-overlay/plugins/xray.ts b/packages/astro/src/runtime/client/dev-overlay/plugins/xray.ts index 1c9a9c404e..edc038df7a 100644 --- a/packages/astro/src/runtime/client/dev-overlay/plugins/xray.ts +++ b/packages/astro/src/runtime/client/dev-overlay/plugins/xray.ts @@ -153,14 +153,16 @@ export default { }); } - // Add the props if we have any - if (Object.keys(islandProps).length > 0) { + // Display the props if we have any + // Ignore the "data-astro-cid-XXXXXX" prop (internal) + const islandPropsEntries = Object.entries(islandProps).filter( + (prop: any) => !prop[0].startsWith('data-astro-cid-') + ); + if (islandPropsEntries.length > 0) { tooltip.sections.push({ title: 'Props', content: `
${JSON.stringify(
-						Object.fromEntries(
-							Object.entries(islandProps).map((prop: any) => [prop[0], prop[1][1]])
-						),
+						Object.fromEntries(islandPropsEntries.map((prop: any) => [prop[0], prop[1][1]])),
 						undefined,
 						2
 					)}
`,