Skip to content

Glint generates reference comments when using the TOC type #697

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

Open
Windvis opened this issue Feb 1, 2024 · 0 comments
Open

Glint generates reference comments when using the TOC type #697

Windvis opened this issue Feb 1, 2024 · 0 comments

Comments

@Windvis
Copy link
Contributor

Windvis commented Feb 1, 2024

I'm adding Glint / TypeScript support to a v1 addon (by converting to .gts) and I noticed that glint -d outputs a reference comment in files where the TOC type is used. When converting it to use a class instead, the references are no longer generated. According to the Discord it might be a TS issue, but I don't rule out any issues in my setup either 😄.

.gts source
import type { TOC } from '@ember/component/template-only';

interface Signature {
  Blocks: {
    default: [];
  };
  Element: HTMLDivElement;
}

const AuApp: TOC<Signature> = <template>
  <div class="au-c-app" ...attributes>
    {{yield}}
  </div>
</template>;

export default AuApp;
glint -d output
/// <reference types="ember-source/types/stable/@ember/component/template-only" />
/// <reference types="node_modules/@glint/environment-ember-loose/-private/dsl/integration-declarations" />
import type { TOC } from '@ember/component/template-only';
interface Signature {
    Blocks: {
        default: [];
    };
    Element: HTMLDivElement;
}
declare const AuApp: TOC<Signature>;
export default AuApp;
//# sourceMappingURL=au-app.d.ts.map
After converting to a class
import Component from '@glimmer/component';
interface Signature {
    Blocks: {
        default: [];
    };
    Element: HTMLDivElement;
}
export default class AuApp extends Component<Signature> {}
export {};
//# sourceMappingURL=au-app.d.ts.map
@Windvis Windvis changed the title Glint generates a reference when using the TOC type Glint generates reference comments when using the TOC type Feb 1, 2024
NullVoxPopuli added a commit to NullVoxPopuli/fix-bad-declaration-output that referenced this issue Feb 1, 2024
NullVoxPopuli added a commit to NullVoxPopuli/fix-bad-declaration-output that referenced this issue Feb 1, 2024
NullVoxPopuli added a commit to NullVoxPopuli/fix-bad-declaration-output that referenced this issue Feb 1, 2024
Update README

README

Add vitest

oof
NullVoxPopuli added a commit to NullVoxPopuli/fix-bad-declaration-output that referenced this issue Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant