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

Add typescript_class_properties pass to strip_types method #7148

Closed
bartlomieju opened this issue Aug 21, 2020 · 2 comments
Closed

Add typescript_class_properties pass to strip_types method #7148

bartlomieju opened this issue Aug 21, 2020 · 2 comments
Assignees

Comments

@bartlomieju
Copy link
Member

No description provided.

@kitsonk
Copy link
Contributor

kitsonk commented Aug 23, 2020

As I said in swc-project/swc#987, I don't think we should do this. We want the emit to use ES spec field initialisers. To get TypeScript to produce them, we need to set useDefineForClassFields to true (and we should consider adding it to the ignored options list). This will cause the emit to align to what I think the strip_types does currently, and will error on problematic, no ES spec situations like the example in swc-project/swc#980.

The alternative is to continue to drag non-aligned code around for the foreseeable future and not use ES spec field initialisers, which we don't really want to do.

@bartlomieju
Copy link
Member Author

@kitsonk thanks for the insights, that sounds good to me, I'll keep this issue open a bit longer, but will close related PR.

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