Bug fix for StencilJS compatibility#2026
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
I'm not sure this is the right fix, but if @JohnHardy can verify if it actually works I'd be more apt to entertain it. This also might be fixed by #1925. Unfortunately, we had to revert the original PR but putting this burden on a CEM plugin that generates the correct types would be much better than trying to patch it with a filter plugin. Also, any CEM validation should be part of |
|
I'll test it as soon as I can, thank you for doing this! 🙏 |
|
Updated to remove the file and add validation to |
…esome into kj/bug-bash-stencil
claviska
left a comment
There was a problem hiding this comment.
I'm fine with the update to custom-elements-manifest.js but I'm not sure we want to put verifications directly in build.js. If we're just filtering unnamed events, the plugin seems to handle that well enough to make the verification redundant.
I'd suggest reverting build.js and, if any of that code is actually executing, fix the plugin to ensure it works properly.
Co-authored-by: Konnor Rogers <konnor5456@gmail.com>
Fixes #1919
Custom-elements-jsx.d.ts generating "onundefined" event handlers
The Custom Elements Manifest analyzer was detecting events in two ways: from @event JSDoc tags (which include event names) and from analyzing dispatchEvent() calls in code (which only captured the type, not the name). This created duplicate event entries where some had only a type but no name, causing the JSX types generator to produce
onundefinedevent handlers instead of proper names like "onwa-error".Added a
wa-filter-unnamed-events pluginthat removes events without names before the JSX types are generated. This fixes 25 broken event entries across components, includingwa-icon,wa-button,wa-input,wa-select,wa-dialog,wa-drawer,wa-dropdown,wa-tooltip, and others.Also added a verification step to the build process that checks for unnamed events in the CEM and
onundefinedin the generated JSX types. The build will fail if these issues are detected, preventing regression.