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: declare disappear #24

Closed
jorge-graca-sky opened this issue Mar 28, 2023 · 4 comments
Closed

Bug: declare disappear #24

jorge-graca-sky opened this issue Mar 28, 2023 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@jorge-graca-sky
Copy link

Hi, thanks for this amazing effort!

I did notice that when using useDefineForClassFields on TS config plus declare when I add your transformer to the code it removes the declare.

Example code:
https://www.typescriptlang.org/play?useDefineForClassFields=true#code/MYGwhgzhAEBCYBdFmgbwLAChrQA4FcAjEAS2GgBMBTUMAJyrwHskEmAuaCBOkgOwDmAbiw5cvAG6JG1Wg2jB6dFiOwKmfbnXzA2dABQBKNKJwKlLaAF5oAIluqcAXywvMWWlGgB5PiQ0magTEZMysHFw8-MKm4iRSCIyKdMoI1nYOrkA

@timocov
Copy link
Owner

timocov commented Mar 29, 2023

it removes the declare.

@jorge-graca-sky what does it mean? do you have an example of input and output?

@jorge-graca-sky
Copy link
Author

It means that TS compiles as if there was no declare key word written:

class A {
  private b: number;
}

class C {
  private declare d: number;
}

When I use the TS-transformer-minify-privates both these classes output the same js code with Object.defineProperty in the contructor. Class C should not do so.

@timocov
Copy link
Owner

timocov commented Mar 29, 2023

Meanwhile have you tried https://github.com/timocov/ts-transformer-properties-rename instead? It might handle this case better.

@timocov timocov added the bug Something isn't working label Mar 29, 2023
@timocov timocov self-assigned this Mar 29, 2023
@timocov
Copy link
Owner

timocov commented Mar 29, 2023

Fixed in v0.6.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants