Skip to content

Commit

Permalink
10x devtool support removed.
Browse files Browse the repository at this point in the history
  • Loading branch information
awb99 committed Sep 18, 2024
1 parent 4fbf794 commit 75f345f
Show file tree
Hide file tree
Showing 15 changed files with 44 additions and 61 deletions.
10 changes: 0 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,12 @@ A simple demo is on [Webly Github Pages](https://pink-gorilla.github.io/webly/)

# features

## 10x / tracing
- are included in watch / compile
- keybinding [alt+g t] to open 10x console
- touse trace-fn see:
- https://github.com/day8/re-frame-debux is included in watch profile
- frontend.notifications.events
- select :notification/add in tenx dev console


## web app
- dynamically generated app html that works with csrf
- ring middleware for api calls
- routing with bidi (this allows to have links within the web-app)
- this means a registry for ring-handlers and reagent-views


## webly build
- this feature is available for apps that use webly
- compiles/watches via shadow-cljs
Expand Down
8 changes: 3 additions & 5 deletions demo/deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,15 @@
; 2. run unit tests

; BUILD BUNDLE (then exit)
:webly {:extra-deps {org.pinkgorilla/ui-repl {:mvn/version "0.1.105"} ; http cors test
:webly {:extra-deps {org.pinkgorilla/ui-repl {:mvn/version "0.1.108"} ; http cors test
}
:extra-paths ["src" "resources" "test" "test/resources"]
:exec-fn webly.app.app/webly-build
:exec-args {:config ["demo.edn"
;"creds-localhost.edn"
"/home/florian/repo/myLinux/myvault/trateg/creds.edn"] ; does not get used!
:exec-args {:config ["demo.edn"]
:profile "npm-install"}}

:npm-install {:exec-args {:profile "npm-install"}}
:compile {:exec-args {:profile "compile2"}}
:compile {:exec-args {:profile "compile"}}
:release {:exec-args {:profile "release"}}
:release-adv {:exec-args {:profile "release-adv"}}
:static {:exec-args {:profile "static"}}
Expand Down
12 changes: 5 additions & 7 deletions demo/resources/demo.edn
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,15 @@
; shift, ctrl, alt, win, cmd, defmod, "left" "right"
; "meta-shift-l" "alt-shift-p" "ctrl-shift-left" "ctrl-shift-right"
{:kb "esc" :handler [:modal/close] :desc "Dialog Close"} ; for ALL dialogs!
{:kb "alt-g t" :handler [:reframe10x-toggle] :desc "10x visibility toggle"}

{:kb "alt-g k" :handler [:palette/show] :desc "Keybindings dialog"}
{:kb "ctrl-g k" :handler [:palette/show] :desc "Keybindings dialog"}
{:kb "win-g k" :handler [:palette/show] :desc "Keybindings dialog"}

{:kb "alt-g 1" :handler [:bidi/goto 'demo.page.main/main-page] :desc "goto main"}
{:kb "alt-g 2" :handler [:bidi/goto :demo/party :location "Vienna"] :desc "goto party vienna"}
{:kb "alt-g 3" :handler [:bidi/goto :demo/help] :desc "goto help"}
{:kb "alt-g 4" :handler [:bidi/goto 'demo.page.job/job-page] :desc "goto job"}
{:kb "alt-g 5" :handler [:bidi/goto :demo/party :location "Bali" :query-params {:expected-guests 299}] :desc "goto party bali"}
{:kb "alt-g 1" :handler [:bidi/goto demo.page.main/main-page] :desc "goto main"}
{:kb "alt-g 2" :handler [:bidi/goto demo.page.party/party-page :location "Vienna"] :desc "goto party vienna"}
{:kb "alt-g 3" :handler [:bidi/goto demo.page.help/help-page] :desc "goto help"}
{:kb "alt-g 4" :handler [:bidi/goto demo.page.job/job-page] :desc "goto job"}
{:kb "alt-g 5" :handler [:bidi/goto demo.page.party/party-page :location "Bali" :query-params {:expected-guests 299}] :desc "goto party bali"}
{:kb "alt-y l" :handler [:login/dialog] :desc "login"}
{:kb "ctrl-y l" :handler [:login/dialog] :desc "login"}
{:kb "win-y l" :handler [:login/dialog] :desc "login"}
Expand Down
2 changes: 1 addition & 1 deletion demo/src/demo/page/main/ws.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[taoensso.timbre :refer-macros [warn]]
[reagent.core :as r]
[re-frame.core :as rf]
[demo.helper.ui :refer [link-fn block2]]))
[demo.helper.ui :refer [block2]]))

; WEBSOCKET
(defn print-status [x]
Expand Down
1 change: 0 additions & 1 deletion demo/src/demo/test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
(:require
[extension :refer [discover write-service]]
[bidi.bidi :as bidi]

[webly.module.build :refer [create-modules shadow-module-config
create-modules
get-lazy-ns]]))
Expand Down
7 changes: 2 additions & 5 deletions spa/deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,8 @@
; frontend
reagent/reagent {:mvn/version "1.1.1"} ; https://github.com/reagent-project/reagent
re-frame/re-frame {:mvn/version "1.2.0"}
cljs-ajax/cljs-ajax {:mvn/version "0.8.4"} ; needed for re-frame/http-fx
day8.re-frame/http-fx {:mvn/version "0.2.3"} ; reframe based http requests
day8.re-frame/re-frame-10x {:mvn/version "1.1.12"} ;; https://github.com/day8/re-frame-10x
;day8.re-frame/tracing {:mvn/version "0.6.2"} ; https://github.com/day8/re-frame-debux
;{day8.re-frame/tracing-stubs "0.6.2"}
cljs-ajax/cljs-ajax {:mvn/version "0.8.4"} ; needed for re-frame/http-fx
com.cemerick/url {:mvn/version "0.1.1"} ; url query-strings
; modular
org.pinkgorilla/webserver {:mvn/version "0.0.12"} ; brings modular
Expand All @@ -22,7 +19,7 @@
org.pinkgorilla/ui-dialog-keybindings {:mvn/version "0.1.10"}
org.pinkgorilla/css-theme {:mvn/version "0.1.6"}
; devtools
org.pinkgorilla/devtools {:mvn/version "0.5.20"}
org.pinkgorilla/devtools {:mvn/version "0.5.21"}
org.pinkgorilla/ui-pprint-frisk {:mvn/version "0.6.564"}}
:aliases
{:cljfmt {:extra-deps {cljfmt/cljfmt {:mvn/version "0.9.2"}}
Expand Down
4 changes: 2 additions & 2 deletions spa/src/webly/spa.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
[webly.spa.service.ws :refer [start-ws]]
; webly
[webly.build.lazy]
[webly.spa.tenx.events]
;[webly.spa.tenx.events]
[webly.spa.views :refer [webly-app]]
[webly.spa.events] ; side effects
[webly.spa.loader.page] ; side-effects
Expand Down Expand Up @@ -91,7 +91,7 @@

(defn ^:export start [_mode]
(enable-console-print!)
(dispatch [:reframe10x-init])
;(dispatch [:reframe10x-init])
(dispatch [:webly/status :route-init])
(dispatch [:webly/status :loading-config])
(start-config)
Expand Down
5 changes: 3 additions & 2 deletions spa/src/webly/spa/html/page.clj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
[taoensso.timbre :refer [debug info error]]
[frontend.analytics.google-tag :refer [script-tag-src script-tag-config]]
[frontend.css.config :refer [css-app]]
[webly.spa.tenx.view :refer [tenx-script]]))
;[webly.spa.tenx.view :refer [tenx-script]]
))

;; CSS

Expand Down Expand Up @@ -71,7 +72,7 @@
; <meta name= "keywords" content= "keywords,here" >
[:title title]
[:link {:rel "shortcut icon" :href (str prefix icon)}]
(tenx-script)
;(tenx-script)
(body-loading-style (str prefix loading-image-url))
(script-tag-src google-analytics)
(script-tag-config google-analytics)]]
Expand Down
13 changes: 13 additions & 0 deletions src-unused/tenx/deps.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@



day8.re-frame/re-frame-10x {:mvn/version "1.1.12"} ;; https://github.com/day8/re-frame-10x


## 10x / tracing
- are included in watch / compile
- keybinding [alt+g t] to open 10x console
- touse trace-fn see:
- https://github.com/day8/re-frame-debux is included in watch profile
- frontend.notifications.events
- select :notification/add in tenx dev console
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 2 additions & 3 deletions webly/deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,15 @@
; shadow-cljs MAY NOT be a dependency in lein deps :tree -> if so, bundler
; will fail because shadow contains core.async which is not compatible with
; self hosted clojurescript
thheller/shadow-cljs {:mvn/version "2.24.1"} ; 2.17.4
thheller/shadow-cljs {:mvn/version "2.24.1"}
;:exclusions [org.clojure/tools.reader] ; outdated
;{thheller/shadow-cljsjs "0.0.21"} ; already referred to from shadow-cljs
;org.clojure/clojurescript {:mvn/version "1.10.879"} ; already referred from shadow-cljs

luminus/ring-undertow-adapter {:mvn/version "1.3.1"}
; modular
org.pinkgorilla/timbre {:mvn/version "0.0.7"}
org.pinkgorilla/extension {:mvn/version "0.0.12"}
;org.pinkgorilla/permission {:mvn/version "0.2.19"}
org.pinkgorilla/extension {:mvn/version "0.0.13"} ; brings modular
org.pinkgorilla/webserver {:mvn/version "0.0.12"} ; brings modular
org.pinkgorilla/websocket {:mvn/version "0.0.18"}
org.pinkgorilla/spa {:local/root "../spa" :deps/manifest :deps}}
Expand Down
26 changes: 7 additions & 19 deletions webly/src/webly/build/profile.clj
Original file line number Diff line number Diff line change
Expand Up @@ -4,57 +4,45 @@
[webly.build.prefs :refer [prefs-atom]]))

