This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-10-13
Channels
- # announcements (1)
- # babashka (30)
- # beginners (43)
- # biff (24)
- # calva (72)
- # cider (12)
- # clj-commons (24)
- # clj-on-windows (10)
- # cljsrn (23)
- # clojure (123)
- # clojure-bay-area (6)
- # clojure-europe (43)
- # clojure-losangeles (2)
- # clojure-nl (2)
- # clojure-uk (9)
- # clojurescript (125)
- # core-async (9)
- # cursive (2)
- # data-science (3)
- # datomic (30)
- # devops (1)
- # emacs (13)
- # events (5)
- # fulcro (15)
- # graalvm (3)
- # gratitude (1)
- # humbleui (11)
- # lsp (5)
- # nbb (24)
- # off-topic (11)
- # pedestal (5)
- # releases (1)
- # remote-jobs (1)
- # sci (15)
- # scittle (16)
- # shadow-cljs (15)
- # sql (11)
- # tools-deps (9)
- # xtdb (5)
Morning. I suspect the following promesa
snippet isn't right?
(p/done? (p/rejected (ex-info "test" {})))
;; => No protocol method IState.-pending? defined for type object: [object Promise]
Filed #118
(meant one thread down 😆 )
cljs.user=> (p/done? (p/delay 100))
Execution error (Error) at (<cljs repl>:1).
No protocol method IState.-pending? defined for type object: [object Promise]
Perhaps file an issue with promesaThanks for checking.
(defun cider--check-cljs (&optional cljs-type no-error)
"Verify that all cljs requirements are met for CLJS-TYPE connection.
Return REPL-TYPE of requirement are met, and throw an 'user-error' otherwise.
When NO-ERROR is non-nil, don't throw an error, issue a message and return
nil."
(if t
(condition-case ex
(progn
(cider-verify-clojurescript-is-present)
(cider-verify-cljs-repl-requirements cljs-type))
(error
(message "Invalid ClojureScript dependency: %S" ex)
nil))
(cider-verify-clojurescript-is-present)
(cider-verify-cljs-repl-requirements cljs-type)))
I can make a quick hack with this function, be ok with cljs.core not being there and i get a nice nbb replWell, this does work: cljs.core/inc
in all of those environments. What exactly does CIDER execute?
(defun cider-verify-clojurescript-is-present ()
"Check whether ClojureScript is present."
(unless (cider-library-present-p "cljs.core")
(user-error "ClojureScript is not available. See for details")))
checks "cljs.core"Perhaps you can convince CIDER to change this into cljs.core/inc
which does work for SCI CLJS environments
In JVM Clojure you can't just type clojure.core
and expect a result, so this isn't implemented. It seems more an artifact than a supported feature in CLJS
you know what is funny? I think the only issue is that most repls return "nil" and nbb returns nil
when evaling a require
function call
for completeness, here is my cider proposal https://github.com/clojure-emacs/cider/issues/3255
@U02CV2P4J6S really appreciate your efforts here, would love to see the default experience improve here, thank you! 🙏
turns out I needed to workaround a little more. This elisp should work, should somebody desire a jack-in-nbb command right now: https://benjamin-asdf.github.io/faster-than-light-memes/jacking-nbb.html
@U02CV2P4J6S Cool, worth sharing here in the main channel. I'll also link it from nbb's README
(defun mm/cider-connected-hook ()
(when (eq 'nbb-or-scittle-or-joyride cider-cljs-repl-type)
(setq-local cider-show-error-buffer nil)
(cider-set-repl-type 'cljs)))
(add-hook 'cider-connected-hook #'mm/cider-connected-hook)
(defun mm/cider-jack-in-nbb ()
(interactive)
(cider-jack-in-cljs
'(:jack-in-cmd
"nbb nrepl-server"
:cljs-repl-type
nbb-or-scittle-or-joyride)))
because this kinda works good. Except that cider checks for cljs.core lib and throws an error.