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

[BUG] Module augmentation causes import to be tree-shaken (is removed from output) #72

Closed
matthew-dean opened this issue Sep 14, 2023 · 2 comments

Comments

@matthew-dean
Copy link

I'm not certain this is a ts-macros bug or a ts-patch bug, but my perception would be that:

  1. ts-patch shouldn't be doing anything except allowing patching (unless that's incorrect)
  2. ts-macros is the only transformer I'm using

The bug and all its details are here.

To re-summarize:

// chevrotain.d.ts
declare module 'chevrotain' {
  interface CstParser {
    // things that augment this type
  }
}


// cssParser.ts
import { CstParser, EOF } from 'chevrotain'

class CssParser extends CstParser {
 // class implementation
}

// outputs
import { EOF } from 'chevrotain'

Someone on the TypeScript team investigated and said that disabling ts-patch (which disables ts-macros) solves this bug.

@GoogleFeud
Copy link
Owner

Hello! Yes, the issue is definitely coming from this library, thanks for the bug report!

@matthew-dean
Copy link
Author

Awesome, thanks so much!

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

2 participants