app's TS files do not properly overwrite an addon's JS files
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript, typescript
- Domain
- frontend
Research direction
Reproduce the component override using the shown my-addon/addon and my-app/app TypeScript and JavaScript files, then compare it with the working JavaScript override. Trace how the app component is resolved over the addon's component and identify why the TypeScript version fails. Done means a TypeScript app component and template can replace the addon's JavaScript component while retaining the Glint declarations.
Written by the indexing model from the issue text.
Description
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>
- Dominant language
- JavaScript
- Stars
- 77
- Forks
- 65
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ember-cli/ember-cli-htmlbars
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
ember-cli/ember-cli-htmlbars#792 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
ember-cli/ember-cli-htmlbars#787 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 38/100
ember-cli/ember-cli-htmlbars#781 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
ember-cli/ember-cli-htmlbars#779 · 1 comment ·
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 30/100
ember-cli/ember-cli-htmlbars#753 · 1 comment · 1 reaction ·
All issues in ember-cli/ember-cli-htmlbars
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
docToolchain/docToolchain#1705 ·
-
Timezone select lists one option per character; duplicate "Failed" reason; shared tracker popover id Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
nightscout/nocturne#1414 ·
-
bug v2
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
modelcontextprotocol/inspector#2458 · 1 comment ·
-
Mend: dependency security vulnerability status: needs triage 🕵️♀️
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
carbon-design-system/ibm-products#9907 ·