liveview-native / liveview-native/liveview-native-core

LiveView Native Clients: Support `live_render` to render one liveview within another

Open
#64 0 comments 0 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
166
Forks
14
PR merge metrics
No merged PRs in 30d

Description

https://dockyard.slack.com/archives/C02E1GA5THB/p1701882344052169

bcardarella
[12:05 PM](https://dockyard.slack.com/archives/C02E1GA5THB/p1701882344052169)
[@May Matyi](https://dockyard.slack.com/team/U03GBMZ68JE)
I'm reproducing Chris' original thermostat LV demo and he uses live_render to render one liveview within another. Do we support that?
[12:06](https://dockyard.slack.com/archives/C02E1GA5THB/p1701882360543219)
I'm guessing we do not

May Matyi
[12:11 PM](https://dockyard.slack.com/archives/C02E1GA5THB/p1701882677898229)
[@bcardarella](https://dockyard.slack.com/team/U024L9T6Q)
I actually haven’t tested that so I’m not sure? If you’re working off main you could try this, if that doesn’t work it’s something we’ll have to add support for
Untitled

live_render(conn_or_socket, SomeLiveView, session: %{"lvn" => %{"format" => "swiftui"}})

[12:11](https://dockyard.slack.com/archives/C02E1GA5THB/p1701882718318719)
you could also refactor it to use a LiveComponent, which are working

bcardarella
[12:12 PM](https://dockyard.slack.com/archives/C02E1GA5THB/p1701882761129329)
I recall discussing this very early on with Anil but I'm pretty certain it wasn't implemented. I'm not yet working with LVN I'm currently porting his demo to a modern phoenix install
New

May Matyi
[12:12 PM](https://dockyard.slack.com/archives/C02E1GA5THB/p1701882761289819)
oops that snippet was wrong, fixed
[12:12](https://dockyard.slack.com/archives/C02E1GA5THB/p1701882768912649)
oh gotcha
[12:14](https://dockyard.slack.com/archives/C02E1GA5THB/p1701882866938049)
I’ve only used live_render a few times when I was migrating Phoenix controllers to LiveView for a project since it lets you render a LiveView in a dead template
[12:14](https://dockyard.slack.com/archives/C02E1GA5THB/p1701882871937399)
so I’m not really sure how it works lol

bcardarella
[12:16 PM](https://dockyard.slack.com/archives/C02E1GA5THB/p1701883008297339)
yeah I think we'll have to scope this out for LVN Core, I don't think it is worth trying to get into the swiftui client at this point. Maybe that can be a v0.4 thing. I honestly don't know how often people are using live_render to render LVs within LVs. I'll have to figure out what type of priority this is

alex.zholtkevych
[12:17 PM](https://dockyard.slack.com/archives/C02E1GA5THB/p1701883055665859)
Adding issue in case of not to forget

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.