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

JS directive is parsed as a conditional #54

Closed
calebdw opened this issue Feb 2, 2024 · 9 comments
Closed

JS directive is parsed as a conditional #54

calebdw opened this issue Feb 2, 2024 · 9 comments

Comments

@calebdw
Copy link
Contributor

calebdw commented Feb 2, 2024

See comment: #53

@EmranMR
Copy link
Owner

EmranMR commented Feb 2, 2024

Can I ask if you have the link for the documentation? I actually came across a few of your pull request on Laravel as well, but could not find any documentation as Taylor suggested there!

Is it AlpineJS > Using the @js directive or a Laravel Directive? :)

@calebdw
Copy link
Contributor Author

calebdw commented Feb 2, 2024

@js started off as a Livewire directive, but was then added to the framework

Not sure why Taylor doesn't want to document it, but it's used in Breeze so 🤷‍♂️

@EmranMR
Copy link
Owner

EmranMR commented Feb 2, 2024

Haha thanks for that! It's actually handy I didn't know about it myself as well!

EmranMR added a commit that referenced this issue Feb 24, 2024
@EmranMR EmranMR reopened this Feb 24, 2024
@EmranMR
Copy link
Owner

EmranMR commented Feb 24, 2024

@calebdw sorry to bother, but could you test the new update with your AlpineJS javascript injection using the following edge case?

<div x-data="{ posts: @js($posts) }">
</div>

@calebdw
Copy link
Contributor Author

calebdw commented Feb 27, 2024

Sorry it took so long!

Here it is below:

image

@EmranMR
Copy link
Owner

EmranMR commented Feb 27, 2024

@calebdw no bother! thanks for getting back

I can not see the AST, in relation the javascript injection and the @js($php)
I suspect it is all good? Can I go ahead and close this issue? 😊

@calebdw
Copy link
Contributor Author

calebdw commented Feb 27, 2024

Actually, the @js is being parsed as a php_statement---not sure if this is intended:

image

@EmranMR
Copy link
Owner

EmranMR commented Feb 27, 2024

@calebdw oh good catch! 🤦‍♂️
Will fix it, that was a mistake!

@EmranMR
Copy link
Owner

EmranMR commented Feb 27, 2024

That should be it, all fixed! thanks for catching!

@EmranMR EmranMR closed this as completed Sep 18, 2024
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

No branches or pull requests

2 participants