-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
Truss aliases fail in CLJS #64
Comments
@p-himik Hi Eugene, thanks for pinging about this! I've unfortunately been unable to reproduce the problem you're seeing.
Thanks! |
Ah, I completely misread the code, sorry. I can't reproduce it with just CLJS itself as well, but it's reproducible with shadow-cljs: https://github.com/p-himik/ptaoussanis-encore-issues-64 I've asked Thomas about it. |
No worries at all, it's good to know if there's a potential issue. I'm not so familiar with shadow-cljs, so let's see what Thomas says - otherwise I'll try debug using your example project. Will make sure we arrive at some solution 👍 Cheers! :-) |
@p-himik your assessment is correct. Macros do not exist in CLJS, and this is the problem here. The difference here is that I consider this an error, as it will produce invalid code that cannot ever be actually used. And in this case will even give you a callable @ptaoussanis also as an aside the CLJS variant of |
@thheller Thanks for the insight Thomas, that's super helpful!
This is really interesting. I'd never actually looked into this, and had just presumed that
I appreciate the feedback on this! I've actually never been happy with the Do you happen to have any idea off-hand if there'd be some way to do this successfully? In the meantime, I'll definitely proceed with your suggested improvements - cheers! |
@p-himik Hi Eugene, I just pushed Thanks again for pinging about this, and apologies for the trouble! |
That seems to work just fine, thanks! And it was no trouble at all. |
Metadata on vars doesn't really exist in the CLJS/JS runtime. It is only kept in the cljs.analyzer metadata "map". So, technically you can copy it out of there and copy it to the new var.
Something like that should do the trick. Although you may wanna add conditional requires or something, so you don't introduce a hard dependency on CLJS when using CLJ. Given the limited usefulness of metadata in CLJS in the first place I doubt this is all worth it? |
Thanks a lot for the example Thomas, that was very helpful! Cheers :-) |
The commit 6d7d7af attempts to introduce some aliases in CLJS. However, those don't allow for the CLJS code to be built:
I suspect the reason is that in compiled CLJS, macros don't exist. They exist only in self-hosted CLJS. So you can't reference
taoensso.truss/have
or any other macro like that.The text was updated successfully, but these errors were encountered: