Skip to content

Conversation

@zhiyuanzmj
Copy link
Contributor

@zhiyuanzmj zhiyuanzmj commented Jul 6, 2025

Description

transformer-attributify-jsx using regex to transform by default. but regex has many bugs and performance issue.

#4384 #4195

Performance

#3088

Since in unocss's vscode plugin, the regex version of transformer-attributify-jsx would be running many times when user is typing. So i use process.env.VSCODE_CWD to prevent it running in vscode plugin. it should only used in runtime plugin.

After resolve the performance issue, we can safely use the babel plugin.

Babel plugin

Before the babel plugin was walked ast twice. so i use @babel/traverse walk the ast once, make it faster.

@zhiyuanzmj zhiyuanzmj requested review from antfu and zyyv as code owners July 6, 2025 14:43
@netlify
Copy link

netlify bot commented Jul 6, 2025

Deploy Preview for unocss ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 6e6948d
🔍 Latest deploy log https://app.netlify.com/projects/unocss/deploys/68776c9f0e9b34000884394c
😎 Deploy Preview https://deploy-preview-4807--unocss.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jul 6, 2025

Open in StackBlitz

commit: 6e6948d

@zyyv
Copy link
Member

zyyv commented Jul 7, 2025

Thanks @zhiyuanzmj , it was too difficult to maintain using regular expressions before🥹.

@zyyv zyyv enabled auto-merge July 16, 2025 09:13
@zyyv zyyv added this pull request to the merge queue Jul 16, 2025
Merged via the queue into unocss:main with commit 466803a Jul 16, 2025
11 checks passed
@paschun
Copy link

paschun commented Sep 15, 2025

This change appears to have broken integration with @astrojs/mdx

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

Successfully merging this pull request may close these issues.

3 participants