Are there any example setups out there integrating HumbleUI with a Cider/cider-nrepl workflow? I've managed to start up an nrepl server from the main ns, but for example this doesn't afford the use of Cider's tooling to analyse stacktraces of exceptions thrown from the UI thread.
Do you know why? Is there a problem specific to Humble UI or it’s just the fact that they originate from another thread?
I'm not too familiar with the internals of nREPL but pretty sure it's the latter
There's probably a way to take the *e value and pass it to the relevant nrepl op, to manually simulate what would 'normally' happen with all clojure code evaluations passing through Cider's middleware
HumbleUI seems like a exciting and really promising approach, but the last couple of hours trying to take it for a spin have felt frustratingly opaque given the lack of documentation and tooling support 🫤 (of course I realise the caveats of it being pre-alpha software that dev UX probably isn't a big priority for now)
Yep, and the fact that I don’t use nREPL or Cider probably doesn’t help either
In my setup errors are just printed to console
yeah, also a lot of my errors at the start were of the fatal REPL-crashing kind, I think due to wrong types of arguments being passed to functions, eg.
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00000001615d6be0, pid=22112, tid=259
#
# JRE version: OpenJDK Runtime Environment Temurin-21.0.2+13 (21.0.2+13) (build 21.0.2+13-LTS)
# Java VM: OpenJDK 64-Bit Server VM Temurin-21.0.2+13 (21.0.2+13-LTS, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-aarch64)
# Problematic frame:
# C [libskija.dylib+0x12be0] Java_io_github_humbleui_skija_TextLine__1nGetTextBlob+0x0
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#not sure if these can be made recoverable
Yeah, no, this is unrecoverable. I should put more checks before interfacing with Skia. Basically this is simple null pointer but because it was passed to native it unrecoverably died
As a concrete example for feedback, I spent a good chunk of time trial-and-error debugging these fatal crashes just trying to write a minimal "Hello world" from the ground up ... it turned out that I hadn't wrapped the overall UI in default-theme, I guess causing the crash due to uninitialized attributes.
Yeah, that’s a common gotcha. Will think what to do with it
Another nit related to dev tooling - the import-vars macro adds a lot of friction jumping to the implementation of any of the core API functions from their call sites - something I often did when trying to understand them due to lack of docstrings
Interesting, thanks!
btw Potemkin's version of import-vars works out of the box, Cider tooling reports and jumps straight to the original definition
Also interesting
also poked around in the vdom branch where it seems to use even more unconventional way of splitting up the ns into multiple files - clj-kondo's static analysis doesn't recognize any of this and throws up a bunch of linting errors