Skip to content
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

Make child html reader tag optional? #479

Open
borkdude opened this issue Mar 11, 2024 · 3 comments
Open

Make child html reader tag optional? #479

borkdude opened this issue Mar 11, 2024 · 3 comments

Comments

@borkdude
Copy link
Member

In many cases it would be nice to not have to write the child html reader tag:

      #html ^lit/html
                   [:div {:class "bg-red-200"} (when true [:em "hello"]))]

However, there might be cases where a child vector is intended as a JS runtime array and not HTML:

      #html ^lit/html
                   [:div {:class "bg-red-200"} (pr-str [:em "hello"])]

This may be a reason to always make child tags explicit, however the 99% use case is probably the opposite. Maybe an explicit way to opt out of propagating could also work.

@zampino
Copy link

zampino commented Mar 11, 2024

Or as a third case, have a different reader tag #html* that propagates (with the same ^tag) to child forms?

@zampino
Copy link

zampino commented Mar 11, 2024

as for

      #html ^lit/html
                   [:div {:class "bg-red-200"} (pr-str [:em "hello"])]

we could always use vec to build an actual js array

@zampino
Copy link

zampino commented Mar 11, 2024

+1 for the opposite :-)

however the 99% use case is probably the opposite

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants