-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Any thoughts about components? #7
Comments
@azazel75 Yes, I'd definitely love to have a component and live component implementation, just haven't gotten to it yet... Even shorter term, template includes (which don't currently work) are high on the list of things to implement. |
That's a bummer! The custom templates are needed because of the diffing protocol, like in the original LiveView? |
Yup, that's right, we need to generate a tree of statics and dynamics for the diffs and to integrate with the client-side JS (I'm using the same Phoenix Liveview client side JS). The library I'm currently using as the basis (https://github.com/dmulholl/ibis), does support includes already (for generating strings), I just haven't yet hacked in the statics/dynamics support. I'm hoping if https://peps.python.org/pep-0501/ get implemented, it would be easier to also generate the tree we needed from python code (in addition to templating). Theoretically, we could support another templating library if the library had support for generating some kind of parse tree instead of just output text... |
Quick update on this, I did add some initial support for template includes (you can see an example here: https://github.com/ogrodnek/pyview/blob/main/examples/views/includes/includes.html#L1 ), and more details on template includes in the ibis template include docs, so now there is a mechanism to reuse markup across views. I do still plan to add support for "live components" (Ala phoenix LiveView https://hexdocs.pm/phoenix_live_view/Phoenix.LiveComponent.html ) which encapsulate state in addition to markup and can handle events at some point... |
What's your idea of reusability across views? any thoughts on something similar to https://hexdocs.pm/phoenix_live_view/Phoenix.Component.html?
The text was updated successfully, but these errors were encountered: