adding x-for sort as default #1134
excitedbox
started this conversation in
3. Feature Ideas
Replies: 2 comments 4 replies
-
Can you post an example in a codepen? |
Beta Was this translation helpful? Give feedback.
2 replies
-
Just my opinion, but to me this is a feature. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I was just running some tests on x-for and since having a list of items like letters: [a:'' , a:'' , a:'' , b:'' , a:'' , a:'' , a:''] would only run through the first 3 items wouldn't it be a good idea to have x-for sort the objects by default. That way it will run through all of them which is the expected behavior of an array iterator.
using objects for x-data and therefore x-for brings lots of downsides with it and I wonder if there is a need for some real looping and arrays as well. As someone who has not been with Alpine for a long time it seems like every time I want to do something I run into a brick wall. Usually related to limitations of what should be Alpine's best features. I find myself reaching for regular JS over and over in which case it is easier to just not use Alpine at all because using a touchy x-for / x-data system is just tying a weight to ones leg when you are calling a JS function anyway. It is just as easy to use a Html/CSS event to call that function without the overhead and reliability risk.
My suggestion would be to create some solid, versatile and easy to use looping and data access functions and a easier event system. Those would be the KILLER FEATURES for Alpine JS. Calling a JS function in a html document is not a problem but simple on events need too much JS because of the verbose syntax. The direction Alpine is heading right now is Simplicity which is good but simplicity shouldn't come at the cost of functionality, ease of use or getting things done.
Beta Was this translation helpful? Give feedback.
All reactions