-
-
Notifications
You must be signed in to change notification settings - Fork 502
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
transformer: non-type-only import is only referenced by the type, but is not eliminated. #4423
Comments
May I try it? I am going to investigate this issue to enhance the understanding and functionality of |
Go for it! |
I came up with a solution to this problem. We need to check if the next value binding definition has a value reference before defining it. If it doesn't, we can safely remove the import. To make it possible, we need to add oxc/crates/oxc_semantic/src/symbol.rs Lines 43 to 45 in 2c431cb
This could help us to find if it is a value symbol or a type symbol from Also, Since the transformer doesn't have a whole @overlookmotel Can you confirm this for me? |
I'm not familiar with the changes you've made over past few weeks to resolve TS type references. But I'd have assumed could figure out that can remove But, given that I don't understand how it's working now, I could well be wrong. I don't object if you want to revert #4464. Really I didn't want to be making changes to |
It's hard to verify; consider this situation. // mod.ts
export class T {} In this situation, the value of T and its type have been exported. |
Oh, I misunderstood, this is about the issue of name resolution. |
After digging deeper into how |
@Dunqing can we close this? |
esbuild
handles this case correctly. esbuild replOXC Playground
In
Out
Expected
The text was updated successfully, but these errors were encountered: