Current State
Currently, the JSX compiler does a naive check to detect if Declarative Shadow DOM is being used in a custom element definition
hasShadowRoot = moduleContents.slice(node.body.start, node.body.end).indexOf('this.attachShadow(') > 0;
The main downside to this is that it's a naive check of the contents, which could include comments. It should be more reliant on the AST to find a real usage of the attachShadow call
Desired State
It should use the AST and walk method to find this. Just spit balling...
hasShadowRoot = node.children.some((c) => {
// find `attachShadow` using the AST instead
})
Additional Context
No response
Current State
Currently, the JSX compiler does a naive check to detect if Declarative Shadow DOM is being used in a custom element definition
The main downside to this is that it's a naive check of the contents, which could include comments. It should be more reliant on the AST to find a real usage of the
attachShadowcallDesired State
It should use the AST and walk method to find this. Just spit balling...
Additional Context
No response