shahryarjb
Hi friends, if you want to create some complex components for example nested and tree drop down select box with search and etc! what option you select?
For example I do not want to send everything from server to client and if I use hook with pure JS, it is not easy to manage for examples more than 200 components (LiveView JS module is good for basic component, not for managing client state edit DOM + project structure even do the limit function in client side not server side)
I see petal using alpine JS or some friends using ReactJS, VueJS and etc.
I just need your suggestion especially a way that is light and developer friendly. imagine you have about 200 components(some of them stateless and the other stateful in client side).
I really need this so that Elixir Developer doesn’t feel like I’m using frontend js frameworks in phoenix LiveView again.![]()
Thank you in advance.
Trending in Questions
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #ai
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #elixirconf-eu
- #metaprogramming
- #hex











Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
bdarla
I also use Javascript hooks for such interactions. Indeed, it has some complexity.
Recently, I am thinking to investigate LiveSvelte for this particular part, however, I have not experimented yet.
DaAnalyst
I’ve been using AlpineJS with success. There are few integration issues that occurred post LV 0.20.1 but one can work around them.
shahryarjb
Could you name some of these problems please?
shahryarjb
Unfortunately, there is a bit of a learning curve, especially for Elixir developer when customizing!!
If I do it pure with hook I think I am going to taste XSS
and after 10 or 12 big component I am going to be dived deep inside black hole
I use ReactJS and Nextjs myself.
DaAnalyst
Sometimes it happens that the Alpine data in a LiveComponent does not get initialized, so you need to have a simple hook initializing it yourself.
In certain cases, you even need to do this on updates (not just on
mounted), or otherwise the JS code crashes. Having to do this on updates may be an issue for in such cases (and I am talking about really complex components e.g. LiveComponents within a stream within LiveComponents within a stream, ..) the data that gets initialized this way with your hook also gets reset.Personally, I have managed to circumvent all the issues and the app is working really well in a staging environment (AWS/Kubernetes) and overall, I am satisfied with AlpineJS despite those issues with the integration.
Also, I have agreed with an AlpineJS library developer to check a demo of mine once LV 1.0 final is out, so we can at least understand if it’s really a LV issue or an Alpine issue and if possible to make them work smoothly again.
shahryarjb
Could you share some components that you are using Alpine with LiveView hook? if it is possible?
Update
Why you did not use something like
sveltethat has less size in bundle size? is there any reason?KP123
What XSS issues were you experiencing in your hooks implementation?
DaAnalyst
Can’t share the components. It’s a proprietary platform. But here’s what I do..
or
An item LiveComponent
I use Alpine and not svelte because it was given to me as a requirement and at the time I started using it neither myself nor the client were aware of a viable LV-svelte integration (still not sure if there was one).
shahryarjb
It is not about LiveView, I was talking about pure js that I want to create and connect to liveview
2 safe functions can be an unacceptable vulnerable
superchris
We’ve had good success using Custom Elements AKA Web Components as a means for integrating client JS with LiveView. We’ve put out LiveElements as a library to make this process easier.