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]lemme check
I get the same error in regular CLJS so it's not nbb-specific at least
Filed #118
(meant one thread down 😆 )
thanks
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.
the cljs.core library is not present in nbb, scittle nor joyride is that correct?
it's called clojure.core in all of those
why?
(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"1 sec
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
ah nvm. I tries to eval (require 'cljs.core)
for completeness, here is my cider proposal https://github.com/clojure-emacs/cider/issues/3255
@benjamin.schwerdtner 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
@benjamin.schwerdtner 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.