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

fix(es/codegen): Skip emit space if jsx attrs is empty #6823

Merged
merged 3 commits into from
Jan 16, 2023
Merged

fix(es/codegen): Skip emit space if jsx attrs is empty #6823

merged 3 commits into from
Jan 16, 2023

Conversation

westhide
Copy link
Contributor

Description:
For now, when emit a JSXOpeningElement directly, it will contain a space whether or not attrs is empty.

// input
<div></div>
// output
<div ></div>

This PR fix this issue by skip space!() and emit attrs when attrs is empty.

@CLAassistant
Copy link

CLAassistant commented Jan 16, 2023

CLA assistant check
All committers have signed the CLA.

@kdy1
Copy link
Member

kdy1 commented Jan 16, 2023

You can do UPDATE=1 cargo test to update fixtures

@westhide
Copy link
Contributor Author

Already try to fix test error, Thx!

Copy link
Member

@kdy1 kdy1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!


swc-bump:

  • swc_ecma_codegen

@kdy1 kdy1 enabled auto-merge (squash) January 16, 2023 15:23
@kdy1 kdy1 added this to the Planned milestone Jan 16, 2023
@kdy1 kdy1 merged commit e9fdac2 into swc-project:main Jan 16, 2023
@kdy1 kdy1 modified the milestones: Planned, v1.3.27 Jan 17, 2023
@swc-project swc-project locked as resolved and limited conversation to collaborators Feb 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants