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

JSX option "preserve" discards whitespace #3818

Closed
bterlson opened this issue Jul 1, 2024 · 3 comments
Closed

JSX option "preserve" discards whitespace #3818

bterlson opened this issue Jul 1, 2024 · 3 comments

Comments

@bterlson
Copy link

bterlson commented Jul 1, 2024

The JSX preserve transform discards leading whitespace within a JSXElement and prior to a child JSXElement, and discards trailing whitespace after a child JSXElement . See this example here where the output JSX for Foo
should contain more whitespace at the start and end of the component.

@evanw
Copy link
Owner

evanw commented Jul 1, 2024

I'm not sure why you're linking to version 0.19.11, which came out at the beginning of this year. In the very next version (version 0.19.12), this behavior was changed to do exactly what you're suggesting. So esbuild already works the way you want. You just need to use a newer release of esbuild.

@bterlson
Copy link
Author

bterlson commented Jul 1, 2024

My apologies! I will blame it on having 1000 tabs open late at night and will try not to think about this when I'm trying to fall asleep for years to come.

@bterlson bterlson closed this as completed Jul 1, 2024
@bterlson
Copy link
Author

bterlson commented Jul 1, 2024

Ahh sorry again, there is a case which does repro in the latest version which explains how I noticed something wrong. I'll update the original issue text.

@bterlson bterlson reopened this Jul 1, 2024
@evanw evanw closed this as completed in 626ac2c Jul 2, 2024
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