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: using AngularOutputTarget, generic type in @Event leads to invalid code #314

Open
3 tasks done
staizen-rcomblen opened this issue Dec 13, 2022 · 1 comment
Open
3 tasks done
Labels
package: angular @stencil/angular-output-target package type: bug Something isn't working

Comments

@staizen-rcomblen
Copy link

Prerequisites

Stencil Version

2.20.0

Stencil Framework Output Target

Angular

Stencil Framework Output Target Version

0.4.0

Current Behavior

The following input

import { Component, Event, EventEmitter } from '@stencil/core';

@Component({
  tag: 'test-component',
  shadow: true,
})
export class TestComponent<T> {
  @Event({ bubbles: false }) missingGenericArgument: EventEmitter<Array<T>>;
}

generates the following invalid syntax:

export declare interface TestComponent extends Components.TestComponent {
  /**
   *  
   */
  missingGenericArgument: EventEmitter<CustomEvent<Array<T>>>;

}

One sees that the <T> is only present in the field type definition, and not on the interface definition. This code obviously doesn't compile.

Expected Behavior

Code that compiles, so either no <T> anywhere, or <T> on both the field and the interface.

Steps to Reproduce

Code Reproduction URL

https://github.com/staizen-rcomblen/stencil-generic-bug

Additional Information

In parallel, I got the same issue as #283

Thanks @marcincichocki for the sample test repo (I'm pretty new to Stencil, getting an existing project working with Angular).

@ionitron-bot ionitron-bot bot added the triage label Dec 13, 2022
@sean-perkins
Copy link
Contributor

Hello @staizen-rcomblen thanks for reporting this issue.

At this time, I do not believe that Stencil natively supports generic types on the component class.

We would need to wait for: ionic-team/stencil#3488 to be reviewed/merged prior to adding support in the output targets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: angular @stencil/angular-output-target package type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants