-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Extractor issues in Livewire Flux #17023
Comments
Thanks @RobinMalfait! Let me know if you need any more information or want me to test anything. Happy to help as best as I can 🙂 |
…s expected (#17031) This PR fixes an issue where candidates are not properly extractor when they end in `\`. This can happen if you embed a programming language like JS inside another language like PHP where you need to escape some strings. Here is an example of Livewire flux: ```blade @php if ($sidebarIsStashable) { $attributes = $attributes->merge([ 'x-init' => '$el.classList.add(\'-translate-x-full\'); $el.classList.add(\'transition-transform\')', // ^ ^ ]); } @endphp <div x-data {{ $attributes->class('border-r w-64 p-4 min-h-dvh max-h-dvh top-0 fixed left-0') }}> {{ $slot }} </div> ``` Where the `\'` is causing some issues. Another solution might be to add a custom pre processor for blade files where we drop the escaped characters, but that felt overkill for now because some escapes are still valid. Fixes: #17023 # Test plan 1. Added a test to cover this case. 2. Existing tests still pass
Alright this should be fixed by #17031 and will be available in the next release. Going to prepare a new release as we speak. /cc @joshhanley |
@RobinMalfait legend! Thanks so much for that. Can confirm, pulled down Tailwind v4.0.12 and the Flux sidebar is happy. Thanks again for the quick fix! |
@RobinMalfait hey we are having an issue with Livewire Flux since Tailwind v4.0.10 and I suspect it might be related to this PR. I tried compiling Tailwind locally to see if I could bisect exactly what PR/ commit is causing it, but I'm not smart enough to get it all running in a local repo 😆 so this PR is my best guess at what's causing the issue.
The problem we are having is we have a blade component for the sidebar
<flux:sidebar />
and it looks something like this (simplified)Since the changes in Tailwind v4.0.10, the styles
-translate-x-full
andtransition-transform
which are inside the conditionally addedx-init
are not being compiled by Tailwind and our sidebar is not being hidden.If I add those classes in another file though (or somewhere else in this file), they get compiled correctly and our sidebar is being hidden as expected.
I also experimented removing the backslashes from before the single quotes and everything works and compiles as expected.
Would you have any thoughts as to what might be causing that? It's causing issues because the new Laravel Livewire starter kit is using Flux and people's sidebars aren't hiding 😅
Thanks in advance!
Originally posted by @joshhanley in #16306 (comment)
The text was updated successfully, but these errors were encountered: