From d01ce4e22579aff48f5b87d1809c3b91fb198642 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Str=C3=B6mberg?= Date: Thu, 18 Sep 2025 12:30:07 +0200 Subject: [PATCH] Add docs to `api/get-runtime!` warning about use at the REPL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I tried `(api/get-runtime!)` at the REPL a few times and wondered why it never returned anything. Then saw a note on some other function about REPL-usage. Then heard the fans on my M4 Mac for the first time ever. 😀 The note I add to the docs here would have helped me avoid trying the bare call at the REPL. --- src/main/shadow/cljs/devtools/api.clj | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/shadow/cljs/devtools/api.clj b/src/main/shadow/cljs/devtools/api.clj index 1fce51558..985747656 100644 --- a/src/main/shadow/cljs/devtools/api.clj +++ b/src/main/shadow/cljs/devtools/api.clj @@ -99,7 +99,12 @@ (keys) (into #{}))) -(defn get-runtime! [] +(defn get-runtime! + "NB: The runtime object is too huge to print at the REPL. + * (api/get-runtime!) ; => will blow your REPL up + * (:config (api/get-runtime!)) ; => works just fine + * (:supervisor (api/get-runtime!)) ; => also blows the REPL up" + [] (runtime/get-instance!)) (defn- get-or-start-worker [build-config opts] @@ -690,4 +695,4 @@ (swap! results-ref update :out str text)) }) - @results-ref))) \ No newline at end of file + @results-ref)))