ember-cli / ember-cli/ember-cli-htmlbars

app's TS files do not properly overwrite an addon's JS files

Đang mở
#774 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
77
Fork
65
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

I have the following example component in my addon:

**my-addon/addon/components/example/index.ts**
```
import templateOnly from '@ember/component/template-only';
export default templateOnly();
```hbs
**my-addon/addon/components/example/index.hbs**
```

Whatever

```
**my-addon/app/components/example/index.js**
```js
export { default } from 'my-addon/components/loading';
```

Then in my app I completely replace it with a new template AND "backing class" with some Glint because why not:
**my-app/app/components/index.ts**
```ts
import templateOnlyComponent from '@ember/component/template-only';

interface LoadingSignature {
Element: HTMLElement; //
}

const LoadingComponent = templateOnlyComponent();
export default LoadingComponent;

declare module '@glint/environment-ember-loose/registry' {
export default interface Registry {
Loading: typeof LoadingComponent;
}
}
```
**my-app/app/components/index.hbs**
```hbs

Whatever

```

This does not work and throws the following error:
![image](https://github.com/ember-cli/ember-cli-htmlbars/assets/55881713/6736d645-e1ca-4d43-be86-d45984359dda)

It does work when using a JS file to overwrite the component:
**my-app/app/components/index.js**
```ts
// I have lost all my Glint stuff, because it's a JS file :'(
import templateOnlyComponent from '@ember/component/template-only';
const LoadingComponent = templateOnlyComponent();
export default LoadingComponent;
```
**my-app/app/components/index.hbs**
```hbs

Whatever

```

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.