You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Undocumented breaking change in 5.5.0-beta for reference directivesΒ #58324
Hello Jack Works (@Jack-Works), thanks for highlighting this. Your repro is using reference directives in the project's public-facing entrypoint module.
changed the title [-]Undocumented breaking change in 5.5.0-beta about module/global augmentation via .d.ts file across projects[/-][+]Undocumented breaking change in 5.5.0-beta for reference directives[/+]on Apr 26, 2024
Activity
robpalme commentedon Apr 26, 2024
Hello Jack Works (@Jack-Works), thanks for highlighting this. Your repro is using reference directives in the project's public-facing entrypoint module.
/// <reference path="./env.d.ts" />It's true there is an intentional breaking change introduced by Jake Bailey (@jakebailey) in the PR for Do not preserve references in declaration emit, unless preserve=true. And this is not yet documented in the TS 5.5 Beta announcement. so that post should be updated.
The intended workaround for cases where you want the reference directive included in the published declaration file is to add
preserve=true./// <reference path="./env.d.ts" preserve=true/>I'd suggest re-titling this issue:
[-]Undocumented breaking change in 5.5.0-beta about module/global augmentation via .d.ts file across projects[/-][+]Undocumented breaking change in 5.5.0-beta for reference directives[/+]jakebailey commentedon Apr 26, 2024
Sorry about that; it definitely was meant to be there in the blog! We'll get it updated.
jakebailey commentedon Apr 27, 2024
Blog post has been updated: https://devblogs.microsoft.com/typescript/announcing-typescript-5-5-beta/#simplified-reference-directive-declaration-emit