Skip to content

Comments

Bug fix for StencilJS compatibility#2026

Merged
kelseythejackson merged 13 commits intonextfrom
kj/bug-bash-stencil
Feb 20, 2026
Merged

Bug fix for StencilJS compatibility#2026
kelseythejackson merged 13 commits intonextfrom
kj/bug-bash-stencil

Conversation

@kelseythejackson
Copy link
Collaborator

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 onundefined event handlers instead of proper names like "onwa-error".

Added a wa-filter-unnamed-events plugin that removes events without names before the JSX types are generated. This fixes 25 broken event entries across components, including wa-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 onundefined in the generated JSX types. The build will fail if these issues are detected, preventing regression.

@vercel
Copy link

vercel bot commented Feb 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
webawesome Ready Ready Preview Feb 20, 2026 7:34pm

Request Review

@claviska
Copy link
Member

claviska commented Feb 4, 2026

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 generateManifest(), not a separate build step.

@JohnHardy
Copy link

I'll test it as soon as I can, thank you for doing this! 🙏

@kelseythejackson
Copy link
Collaborator Author

Updated to remove the file and add validation to generateManifest(), if the aforementioned PR doesn't fix it, this is ready to go.

Copy link
Member

@claviska claviska left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

KonnorRogers
KonnorRogers previously approved these changes Feb 20, 2026
Co-authored-by: Konnor Rogers <konnor5456@gmail.com>
@kelseythejackson kelseythejackson requested review from claviska and removed request for claviska February 20, 2026 20:00
@kelseythejackson kelseythejackson merged commit 4263384 into next Feb 20, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

custom-elements-jsx.d.ts is not Stencil-compatible and fails with skipLibCheck=false

4 participants