ionic-team / stencil-ds-output-targets

These are output targets that can be added to Stencil for React and Angular.
https://stenciljs.com
MIT License
248 stars 112 forks source link

bug: Angular Output 'scam' proxies import type 'Component' path #406

Open maldago opened 9 months ago

maldago commented 9 months ago

Prerequisites

Stencil Version

4.7.2

Stencil Framework Output Target

Angular

Stencil Framework Output Target Version

0.8.3

Current Behavior

Using dist-custom-elements, with the option auto-define-custom-elements', targeting the output type'scam'forangularOutputTarget`;

The generated proxies.ts module contains an import type { Components } from ... but the path that is generated has no exported member. The paths to the component.js files are correct.

Expected Behavior

Expect the path to resolve the type.

Steps to Reproduce

Code Reproduction URL

https://github.com/maldago/stencil-angular-output-target

Additional Information

No response

sean-perkins commented 9 months ago

Hello @maldago, thanks for this issue.

The angular output target currently only supports the default configuration for customElementsExportBehavior. When the Angular component wrappers are constructed, they will automatically define the custom element.

Using customElementsExportBehavior: "auto-define-custom-elements" is not a configuration we planned for and I don't believe it makes sense when aligned to how Angular components are defined. For example it could define the custom element for a child web component that you have an Angular wrapper for, but the Angular component may never be imported/defined. This leads to confusion and potential bugs in your application, since the web component may render correctly, but angular bindings will not work as expected on that element.