Hey @moxaj
I’ve deployed a fix to clojure.spec just now
Please make sure you get klipse version 6.6.2
@viebel hey
I've eliminated all ^:const
metadata temporarily
but now the repl pretty much freezes when I tried to load my ns 😕
Freezes forever?
it seems so
😢
I've been waiting for minutes in both a chrome and an edge tab
Nothing printed in the console?
only 404 GET
requests
after the initial klipse related stuff
Try to add verbose=1 url param
also, the timing on those requests is strange:
Can u send me the url for your code in klipse repl?
this just in:
this is my url: http://app.klipse.tech/?external-libs=[https://raw.githubusercontent.com/moxaj/mikron/master/src/cljc]&verbose=1
If you press ctr-s you will get a url that contains your source code
(the error you got is ok. No clojure. Spec but cljs.spec The compiler tries clojure.spec and then cljs.spec)
meh, cannot copy from the alert
this is all I enter: (ns mikron.codox (:require [clojure.core]))
oh
mikron.core
i'll edit
I think it is also on the console
And also you can do ctrl-r
Thx
wait, still requires clojure.core
edited my link
There is an infinite loop
Loading mikron.compile-util macros namespace
Any idea why?
I think that this is the problem
(ns mikron.compile-util
"Compile time utility functions."
#?(:cljs (:require-macros [mikron.compile-util])))
oh well, didn't know that fails on self hosted 😮
In self-host cljs, reader conditionals always branch to :cljs
I think regular cljs will use that branch as well
No
because when you require-macros
in regular cljs, it will branch to :clj
but the require-macros
is inside the reader conditional
when the reader selects the branch, I don't think it cares what's inside of it
You’re right
What I meant is a bit different
but still YOU are right, since apparently this does not work in self hosted
1. (require mikron.compile-util) => loads the code with :cljs branch
2. in the :cljs branch there is a (:require-macros [mikron.compile-util])
3. (:require-macros [mikron.compile-util]) => loads the code with :clj branch in regular clojure and :cljs branch in self-host
makes sense?
yeah, it seems like a circular dep, but it works in regular cljs
because require-macros in regular cljs takes the :clj branch
I guess that makes an entry for your list of differences
between regular and self hosted
You’re welcome to add it
🙂
I think that the simples solution is to use a namespace with a slighly different name for the macros
something like mikron.compile-util.macros
and put it in a .clj
file with no reader conditionals
This is the trick that is done in cljs.spec
and cljs.core.async
I think
And also this might help: https://github.com/cgrand/macrovich
(Actually there is a word about it in the wiki page: https://github.com/viebel/klipse/wiki/How-to-make-a-clojure-library-self-host-compatible#reader-conditionals
But I agree with you that should be more emphasized
Feel free to edit the wiki page to make it 100% clear
updated the page, take a look
Thx
I would even say explicitely that it will cause an infinite loop
alright
also, another option would be to use :require-macros
and ditch this trick
what do u mean?
if I remove the self-`require-macros` and use require-macros
explicitly in the dependent namespaces, it would work
that sounds like a good idea
I already have a few separate -macro
namespaces, but that's only for the case when I'd like to use a macro in the same namespace (which I cannot do)
@viebel let me ask, does klipse use lumo
< 1.1
or clojurescript < 1.9.456
for the compilation?
klipse uses lumo 1.1.0
for generating the analysis cache
at least this is how it is supposed to be
but maybe a couple of namespaces have not been properly recompiled
when I upgraded lumo
Why are u asking this question?
just had a discussion in the cljs channel
turns out the self-require trick works after all
but it failed for me with lumo < 1.1
so now i'll load my project in lumo, and if it works, then you are probably using outdated deps
if it doesn't work, then I screwed up somewhere else 😄
I cannot wait...
But I have to go to sleep now
Feel free to write all your discoveries in this channel
alright, I hope i'm not bothering you too much
I’ll read them - with pleasure - when I wake up
Not at all @moxaj
I’m really happy that you don’t give up on the way to make your (cool) lib self-host compatible
When you’ll be done you will be very happy
@viebel it works!