Skip to content

[wab] don't leave blank lines between generated JSX attributes - #178

Closed
Zayooo00 wants to merge 1 commit into
plasmicapp:masterfrom
Zayooo00:codegen-no-empty-jsx-attribute-lines
Closed

Zayooo00 wants to merge 1 commit into
plasmicapp:masterfrom
Zayooo00:codegen-no-empty-jsx-attribute-lines

Conversation

@Zayooo00

@Zayooo00 Zayooo00 commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Since @plasmicapp/cli 0.1.380 every non-root element in synced code gets an empty line after data-plasmic-override. makeCreatePlasmicElement interpolates data-plasmic-root, data-plasmic-for-node and the trigger props as empty strings when they don't apply, so the raw output always had empty lines there. Prettier used to drop them, but 3.9 keeps one blank line between JSX attributes on purpose (prettier/prettier#19161), and the CLI bundles 3.9 since 0.1.380, so they now show up in every sync diff.

This only joins the attributes that are present. The output is otherwise the same: the snapshot updates only remove empty lines. I added a test that formats a generated module with prettier and checks there's no blank line after data-plasmic-override. It fails on master.

makeCreatePlasmicElement interpolates every optional attribute
(data-plasmic-root, data-plasmic-for-node, trigger props) as an empty
string when it doesn't apply, leaving empty lines in the element. The
CLI used to hide them because prettier removed blank lines between JSX
attributes, but prettier 3.9 keeps one (prettier/prettier#19161), so
since @plasmicapp/cli 0.1.380 every synced non-root element gets an
empty line after data-plasmic-override. Only join the attributes that
are present.
@vercel

vercel Bot commented Nov 2, 2026

Copy link
Copy Markdown

@Zayooo00 is attempting to deploy a commit to the Plasmic Team on Vercel.

A member of the Team first needs to authorize it.

@sampullman

Copy link
Copy Markdown
Contributor

Thanks! Merged in 7dd858a

@sampullman sampullman closed this Nov 3, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants