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

comments loss when compiler typescript jsx element #9849

Open
xiaoxudoo opened this issue Jan 7, 2025 · 2 comments
Open

comments loss when compiler typescript jsx element #9849

xiaoxudoo opened this issue Jan 7, 2025 · 2 comments
Assignees
Labels
Milestone

Comments

@xiaoxudoo
Copy link

Describe the bug

image
commens loss when compiler typescript jsx element

Input code

<Tabs>
  {/* #if IS_VOLC */}
  <TabPane
  >
    <TTSTabPane />
  </TabPane>
  <TabPane
  >
    <ComputerVisionTabPane />
  </TabPane>  
  {/* #endif */}
</Tabs>

Config

none

Playground link (or link to the minimal reproduction)

https://play.swc.rs/?version=1.10.5-nightly-20250107.1&code=H4sIAAAAAAAAA7MJSUwqtuNSAAIbIDMgMS8VwtPXT0lJgYjro0hU62spKGemKXgGx4f5%2BzgraOnXYtEOEQkJhgoq6NthMwuLHuf83ILSktSisMzizPw8%2FNrBTknNSwG6BuQKsGyxHQDVI7WO0wAAAA%3D%3D&config=H4sIAAAAAAAAA1WPSw7DIAxE9zkF8rrbdtE79BCIOhEVBGQ7UlGUuxfCp%2B0Ov5nxmH1SCl5s4K72%2FMxD1MRIY86E0yr6nQlIisiGbBS4dFW4SEIbnuSoAoimBaWEkK%2FNDS4Exsxm7Rgb83a1c%2FrtM8FHQuZ%2FY7HqdXEjX%2BumVgk%2BPLdTbP8ot9b6G3xNvWwsBsuPnqxrjw%2BfJDr2FAEAAA%3D%3D

SWC Info output

none

Expected behavior

retain comment

Actual behavior

none

Version

1.10.4

Additional context

none

@xiaoxudoo xiaoxudoo added the C-bug label Jan 7, 2025
@kdy1 kdy1 added this to the Planned milestone Jan 7, 2025
@kdy1
Copy link
Member

kdy1 commented Jan 7, 2025

The problem is that we are not calling comment emitting macros from

fn emit_jsx_expr_container(&mut self, node: &JSXExprContainer) -> Result {
punct!("{");
emit!(node.expr);
punct!("}");
}

@xiaoxudoo xiaoxudoo changed the title commens loss when compiler typescript jsx element comments loss when compiler typescript jsx element Jan 7, 2025
@xiaoxudoo
Copy link
Author

xiaoxudoo commented Jan 7, 2025

@kdy1 related issuses:#9850

@kdy1 kdy1 self-assigned this Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants