Skip to content

Commit

Permalink
reduce diff
Browse files Browse the repository at this point in the history
  • Loading branch information
borkdude committed Nov 11, 2024
1 parent 21e2729 commit e2b165e
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion shadow-cljs.edn
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
:dev-http {7778 {:roots ["public" "classpath:public"]}}
:nrepl false
:builds {:viewer {:target :esm
:runtime :custom #_:browser ;; `:custom` needed when developing ssr, will see WebSocket errors without it
:runtime :browser ;; `:custom` needed when developing ssr, will see WebSocket errors without it
:output-dir "public/js"
:release {:output-dir "build/"}
:compiler-options {:source-map true}
Expand Down
1 change: 0 additions & 1 deletion src/nextjournal/clerk/builder.clj
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@
(fs/create-dirs (fs/parent out-html))
(spit (fs/file out-path (str (or (not-empty path) "index") ".edn"))
(viewer/->edn doc))
(prn :p path)
(spit out-html (view/->html (-> static-app-opts
(assoc :current-path path)
(cond-> ssr? ssr!)
Expand Down
2 changes: 1 addition & 1 deletion src/nextjournal/clerk/render.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@

(defn ^:export set-state! [{:as state :keys [doc effects]}]
(run-effects! effects)
(when doc
(when (contains? state :doc)
(when (exists? js/window)
;; TODO: can we restore the scroll position when navigating back?
(.scrollTo js/window #js {:top 0}))
Expand Down
3 changes: 2 additions & 1 deletion src/nextjournal/clerk/sci_env.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
[applied-science.js-interop :as j]
[cljs.math]
[cljs.reader]
[cljs.repl]
[clojure.string :as str]
[edamame.core :as edamame]
[goog.object]
Expand Down Expand Up @@ -177,7 +178,7 @@
'clojure.repl {'pst pst-stub}}
(sci-copy-nss
'cljs.math
#_'cljs.repl
'cljs.repl
'nextjournal.clerk.parser
'nextjournal.clerk.render
'nextjournal.clerk.render.code
Expand Down
13 changes: 6 additions & 7 deletions ui_tests/ssr.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
Use this to iterate on it, then make sure the advanced bundle works
in Graal via `nextjournal.clerk.ssr`."
(:require
["./../public/js/viewer.js?q=3" :as viewer]
;; the above is the dev build, the one below the relase (generate it via `bb release:js`)
#_["./../build/viewer.js" :as viewer]
[babashka.cli :as cli]
[promesa.core :as p]
[nbb.core :refer [slurp]]))
(:require ["./../public/js/viewer.js" :as viewer]
;; the above is the dev build, the one below the relase (generate it via `bb release:js`)
#_["./../build/viewer.js" :as viewer]
[babashka.cli :as cli]
[promesa.core :as p]
[nbb.core :refer [slurp]]))

(defn -main [& args]
(p/let [{:keys [file edn url]} (:opts (cli/parse-args args {:alias {:u :url :f :file}}))
Expand Down
1 change: 0 additions & 1 deletion ui_tests/ssr.mjs

This file was deleted.

0 comments on commit e2b165e

Please sign in to comment.