Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: event types changed from [ComponentName]CustomEvent<number> to EventName<CustomEvent<number>> #531

Open
3 tasks done
jmessmer opened this issue Oct 29, 2024 · 1 comment
Labels

Comments

@jmessmer
Copy link

Prerequisites

Stencil Version

4.22.2

Stencil Framework Output Target

React

Stencil Framework Output Target Version

0.7.4

Current Behavior

Prior to upgrading to 0.7.x, in version 0.5.3, event types name were driven (I believe) from the LocalJSX (exported as JSX) of the generated components.d.ts file, which included a nomenclature of [InterfaceName]CustomEvent.

declare namespace LocalJSX { interface MyFoo { "onMyEventTrigger"?: (event: MyFooCustomEvent<number>) -> void; } }

Now with version 0.7.x, the event type name changed to EventName<CustomEvent<number>> within the generated component.ts.

While I understand that the event is not a complex type but I don't think it should have changed from what it was before. This breaks any consumer of my library that I published. What I don't understand is that the LocalJSX still has the same event type, MyFooCustomEvent<number> as it was in the 0.5.3 version.

Expected Behavior

I would have expected the event types to be same as it was before

Steps to Reproduce

  1. Created a stencil web component with an event (non complex type) using stencil version 4.20.0
  2. Generate the react wrapper using react-output-target version 0.5.3
  3. Create a react application that uses the web component react wrapper and handles the event using typescript
  4. Upgrade the stencil library to 4.22.2 and upgrade the react-output-target to 0.7.4
  5. Upgrade the react application to use the updated web component react wrapper

Code Reproduction URL

https://github.com/foobar

Additional Information

No response

@ionitron-bot ionitron-bot bot added the triage label Oct 29, 2024
Copy link

ionitron-bot bot commented Oct 29, 2024

Thanks for the issue!

This project is currently maintained for the purposes of supporting Ionic Framework. At this time, only new issues & pull requests that support Ionic Framework will be prioritized. For the latest updates regarding the maintenance status of this project, please see this section of the project's README

@jmessmer jmessmer changed the title bug: event types changed from [componentName]CustomEvent<> to CustomEvent<> bug: event types changed from [ComponentName]CustomEvent<> to EventName<CustomEvent<number>> Oct 29, 2024
@jmessmer jmessmer changed the title bug: event types changed from [ComponentName]CustomEvent<> to EventName<CustomEvent<number>> bug: event types changed from [ComponentName]CustomEvent<number> to EventName<CustomEvent<number>> Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant