Was trying to run the lit html example with latest version of squint and I am seeing "ReferenceError: squint_html is not defined"
is it possible to copy/paste that code here? https://squint-cljs.github.io/squint/ and then hit the share button and then copy paste that link here? I can take a look tomorrow
oh I see, your link failed in the same way, so not even a REPL problem
Is there a way to do the import manually?
thanks!
interestingly the reactive lit property count is no longer reactive in the above link
yeah I noticed
not sure what's up
is it possible to make a github issue? I'm going to bed soon
well I do know in lit having count = 0 is an anti-pattern
you set default value in constructor
good point
github issues please, afk now
Basically remove the field declarations and instantiate in the constructor is the lit approach. This does mean you have use (.-field this) style accessors though
My point is that if you use (field) the properties are no longer reactive.
Hmm, you had a link up here 3 hours or so ago which worked. But I can't see it anymore :(
@shaunxcode Ah this is a working example:
https://squint-cljs.github.io/squint/?src=KG5zIG15ZWxlbWVudAogICg6cmVxdWlyZSBbc3F1aW50LmNvcmUgOnJlZmVyIFtkZWZjbGFzcyBqcy10ZW1wbGF0ZV1dCiAgIFsiaHR0cHM6Ly9lc20uc2gvbGl0QDMuMC4wIiA6YXMgbGl0XSkpCgooZGVmY2xhc3MgTXlFbGVtZW50CiAgKGV4dGVuZHMgbGl0L0xpdEVsZW1lbnQpCiAgKF46c3RhdGljIGZpZWxkIHByb3BlcnRpZXMgezpjb3VudCB7fX0pCgogIChjb25zdHJ1Y3RvciBbdGhpc10KICAgIChzdXBlcikKICAgIChzZXQhIHRoaXMuY291bnQgMCkKICAgIChzZXQhIHRoaXMubmFtZSAiSGVsbG8iKSkKCiAgT2JqZWN0CiAgKHJlbmRlciBbdGhpc10KICAgICNodG1sIF5saXQvaHRtbAogICAgWzpkaXYKICAgICBbOmgxIHRoaXMubmFtZV0KICAgICBbOmJ1dHRvbiB7IkBjbGljayIgdGhpcy5vbkNsaWNrCiAgICAgICAgICAgICAgIDpwYXJ0ICJidXR0b24ifQogICAgICAiQ2xpY2sgY291bnQgIiB0aGlzLmNvdW50XV0pCgogIChvbkNsaWNrIFt0aGlzXQogICAgKHNldCEgdGhpcy5jb3VudCAoaW5jIHRoaXMuY291bnQpKSkKICApCgooanMvd2luZG93LmN1c3RvbUVsZW1lbnRzLmRlZmluZSAibXktZWxlbWVudCIgTXlFbGVtZW50KQoKKGRlZiBhcHAgKG9yIChqcy9kb2N1bWVudC5xdWVyeVNlbGVjdG9yICIjYXBwIikKICAgICAgICAgICAoZG90byAoanMvZG9jdW1lbnQuY3JlYXRlRWxlbWVudCAiZGl2IikKICAgICAgICAgICAgIChzZXQhIC1pZCAiYXBwIikKICAgICAgICAgICAgIChqcy9kb2N1bWVudC5ib2R5LnByZXBlbmQpKSkpCgooc2V0ISAoLi1pbm5lckhUTUwgYXBwKSAjaHRtbCBbOmRpdgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgWzpteS1lbGVtZW50XQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgWzpteS1lbGVtZW50XV0p
So just write this.count :)
So I consider that problem solved, unless I'm missing something
nice, that works!
alright, going to have a look at fixing this now
@shaunxcode pushed a fix. this works now: https://squint-cljs.github.io/squint/?src=KG5zIG15ZWxlbWVudAogICg6cmVxdWlyZSBbc3F1aW50LmNvcmUgOnJlZmVyIFtkZWZjbGFzcyBqcy10ZW1wbGF0ZV1dCiAgIFsiaHR0cHM6Ly9lc20uc2gvbGl0IiA6YXMgbGl0XSkpCgooZGVmY2xhc3MgTXlFbGVtZW50CiAgKGV4dGVuZHMgbGl0L0xpdEVsZW1lbnQpCiAgKGZpZWxkIGNvdW50IDApCiAgKGZpZWxkIG5hbWUgIkhlbGxvIikKICAoXjpzdGF0aWMgZmllbGQgcHJvcGVydGllcyB7OmNvdW50IHt9fSkKCiAgKGNvbnN0cnVjdG9yIFtfXQogICAgKHN1cGVyKSkKCiAgT2JqZWN0CiAgKHJlbmRlciBbdGhpc10KICAgICNodG1sIF5saXQvaHRtbAogICAgWzpkaXYKICAgICBbOmgxIG5hbWVdCiAgICAgWzpidXR0b24geyJAY2xpY2siICguLW9uQ2xpY2sgdGhpcykKICAgICAgICAgICAgICAgOnBhcnQgImJ1dHRvbiJ9CiAgICAgICJDbGljayBjb3VudCAiIGNvdW50XV0pCgogIChvbkNsaWNrIFt0aGlzXQogICAgKHNldCEgY291bnQgKGluYyBjb3VudCkpCiAgICAoLnJlcXVlc3RVcGRhdGUgdGhpcykpCiAgKQoKKGpzL3dpbmRvdy5jdXN0b21FbGVtZW50cy5kZWZpbmUgIm15LWVsZW1lbnQiIE15RWxlbWVudCkKCihkZWYgYXBwIChvciAoanMvZG9jdW1lbnQucXVlcnlTZWxlY3RvciAiI2FwcCIpCiAgICAgICAgICAgKGRvdG8gKGpzL2RvY3VtZW50LmNyZWF0ZUVsZW1lbnQgImRpdiIpCiAgICAgICAgICAgICAoc2V0ISAtaWQgImFwcCIpCiAgICAgICAgICAgICAoanMvZG9jdW1lbnQuYm9keS5wcmVwZW5kKSkpKQoKKHNldCEgKC4taW5uZXJIVE1MIGFwcCkgI2h0bWwgWzpkaXYKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs6bXktZWxlbWVudF0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs6bXktZWxlbWVudF1dKQ%3D%3D
Perhaps one of the issues was that I used an unversioned lit, let me fixt that too
nice, If you don't use the (field count) stuff and do (.-count this) through out then you dont need to call requestUpdate yourself. I think an ideal solution will probably end up being a macro that wraps defclass or something to that effect.
Can you make an example which explains your point?