Related: Fastly's Cloud Workers are essentially just JS WebWorkers, with lots of tenants on different isolates in the same JS VM
:import
from ns
do not load cljc
files
Is it a know issue?
;; should work, once it was required first
;; clj -Srepro -Sdeps '{:deps {import-bug {:git/url "<https://gist.github.com/souenzzo/e23944fac595077f372aa662cde5ff91>" :sha "fd49010c7fee88bc3fb705d5fd494718bbd16f18"}}}' -m ok
;; should fail, once import will not search for cljc files
;; clj -Srepro -Sdeps '{:deps {import-bug {:git/url "<https://gist.github.com/souenzzo/e23944fac595077f372aa662cde5ff91>" :sha "fd49010c7fee88bc3fb705d5fd494718bbd16f18"}}}' -m fail
https://gist.github.com/souenzzo/e23944fac595077f372aa662cde5ff91@souenzzo Wouldn't it need to have :load-ns true
on defrecord
for the import to auto-load the namespace?
load-ns?
(doc defrecord)
Supported options:
:load-ns - if true, importing the record class will cause the
namespace in which the record was defined to be loaded.
Defaults to false.
https://gist.github.com/souenzzo/e23944fac595077f372aa662cde5ff91/1335ce6ddafcce916c9a081ecf55c956ceb62645
Trying with this rev, I still fails
clj -Srepro -Sdeps '{:deps {import-bug {:git/url "<https://gist.github.com/souenzzo/e23944fac595077f372aa662cde5ff91>" :sha "1335ce6ddafcce916c9a081ecf55c956ceb62645"}}}' -m fail
Not a cljc
issue
https://gist.github.com/souenzzo/e23944fac595077f372aa662cde5ff91/00c594132b228f7c223f6d9e481ed2a9b05401d8
import is for classes. you have to compile before classes exist that can be imported?
in the ok case, the require is compiling the class and loading it in the DCL so it's found in the import
if you added a compile step like: clj -e "(binding [*compile-path* \".\"] (compile 'record))"
then the fail case will work
stepping way back, why do you need to import in the first place?
Hmm, sounds like :load-ns
doesn't do quite what I thought then (I haven't used it -- I always just require the namespaces containing records).
it's really designed for the case where you are loading a Clojure record from Java
and you already have aot'ed
Gotcha!
In case anyone happens to notice and wonders, I am actively working on moving the last useful vestiges of the old dev wiki https://dev.clojure.org/display/community to either http://clojure.org or some kind of archive (still TBD for the design pages) and I'm planning to fully decommission the old site. This ancient version of Confluence has become an active attack vector for this box.
Additionally, I am working on migrating jira to a modern cloud instance of jira. Lot of tbds still but it's in work.
Awesome! I know that's unpleasant work but I appreciate it!
it's like jabbing yourself in the eye with a stick
I assume this is in scope? https://dev.clojure.org/display/design/test.check I put some non-trivial stuff there
but it's like, a shiny stick, right? 🙂