Skip to content

Commit

Permalink
Make recompute! no-op for cljs, fixing assertion error on reload
Browse files Browse the repository at this point in the history
  • Loading branch information
mk committed Oct 7, 2024
1 parent 955f3dc commit 857a30a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/nextjournal/clerk.clj
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,11 @@
(defn recompute!
"Recomputes the currently visible doc, without parsing it."
[]
(binding [*ns* (:ns @webserver/!doc)]
(let [{:keys [result time-ms]} (eval/time-ms (eval/eval-analyzed-doc @webserver/!doc))]
(println (str "Clerk recomputed '" @!last-file "' in " time-ms "ms."))
(webserver/update-doc! result))))
(when-not (eval/cljs? @webserver/!doc)
(binding [*ns* (:ns @webserver/!doc)]
(let [{:keys [result time-ms]} (eval/time-ms (eval/eval-analyzed-doc @webserver/!doc))]
(println (str "Clerk recomputed '" @!last-file "' in " time-ms "ms."))
(webserver/update-doc! result)))))

#_(recompute!)

Expand Down

0 comments on commit 857a30a

Please sign in to comment.