DaAnalyst

DaAnalyst

A PETAL "lobbying" group

Inspired by the today exchange with @josevalim regarding a particular maybe-LiveView-maybe-Alpine bug (see the links below) I’d like to open a discussion on the best way to proceed in future cases like this.

https://github.com/phoenixframework/phoenix_live_view/issues/2657

I agree with Jose’ that PETAL (LiveView+Alpine) users should have a single point of reference such as a single repository with just a README.md file where we could merge our knowledge base and best practices, a place that unlike various blogs around will have a history.

Does anyone know if such a repo exists already? If not, I can go about creating one.

In addition, maybe @AstonJ can make a special PETAL sub-category under Phoenix Forum.

Most Liked

greven

greven

I went the Alpine route when LiveView was new and without any JS integration outside of Hooks, for micro interactions Alpine made so much sense (and I was familiar with Vue API which Alpine kinda of mimics).
I later dropped it in favour of just plain LiveView.JS usage and/or combined with Hooks.

Why? Well, because of the CSP (Content-Security Policy), reference: CSP — Alpine.js

In order for Alpine to be able to execute plain strings from HTML attributes as JavaScript expressions, for example x-on:click="console.log()" , it needs to rely on utilities that violate the “unsafe-eval” content security policy.

I’m not comfortable with the trade back nor with the CSP violation, so I preferred to go the %JS{} / Hook routes. :slight_smile:

Glad for your contribution, think that is a good idea. The Phoenix components PETAL framework makes use of Alpine, maybe it can also serve as inspiration for people following that route.

greven

greven

You are right, %JS can’t replace Alpine at all, and probably it never will. That is why we have hooks. I dont think hooks are overkill at all, simply a necessity and generally sprinkling some hooks are all we need in LV land. When hooks get co-located I think we really wont need Alpine at all.

But Alpine is very practical indeed inspite of the CSP violation.

DaAnalyst

DaAnalyst

The initial entries are now available (in the README.md):

https://github.com/liveview-alpine/integration

Where Next?

Popular in Discussions Top

andre1sk
A big advantage to Elixir is all the distributed goodness but for many applications running on multiple nodes having integrated Etcd, Zoo...
New
owaisqayum
I have a sample string sentence = "Hello, world ... 123 *** ^%&*())^% %%:>" From this string, I want to only keep the integers, ...
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
AlexMcConnell
The reason that Rails is as popular as it is is because it’s very easy for relatively inexperienced developers to get a lot of work done....
588 19568 166
New
IVR
Hi all, I’ve seen a number of related threads in the past, but I’d still be very curious to hear an up-to-date opinion on this topic. I...
New
tmbb
This is a post to discuss the new Phoenix LiveView functionality. From Chris’s talk, it appears that they generate all HTML on the serve...
342 18146 126
New
marciol
Please, let me know if this kind of discussion already took place in another topic . Hi all, how do you consider if is better to build ...
New
sergio
There’s a new TIOBE index report that came out that shows Elixir is still not in the top 50 used languages. It also goes on to call Elix...
New
cblavier
Hey there, It’s been more than a year since we started using LiveView as our main UI library and building a whole library of UI componen...
New
jesse
Hi everyone, I hesitated to post this here because I don’t want you to think I’m spamming, but I’ve been working on a Platform-as-a-Serv...
New

Other popular topics Top

danschultzer
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch. This project took far...
548 29377 241
New
johnnyicon
Hi all, I’ve just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I’m trying to use Postgres...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
RisingFromAshes
I’ve read in another post that it may be possible with a router helper - but I couldn’t find an appropriate one, and tbh, I’m still just ...
New
nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New

We're in Beta

About us Mission Statement