app's TS files do not properly overwrite an addon's JS files
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript, typescript
- Lĩnh vực
- frontend
Hướng nghiên cứu
Tái hiện việc ghi đè component bằng các tệp TypeScript và JavaScript được cung cấp của my-addon/addon và my-app/app, sau đó so sánh với việc ghi đè JavaScript đang hoạt động. Theo dõi cách component của ứng dụng được phân giải thay cho component của addon và xác định lý do phiên bản TypeScript bị lỗi. Hoàn thành khi một component ứng dụng TypeScript và template TypeScript có thể thay thế component JavaScript của addon mà vẫn giữ lại các khai báo Glint.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
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
import templateOnlyComponent from '@ember/component/template-only';
interface LoadingSignature {
Element: HTMLElement; // <i>
}
const LoadingComponent = templateOnlyComponent<LoadingSignature>();
export default LoadingComponent;
declare module '@glint/environment-ember-loose/registry' {
export default interface Registry {
Loading: typeof LoadingComponent;
}
}
my-app/app/components/index.hbs
<div>Whatever</div>
This does not work and throws the following error:
It does work when using a JS file to overwrite the component:
my-app/app/components/index.js
// 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
<div>Whatever</div>
- 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
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của ember-cli/ember-cli-htmlbars
-
Security: Vulnerable dependency [email protected] [SNYK-JS-MINIMATCH-15309438, CVE-2026-26996]Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
ember-cli/ember-cli-htmlbars#792 ·
-
TemplateFactory type incompatible with setComponentTemplate type from @types/ember__componentĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
ember-cli/ember-cli-htmlbars#787 · 1 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 38/100
ember-cli/ember-cli-htmlbars#781 · 1 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
ember-cli/ember-cli-htmlbars#779 · 1 bình luận ·
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
ember-cli/ember-cli-htmlbars#753 · 1 bình luận · 1 reaction ·
Tất cả issue của ember-cli/ember-cli-htmlbars
Issue tương tự
-
area:ui bug effort:low incomplete model:light plan planner:gpt-6-1-sol
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation good first issue hacktoberfest size/small type/docs up-for-grabs
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Redo-San/RedoSan-Authenticity#511 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
help wanted python v9 cert scope: curriculum
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
freeCodeCamp/freeCodeCamp#70604 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
RocketChat/Rocket.Chat#42543 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày