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

Lit/html example seems broken in the playground #552

Closed
lexeko opened this issue Sep 17, 2024 · 5 comments
Closed

Lit/html example seems broken in the playground #552

lexeko opened this issue Sep 17, 2024 · 5 comments

Comments

@lexeko
Copy link

lexeko commented Sep 17, 2024

When I open the lit/html example in the playground and then click "compile" without making any modifications, I got "Invalid left-hand side in assignment" error. Please refer to the screenshot:

image

@borkdude
Copy link
Member

It seems defclass can't be compiled in REPL-mode. I'll take a look at this, thanks.

@lexeko
Copy link
Author

lexeko commented Sep 17, 2024

If you don't click compile, it does work right (clicking the button and increasing the counter)?

It does, clicking the button that increases the counter works. But any attempt to recompile using Alt-Enter or clicking Compile! button fails. I see your other message explaining a possible cause.

Thanks for your attention to this matter and your great work on this library and many other valuable contributions to the Clojure landscape. Much appreciated!

@borkdude
Copy link
Member

There were two issues which are fixed/worked around in the below link:

  • Somehow my-lit didn't get munged correctly (yet to be fixed)
  • The window.customElements.define call can only happen once, so I wrapped this in a defonce

Thanks for your attention to this matter and your great work on this library and many other valuable contributions to the Clojure landscape. Much appreciated!

Good to hear, thank you!

https://squint-cljs.github.io/squint/?src=KG5zIG15bGl0CiAgKDpyZXF1aXJlIFtzcXVpbnQuY29yZSA6cmVmZXIgW2RlZmNsYXNzIGpzLXRlbXBsYXRlXV0KICAgWyJodHRwczovL2VzbS5zaC9saXRAMy4wLjAiIDphcyBsaXRdKSkKCihkZWZjbGFzcyBNeUVsZW1lbnQKICAoZXh0ZW5kcyBsaXQvTGl0RWxlbWVudCkKICAoXjpzdGF0aWMgZmllbGQgcHJvcGVydGllcyB7OmNvdW50IHt9fSkKCiAgKGNvbnN0cnVjdG9yIFt0aGlzXQogICAgKHN1cGVyKQogICAgKHNldCEgdGhpcy5jb3VudCAwKQogICAgKHNldCEgdGhpcy5uYW1lICJIZWxsbyIpKQoKICBPYmplY3QKICAocmVuZGVyIFt0aGlzXQogICAgI2h0bWwgXmxpdC9odG1sCiAgICBbOmRpdgogICAgIFs6aDEgdGhpcy5uYW1lXQogICAgIFs6YnV0dG9uIHsiQGNsaWNrIiB0aGlzLm9uQ2xpY2sKICAgICAgICAgICAgICAgOnBhcnQgImJ1dHRvbiJ9CiAgICAgICJDbGljayBjb3VudCAiIHRoaXMuY291bnRdXSkKCiAgKG9uQ2xpY2sgW3RoaXNdCiAgICAoc2V0ISB0aGlzLmNvdW50IChpbmMgdGhpcy5jb3VudCkpKSkKCihkZWZvbmNlIGZvbwogIChkbwogICAgKGpzL3dpbmRvdy5jdXN0b21FbGVtZW50cy5kZWZpbmUgIm15LWVsZW1lbnQiIE15RWxlbWVudCkKICAgIHRydWUpKQoKKGRlZiBhcHAgKG9yIChqcy9kb2N1bWVudC5xdWVyeVNlbGVjdG9yICIjYXBwIikKICAgICAgICAgICAoZG90byAoanMvZG9jdW1lbnQuY3JlYXRlRWxlbWVudCAiZGl2IikKICAgICAgICAgICAgIChzZXQhIC1pZCAiYXBwIikKICAgICAgICAgICAgIChqcy9kb2N1bWVudC5ib2R5LnByZXBlbmQpKSkpCgooc2V0ISAoLi1pbm5lckhUTUwgYXBwKSAjaHRtbCBbOmRpdgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgWzpteS1lbGVtZW50XQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI19bOm15LWVsZW1lbnRdXSk=

@lexeko
Copy link
Author

lexeko commented Sep 17, 2024

It works! Great, thank you Michiel!

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