News for hackers. Stuff that matters.
Re:Ask HN: Are you satisfied with Elixir or do you regret ch... by midrus on Tuesday May 18, 2021 @12:54PM (#27197530)
<button @mouseenter.once=" fetch('/dropdown-partial.html') .then(response => response.text()) .then(html => { $refs.dropdown.innerHTML = html }) " @click="open = true" >Show Dropdown</button>

Seriously? This has to be a joke.

Re:Ask HN: Are you satisfied with Elixir or do you regret ch... by alluro2 on Tuesday May 18, 2021 @03:38PM (#27199945)
I was stumped when I saw it just now. What the heck...I guess the next thing, an amazing breakthrough, is going to be Alpine.scss style="background-color:$red-secondary;font-weight:bold"
Re:Ask HN: Are you satisfied with Elixir or do you regret ch... by hnedeotes on Tuesday May 18, 2021 @03:59PM (#27200224)
I don't use alpine, but isn't that the blessed way of doing it in React/Vue/etc? I thought they were the ones introducing both @handlers on elements and JSX styling
Re:Ask HN: Are you satisfied with Elixir or do you regret ch... by midrus on Wednesday May 19, 2021 @01:09AM (#27204794)
Maybe, except in React you have a huge community, formatters, linters, editors, testing tools/libraries and an overall architecture for doing things. Alpine seems worse than just using jQuery. I'd prefer to use something like Unpoly before using this monstrosity.
Re:Ask HN: Are you satisfied with Elixir or do you regret ch... by ecmascript on Wednesday May 19, 2021 @05:06AM (#27206174)
Then don't use it, no one is forcing you man. Just because it is not for you doesn't mean its bad or that other people can't have use for it.

You don't really need to use alpine either if you use Phoenix with Liveview, you can probably get away with just using vanilla js if all you really need is some small functionality of modals popping up etc.

Re:Ask HN: Are you satisfied with Elixir or do you regret ch... by deallocator on Wednesday May 19, 2021 @09:00AM (#27207953)
why would you load the dropdown HTML separately, just render it along in the template with x-show="open" and have the @click="open=true"?
Re:Ask HN: Are you satisfied with Elixir or do you regret ch... by midrus on Wednesday May 19, 2021 @04:48PM (#27214274)
This is an example from their docs. That's why.