(defonce profiles
{:ci {:prefs {:tenx false}
{:ci {:prefs {}
:bundle {:shadow-verbose false
:cljs-build :ci
:shadow-mode :release
:size-report false}}

:static {:static? true}

:release {:prefs {:tenx false}
:release {:prefs {}
:bundle {:shadow-verbose false
:cljs-build :webly
:shadow-mode :release ; production build - no source maps
:size-report true}}

:release-adv {:prefs {:tenx false}
:release-adv {:prefs {}
:bundle {:shadow-verbose false
:cljs-build :webly
:shadow-mode :release ; production build - no source maps
:advanced true
:size-report true}}

:npm-install {:prefs {:tenx false}
:npm-install {:prefs {}
:bundle {:shadow-verbose false
:cljs-build :webly
:shadow-mode nil ; no build, just npm install
:size-report false
:npm-install true}}

:compile {:prefs {:tenx true}
:compile {:prefs {}
:bundle {:shadow-verbose false
:cljs-build :webly
:shadow-mode :compile ; compile has source maps
:size-report false}}

:compile2 {:prefs {:tenx false}
:bundle {:shadow-verbose false
:cljs-build :webly
:shadow-mode :compile ; compile has source maps
:size-report false}}

:watch {:prefs {:tenx true}
:watch {:prefs {}
:bundle {:shadow-verbose true
:cljs-build :webly
:shadow-mode :watch
:size-report false}}

:watch2 {:prefs {:tenx false}
:bundle {:shadow-verbose true
:cljs-build :webly
:shadow-mode :watch
:size-report false}}})
:size-report false}}})

(defn str->profile [profile-str]
(let [p (keyword profile-str)]
Expand Down
12 changes: 6 additions & 6 deletions webly/src/webly/build/shadow_config.clj
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
[webly.module.build :refer [create-modules shadow-module-config]]))

;; build-options
(defn build-ns-aliases []
(if-pref-fn :tenx
{'webly.spa.tenx.events 'webly.spa.tenx.events-on}
{'webly.spa.tenx.events 'webly.spa.tenx.events-off
#_(defn build-ns-aliases []
(if-pref-fn :tenx
{'webly.spa.tenx.events 'webly.spa.tenx.events-on}
{'webly.spa.tenx.events 'webly.spa.tenx.events-off
;'day8.re-frame.tracing 'day8.re-frame.tracing-stubs
}))
}))

;; shadow config
(defn shadow-config [exts
Expand Down Expand Up @@ -69,7 +69,7 @@
:modules shadow-modules
;:devtools {:before-load (symbol "webly.web.app/before-load")
; :after-load (symbol "webly.web.app/after-load")}
:build-options {:ns-aliases (build-ns-aliases)}
;:build-options {:ns-aliases (build-ns-aliases)}
:compiler-options {:optimizations (if advanced?
:advanced
:simple)
Expand Down

0 comments on commit 75f345f

Please sign in to comment.