-
Notifications
You must be signed in to change notification settings - Fork 85
Conversation
That doesn't make sense to me, but I just pushed an update to CLJS. can you rebase on current master to see if that fixes it? |
67dca47
to
1e37412
Compare
A test still does not pass:
Probably |
d337330
to
ce71a64
Compare
src/cljs/snapshot/lumo/repl.cljs
Outdated
(if-not (:macro var) | ||
(:arglists var) | ||
;; filtering &env &form for macros | ||
(map #(filterv (complement '#{&env &form}) %) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to do this because apparently in the real repl that symbols have &env and `&form as arglists, while in the tests they don't. I know that I fixed a symptom and I haven't investigated the cause but hopefully we'll figure it out at some point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For reference on this, I opened CLJS-1958, but it is probably better to have it here, not upstream I guess (see comment).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After convo on Slack, this solution will be implemented instead of this ugly hack.
test/lumo/repl_tests.cljs
Outdated
(is (= (lumo/get-arglists "cljs.core/map") '([f] [f coll] [f c1 c2] [f c1 c2 c3] [f c1 c2 c3 & colls]))) | ||
(is (= (lumo/get-arglists "map") '([f] [f coll] [f c1 c2] [f c1 c2 c3] [f c1 c2 c3 & colls]))) | ||
(is (= (lumo/get-arglists "clojure.core/when") '([test & body]))) | ||
;; (is (= (lumo/get-arglists "when") '([test & body]))) ;; cannot test it calling lumo.repl/init works in tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just so that I don't forget, the problem here was that we don't have this key for when
in the compiler env unless we are able to load the compiler cache (call to lumo.repl/init
). We cannot load the compiler cache because lumo.repl/init
triggers a $$LUMO_GLOBALS.load is not a function
.
I fixed this with the approach in |
@arichiardi I don't see those changes. Did you forget to push? |
No but soon I will (push not forget 😀) |
So one thing you can do is just call |
Probably for this unit test yes, I was wondering if more broadly it is worth just setting the load from the hardcoded path to the cache...Generated in a fixture and dumped in a temp folder...Probably a way bigger task but worth doing at some point. |
Sure but we don't wanna do that for now. Seems like a too big cost for very little benefit |
Agree |
Finally ready for review! I ended up implementing the full analysis cache load because it was relatively straight forward. I am looking forward to your comments 👍 |
a4c89c3
to
86da71e
Compare
.gitignore
Outdated
lumo-cache/ | ||
third_party/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not needed anymore, better to keep the diff clean and not touch this file
test/lumo/test_util.cljs
Outdated
(catch :default e nil))) | ||
|
||
(def cljs-core-cache-path "generated_test_suite.out/cljs/core.cljs.cache.json") | ||
(def cljs-core-macros-cache-path "generated_test_suite.out/cljs/core$macros.cljc.cache.json") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not a big deal, but this is relying on implementation details of boot-cljs-test
which is subject to change. Can we add an explicit ids
option to the test
task in build.boot
? Something like :ids #{"test_out"}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes we can, but the path will always be hardcoded anyways right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes but at least we have control over its name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure will do
This patch adds a :once fixture which loads the analysis cache for `cljs.core` so that it will be easier to test features that need macro ast data to be loaded.
(catch :default e nil))) | ||
|
||
;; For the cache source folder, the test id needs to become: | ||
;; lumo_test/test_suite => test_suite.out/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
put a comment in there
Hi Antonio, I added this utility function because
inf-clojure
needs it.Oddily, the tests are not working on my machine, but the same in the
yarn dev
repl works:I could not figure out why, but
lumo.repl/resolve-var
calls tocljs.analyzer
both fail with#object[Error Error: No protocol method IDeref.-deref defined for type null: ]
. Again, this happenes only inboot test
, maybe it is running with another version of ClojureScript.In any case, I'll be waiting for your comments 😉