Skip to content
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

Preventing /// <reference types="... from showing up in declaration output #248

Open
NullVoxPopuli opened this issue Jan 22, 2024 · 2 comments · May be fixed by #255
Open

Preventing /// <reference types="... from showing up in declaration output #248

NullVoxPopuli opened this issue Jan 22, 2024 · 2 comments · May be fixed by #255

Comments

@NullVoxPopuli
Copy link
Collaborator

Last fix related to this problem here: ember-cli/ember-page-title#283

Not sure what to do, as TypeScript says the behavior (of including references) is correct, so that means we kinda have to work around it.

@ef4
Copy link
Contributor

ef4 commented Jan 23, 2024

Can you link me to where they say it's correct?

Have we tested what happens if the addon itself includes a import "ember-source/types" in its own code? Does that make the triple-slash references go away? (That would still not be ideal but would at least be consistent.)

I wonder if tsc is smart enough to not do this if ember-source was using package.json exports to force these files to be private? Surely under those conditions it would be wrong to directly access them from typescript.

@NullVoxPopuli
Copy link
Collaborator Author

Can you link me to where they say it's correct?

Specifically:

Have we tested what happens if the addon itself includes a import "ember-source/types" in its own code?

I hadn't, because that would mean min-supported version would have to be [email protected], and imo, not enough people or off 3.28 yet.
But I just tried it on ember-page-title (moving the import "ember-source/types" from unpublished-development-types/index.d.ts to src/index.ts and disabling the part of the inline rollup plugin in that PR to remove the references -- and the /// <reference lines came back -- so I don't think import location makes a difference.

The fix I've implemented is also not ideal, because I don't know what the consequences of .d.ts.map files are -- I've had a hard time verifying .d.ts.map usefulness, and don't have a good way to verify one way or another.


For some papertrail / history, her are other occurrences of this problem:

Starting back in August, 2023:


Also (duplicate issue reports)

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

Successfully merging a pull request may close this issue.

2 participants