phoenix_live_view icon indicating copy to clipboard operation
phoenix_live_view copied to clipboard

Support declarative assigns in LiveComponent and LiveView

Open josevalim opened this issue 1 year ago • 4 comments

Do we want to go this route? Or should we tell them to wrap their LiveComponent/LiveView in a function component? I am not the biggest fan of the second because it hides the internal complexity.

Leftover from #2016.

josevalim avatar Aug 11 '22 18:08 josevalim

I would like to start exploring declarative assigns for LiveComponents next, then move to declarative assigns for LiveViews based on what we learn.

I am also not a fan of wrapping LiveComponents and LiveViews in a HEEx function component. HEEx function components look like HTML and imply no hidden state or behavior. Visually I think it makes sense for LiveComponents and LiveViews to stand out and take a bit more syntax to setup.

Hopefully that will guide users towards writing smaller function components and composing those together?

connorlay avatar Aug 11 '22 20:08 connorlay

Is this something that is blocking the 0.18 release or will it be released afterwards?

dvic avatar Aug 17 '22 06:08 dvic

Afterwards.

josevalim avatar Aug 17 '22 06:08 josevalim

FWIW, I'd also like to see at least LiveComponent support declarative assigns (I arrived here while trying to figure out if this is in the plan)

maxmarcon avatar Aug 21 '22 20:08 maxmarcon

Closing this for now. The best option for now is to wrap them in a function component.

josevalim avatar Sep 20 '23 20:09 josevalim