From d414f598f83a9c509b5797c7ef89197e36d4e9e9 Mon Sep 17 00:00:00 2001 From: jeff Date: Thu, 20 Aug 2020 20:39:42 -0400 Subject: [PATCH] fix(electron): some but not all warnings gone (#345) --- .github/workflows/build.yml | 2 +- package.json | 2 +- shadow-cljs.edn | 3 ++- src/cljs/athens/listeners.cljs | 4 ++-- src/cljs/athens/main/core.cljs | 9 ++++++--- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 60ffe4c4b2..d2bcc22c5b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -144,6 +144,7 @@ jobs: # publish_dir: ./resources/public dist: + if: github.event_name == 'push' runs-on: ${{ matrix.os }} env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} @@ -211,5 +212,4 @@ jobs: # If the commit is tagged with a version (e.g. "v1.0.0"), # release the app after building release: ${{ startsWith(github.ref, 'refs/tags/v') }} - args: "-p always" diff --git a/package.json b/package.json index a4f8de59bf..ccd7bd6637 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "athens", "author": "athensresearch", - "version": "1.0.0-beta.2", + "version": "1.0.0-beta.3", "description": "Open-Source Networked Thought", "main": "resources/main.js", "build": { diff --git a/shadow-cljs.edn b/shadow-cljs.edn index d5fb4bcb8a..ecff0a5450 100644 --- a/shadow-cljs.edn +++ b/shadow-cljs.edn @@ -27,10 +27,11 @@ :modules {:renderer {:init-fn athens.core/init}} :compiler-options {:closure-warnings {:global-this :off} + :infer-externs :auto :closure-defines {re-frame.trace.trace-enabled? true}} :devtools {:preloads [devtools.preload - day8.re-frame.trace.preload]}} + day8.re-frame-10x.preload]}} :main {:target :node-script :output-to "resources/main.js" diff --git a/src/cljs/athens/listeners.cljs b/src/cljs/athens/listeners.cljs index 5e18d9f1b1..4317a407aa 100644 --- a/src/cljs/athens/listeners.cljs +++ b/src/cljs/athens/listeners.cljs @@ -145,7 +145,7 @@ (defn copy "If blocks are selected, copy blocks as markdown list." - [e] + [^js e] (let [blocks @(subscribe [:selected/items])] (when (not-empty blocks) (.. e preventDefault) @@ -155,7 +155,7 @@ ;; do same as copy AND delete selected blocks (defn cut - [e] + [^js e] (let [blocks @(subscribe [:selected/items])] (when (not-empty blocks) (.. e preventDefault) diff --git a/src/cljs/athens/main/core.cljs b/src/cljs/athens/main/core.cljs index 284950d65e..fd99db420b 100644 --- a/src/cljs/athens/main/core.cljs +++ b/src/cljs/athens/main/core.cljs @@ -19,7 +19,7 @@ (defn send-status-to-window [text] (.. log (info text)) - (.. @main-window -webContents (send text))) + (.. ^js @main-window -webContents (send text))) (defn init-browser @@ -28,11 +28,14 @@ (clj->js {:width 800 :height 600 :autoHideMenuBar true + :enableRemoteModule true :webPreferences {:nodeIntegration true + :worldSafeExecuteJavaScript true + :enableRemoteModule true :nodeIntegrationWorker true}}))) ; Path is relative to the compiled js file (main.js in our case) - (.loadURL @main-window (str "file://" js/__dirname "/public/index.html")) - (.on @main-window "closed" #(reset! main-window nil))) + (.loadURL ^js @main-window (str "file://" js/__dirname "/public/index.html")) + (.on ^js @main-window "closed" #(reset! main-window nil))) (defn init-updater