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

Accept x-data="true" as a synonym for x-data="{}" #3339

Merged
merged 1 commit into from Jan 28, 2023

Conversation

aral
Copy link
Contributor

@aral aral commented Dec 14, 2022

As per #3337, some frameworks (like htm) convert <div x-data … /> to <div x-data="true" … /> whereas Alpine.js currently only accepts the equivalent of <div x-data="" … />. This patch (based on #3337 (reply in thread)), also makes it accept x-data="true" to mean data is {}.

As per alpinejs#3337, some frameworks (like htm) convert `<div x-data … />` to `<div x-data="true" … />` whereas Alpine.js currently only accepts `<div x-data="" … />`. This patch (as per alpinejs#3337 (reply in thread)), also makes it accept `x-data="true"` to mean data is `{}`.
@aral aral changed the title Accept x-data="true" as a synonym for x-data="" Accept x-data="true" as a synonym for x-data="{}" Dec 14, 2022
@aral
Copy link
Contributor Author

aral commented Dec 14, 2022

Looks like it’s causing a UI component test to fail. Afaik those are closed-source, so I don’t think I can help with that. If someone with access to the source can take a look when they get a moment I’d appreciate it. Otherwise, if there’s anything else I can do, please do let me know.

@ekwoka
Copy link
Contributor

ekwoka commented Dec 15, 2022

Technically the ui components are not closed source, they're right there in the repo under package/ui, but a few of them are flaky/incomplete, so if a quick look doesn't seem like this is related, then the ui tests can be ignored for now.

@aral
Copy link
Contributor Author

aral commented Dec 15, 2022

Technically the ui components are not closed source, they're right there in the repo under package/ui, but a few of them are flaky/incomplete

Ah, so they’re not the Alpine UI Components from https://alpinejs.dev/components (that’s why I was confused; those have a commercial license and these are apparently under MIT but they’re both referred to as UI components under the Alpine name) :)

(I’ll take a quick look to see what’s failing tomorrow.)

@ekwoka
Copy link
Contributor

ekwoka commented Dec 16, 2022

Well, yes and no. The documentation for the headless components are all behind that, but the package itself is just right in the repo and npm, just no documentation for it.

@joshhanley
Copy link
Collaborator

@aral the failing test is popover.spec.js which is frequently flaky, so I wouldn't worry about that. 🙂

@joshhanley
Copy link
Collaborator

@aral thanks for the PR! Could you add a test for this? Thanks!

@joshhanley joshhanley merged commit 23d4147 into alpinejs:main Jan 28, 2023
@joshhanley
Copy link
Collaborator

@aral Caleb said to merge anyway! Thanks for the PR!

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.

None yet

3 participants