Some Dev Ex issues with x-init
(and some potential solutions)
#527
Replies: 2 comments 5 replies
-
I think there is space for "detect x-* attributes" and log if there are |
Beta Was this translation helpful? Give feedback.
-
Thanks for your feedback. It's a shame but it would be like trying to use stymulus without a data-controller, do you know if stymulus print anything in console in that case? Solution 1 is a no-go for me. People will start seeing those in online tutorials and they'll get false expectations (e.g. they might expect x-on:click to work outside an x-data compinent). It would also be computationally more expensive and add complexity (and probably bugs). To be fair, I'm not sure how many people had that problem, I would prefer improve the readme (And the future official website/documentation). |
Beta Was this translation helpful? Give feedback.
-
Hello!
I was talking to someone about their experience with Alpine and unfortunately they they couldn't get it to work and switched to Stimulus 😢. After chatting with him it looks like the problem was that
x-init
was used withoutx-data
so nothing was ever initialized. I believe it didn't raise an error either so it appeared to do "nothing".I wonder if one of these could help?
x-init
to also initialize a component? So it works as-if you setx-data="{}"
x-data
?I think the main problem was that it seemed to silently fail, so maybe option 2 would work so Alpine can teach the user what to do?
Thanks for reading and for the awesome framework!! :D
Beta Was this translation helpful? Give feedback.
All reactions