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

feat(attributify-jsx): new transformer transformer-attributify-jsx #1334

Merged
merged 21 commits into from Jul 29, 2022
Merged

feat(attributify-jsx): new transformer transformer-attributify-jsx #1334

merged 21 commits into from Jul 29, 2022

Conversation

SnowingFox
Copy link
Contributor

@SnowingFox SnowingFox commented Jul 25, 2022

provide a transoformer transformer-attributify-jsx to fix #1238,

for example

<div text-5xl animate-bounce>
  unocss
</div>

Will be compiled to:

<div text-5xl="" animate-bounce="">
    unocss
</div>

fix #1333

@SnowingFox SnowingFox requested a review from antfu as a code owner July 25, 2022 07:53
@netlify
Copy link

netlify bot commented Jul 25, 2022

Deploy Preview for unocss failed.

Name Link
🔨 Latest commit 35c45fc
🔍 Latest deploy log https://app.netlify.com/sites/unocss/deploys/62e3e55a9f71d50008a6f1b0

@SnowingFox
Copy link
Contributor Author

SnowingFox commented Jul 29, 2022

@antfu Sorry to bother you, i fix these problems a few days ago, but after that, there was no response, is still has other problems?

@antfu
Copy link
Member

antfu commented Jul 29, 2022

Test fails

@SnowingFox
Copy link
Contributor Author

SnowingFox commented Jul 29, 2022

I only find two test errors, first is the cli.test.ts throw an timeout error, so i reset the testTimeout value and test it again, but it still throw an error

image
image

I don't know how it could happen. But i notice that
image

and after insert await it work well.

image

@antfu antfu changed the title feat: support jsx to use preset-attributify, and better to use preset-attributify in jsx feat(attributify-jsx): new transformer transformer-attributify-jsx Jul 29, 2022
@antfu
Copy link
Member

antfu commented Jul 29, 2022

....WAIT, have you tried this?

trueToNonValued?: boolean

@SnowingFox
Copy link
Contributor Author

SnowingFox commented Jul 29, 2022

....WAIT, have you tried this?

trueToNonValued?: boolean

I tried this, it can't work in react, but can work in solidjs even without this property

react-demo
solidjs-demo

I think this is limit of react

@antfu antfu merged commit 3a931b8 into unocss:main Jul 29, 2022
@SnowingFox
Copy link
Contributor Author

SnowingFox commented Jul 29, 2022

image

Actually, i tried hover:2xl in solidjs, it can work well, but cannot work with the other two
https://stackblitz.com/edit/vitejs-vite-mespfk?file=src%2Fmain.jsx,src%2FApp.jsx

hover:2xl may just only cannot work with react

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.

There has a omission in preset-attributify's support for jsx Attributify mode not working with React
2 participants