Skip to content

Commit

Permalink
Fix build for clojure 1.10 and 1.11
Browse files Browse the repository at this point in the history
  • Loading branch information
djblue committed May 12, 2022
1 parent ad7062e commit e66e6e6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions src/portal/extensions/vs_code.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
(set! (.-iconPath panel)
(.file vscode/Uri (.asAbsolutePath ^js @context "icon.png")))
(set! (.-html web-view)
(index/html :code-url (str "http://" host ":" port "/main.js?" session-id)
:host (str host ":" port)
:session-id (str session-id)))
(index/html {:code-url (str "http://" host ":" port "/main.js?" session-id)
:host (str host ":" port)
:session-id (str session-id)}))
(.onDidReceiveMessage
web-view
(fn handle-message [^js message]
Expand Down
10 changes: 5 additions & 5 deletions src/portal/runtime/index.cljc
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
(ns ^:no-doc portal.runtime.index)

(defn html [& {:keys [name version host session-id code-url platform mode]
:or {name "portal"
version "0.25.0"
code-url "main.js"
platform #?(:bb "bb" :clj "jvm" :cljs "node")}}]
(defn html [{:keys [name version host session-id code-url platform mode]
:or {name "portal"
version "0.25.0"
code-url "main.js"
platform #?(:bb "bb" :clj "jvm" :cljs "node")}}]
(str
"<!DOCTYPE html>"
"<html lang=\"en\">"
Expand Down
4 changes: 2 additions & 2 deletions src/portal/runtime/node/server.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@
(.writeHead 200 #js {"Content-Type" content-type})
(.end body)))

(defmethod route [:get "/"] [_req res]
(send-resource res "text/html" (index/html)))
(defmethod route [:get "/"] [req res]
(send-resource res "text/html" (index/html (-> req get-session :options))))

(defmethod route [:get "/icon.svg"] [_req res]
(send-resource
Expand Down
4 changes: 2 additions & 2 deletions src/portal/runtime/web/launcher.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@

(defn open [options]
(swap! rt/sessions assoc-in [(:session-id c/session) :options] options)
(let [url (str->src (index/html :code-url (main-js options)
:platform "web")
(let [url (str->src (index/html {:code-url (main-js options)
:platform "web"})
"text/html")
child (js/window.open
url
Expand Down

0 comments on commit e66e6e6

Please sign in to comment.