-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Ensure candidate extraction works as expected in Clojure/ClojureScript #17087
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
Conversation
I have noticed certain Clojurescript frameworks (well maybe just Fulcro) will use |
b1ead8c
to
c79bdfe
Compare
@chase-lambert Added |
For example, one thing I can think of is there a way to write normal text that is not inside of In other pre processing steps for let's say Haml we can't assume that |
@RobinMalfait You assume correctly. This is 6 symbols and a number Clojure will complain that you're trying to refer to non-existing var "This" and so on. "This is a string—no complaints" How dependent is this strategy of classes being scoped within a Will this work? (let [some-classes [:bg-coal-50 :text-3xl]]
(… {:class [:ring-0 some-classes]})) |
Perfect thanks! It's not dependent on In this case, the Concretely, this example you shared looks like this:
Small note: I changed But now you can see that the |
Let's make sure it works with quotes in comments: ;; This is not starting a string " <- HAHA!
(let [some-classes [:bg-coal-50 :text-3xl]]
(… {:class [:ring-0 some-classes]})) |
Thanks for this, finally clojure is a mainstream language!!! j/k 😅 Thanks for real, allows us to delete some hacky workarounds always nice. |
@philipp-spiess Tailwind 4 is not working entirely as expected for us. This seems to be related to classes with fractions in them, like |
@eneroth Hey! That looks very broken, indeed. Do you mind filing a new issue with a reproduction of what exactly isn't working? |
@philipp-spiess Before that, a thought occurs. Could it be that since you support eg. |
@eneroth we do extract So now the question is, what is the difference between
and
Does Clojurescript have some hardcoded list of elements like I'm currently having a very hard time to even compile something basic like That said, does |
@RobinMalfait I think this is the exact same reason why we ended up creating our own extraction plugin for v3, where I ended up having the same challenge. I settled on a compromise, which will get you to 99%: apart from splitting by This means that For frameworks using the syntax sugar, I imagine that I could see some possible logic of extracting the parts, eg. But my basic advice is: make sure the basic, free-standing form works ( |
This PR adds a Clojure/ClojureScript pre processor to make sure that candidate extraction works as expected.
You can see that the classes preceded by
:
are not properly extracted in the before case, but they are in the after case. We do extract a few more cases now like:class
and:className
itself, but at least we also retrieve all theflex-*
classes.We could also always ignore

:class
and:className
literals: