From 22b2c116b952da6d6400f68cd0a4a2348895efe0 Mon Sep 17 00:00:00 2001 From: Owen Buckley Date: Thu, 11 Jun 2026 09:32:01 -0400 Subject: [PATCH] bug: #258 fix naive jsx shadow root detection check --- src/jsx-loader.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/jsx-loader.js b/src/jsx-loader.js index 2e24c74..87cbb93 100644 --- a/src/jsx-loader.js +++ b/src/jsx-loader.js @@ -432,7 +432,7 @@ export function parseJsx(moduleURL) { // TODO: (good first issue) find a more AST (visitor) based way to check for this // https://github.com/ProjectEvergreen/wcc/issues/258 hasShadowRoot = - moduleContents.slice(node.body.start, node.body.end).indexOf('this.attachShadow(') > 0; + result.code.slice(node.body.start, node.body.end).indexOf('this.attachShadow(') > 0; for (const n1 of node.body.body) { if (n1.type === 'MethodDefinition') { @@ -773,6 +773,7 @@ export function parseJsx(moduleURL) { ) { // TODO: do we even need this filter? const trackingAttrs = observedAttributes.filter((attr) => typeof attr === 'string'); + // TODO: should we append cleanup functions if user has their own disconnected callback? const disconnectedCallbackContents = hasDisconnectedCallback ? '' : `