Use the bundled reagent instead of the standard one
This commit is contained in:
parent
9cfe463d02
commit
0a7de66e4d
|
@ -12,7 +12,7 @@
|
|||
[cljs.pprint :as pprint]
|
||||
[clojure.string :as str]
|
||||
[clojure.set :as set]
|
||||
[reagent.core :as r]
|
||||
[reagent.core :as real-reagent]
|
||||
[reagent.interop :refer-macros [$ $!]]
|
||||
[reagent.impl.util :as util]
|
||||
[reagent.impl.component :as component]
|
||||
|
@ -21,7 +21,8 @@
|
|||
[goog.object :as gob]
|
||||
[re-frame.interop :as interop]
|
||||
[devtools.formatters.core :as devtools]
|
||||
[mranderson047.re-frame.v0v10v2.re-frame.core :as rf]))
|
||||
[mranderson047.re-frame.v0v10v2.re-frame.core :as rf]
|
||||
[mranderson047.reagent.v0v6v0.reagent.core :as r]))
|
||||
|
||||
|
||||
;; from https://github.com/reagent-project/reagent/blob/3fd0f1b1d8f43dbf169d136f0f905030d7e093bd/src/reagent/impl/component.cljs#L274
|
||||
|
@ -73,11 +74,14 @@
|
|||
res)))))})
|
||||
|
||||
|
||||
(defonce real-custom-wrapper reagent.impl.component/custom-wrapper)
|
||||
(defonce real-next-tick reagent.impl.batching/next-tick)
|
||||
(defonce real-schedule reagent.impl.batching/schedule)
|
||||
(defonce schedule-fn-scheduled? (atom false))
|
||||
|
||||
(defn monkey-patch-reagent []
|
||||
(let [#_#_real-renderer reagent.impl.component/do-render
|
||||
real-custom-wrapper reagent.impl.component/custom-wrapper
|
||||
real-next-tick reagent.impl.batching/next-tick
|
||||
real-schedule reagent.impl.batching/schedule]
|
||||
]
|
||||
|
||||
|
||||
#_(set! reagent.impl.component/do-render
|
||||
|
@ -106,16 +110,21 @@
|
|||
|
||||
(real-custom-wrapper key f))))
|
||||
|
||||
;; When this is enabled, the rendering of the trace panel causes an infinite loop.
|
||||
#_(set! reagent.impl.batching/next-tick (fn [f]
|
||||
(real-next-tick (fn []
|
||||
(trace/with-trace {:op-type :raf}
|
||||
(f))))))
|
||||
(set! reagent.impl.batching/next-tick
|
||||
(fn [f]
|
||||
(real-next-tick (fn []
|
||||
(trace/with-trace {:op-type :raf}
|
||||
(f)
|
||||
(trace/with-trace {:op-type :raf-end}))))))
|
||||
|
||||
#_(set! reagent.impl.batching/schedule schedule
|
||||
#_(fn []
|
||||
(reagent.impl.batching/do-after-render (fn [] (trace/with-trace {:op-type :raf-end})))
|
||||
(real-schedule)))))
|
||||
#_(set! reagent.impl.batching/schedule
|
||||
(fn []
|
||||
(reagent.impl.batching/do-after-render
|
||||
(fn []
|
||||
(when @schedule-fn-scheduled?
|
||||
(trace/with-trace {:op-type :do-after-render})
|
||||
(reset! schedule-fn-scheduled? false))))
|
||||
(real-schedule)))))
|
||||
|
||||
|
||||
(defn init-tracing!
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
(ns day8.re-frame.trace.events
|
||||
(:require [mranderson047.re-frame.v0v10v2.re-frame.core :as rf]
|
||||
[mranderson047.reagent.v0v6v0.reagent.core :as r]
|
||||
[day8.re-frame.trace.utils.utils :as utils]
|
||||
[day8.re-frame.trace.utils.localstorage :as localstorage]
|
||||
[clojure.string :as str]
|
||||
[reagent.core :as r]
|
||||
[goog.object]
|
||||
[re-frame.db]
|
||||
[day8.re-frame.trace.view.container :as container]
|
||||
|
|
|
@ -5,5 +5,5 @@
|
|||
;; Use this namespace with the :preloads compiler option to perform the necessary setup for enabling tracing:
|
||||
;; {:compiler {:preloads [day8.re-frame.trace.preload] ...}}
|
||||
(trace/init-db!)
|
||||
(trace/init-tracing!)
|
||||
(defonce _ (trace/init-tracing!))
|
||||
(trace/inject-devtools!)
|
||||
|
|
|
@ -158,7 +158,7 @@
|
|||
[(s/& ".trace--sub-run")
|
||||
[".trace--op" {:color dark-purple}]]
|
||||
[(s/& ".trace--event")
|
||||
{:border-top [["1px" light-gray "solid"]]}
|
||||
{:border-top [["2px" common/border-line-color "solid"]]}
|
||||
[".trace--op" {:color common/event-color}]]
|
||||
[(s/& ".trace--render")
|
||||
[".trace--op" {:color dark-skyblue}]]
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
(ns day8.re-frame.trace.view.app-db
|
||||
(:require [reagent.core :as r]
|
||||
[clojure.string :as str]
|
||||
(:require [clojure.string :as str]
|
||||
[devtools.prefs]
|
||||
[devtools.formatters.core]
|
||||
[day8.re-frame.trace.view.components :as components]
|
||||
[day8.re-frame.trace.utils.re-com :as re-com]
|
||||
[mranderson047.re-frame.v0v10v2.re-frame.core :as rf]
|
||||
[mranderson047.reagent.v0v6v0.reagent.core :as r]
|
||||
[day8.re-frame.trace.utils.re-com :as rc])
|
||||
(:require-macros [day8.re-frame.trace.utils.macros :as macros]))
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
(ns day8.re-frame.trace.view.components
|
||||
(:require [reagent.core :as r]
|
||||
[clojure.string :as str]
|
||||
(:require [clojure.string :as str]
|
||||
[goog.fx.dom :as fx]
|
||||
[mranderson047.re-frame.v0v10v2.re-frame.core :as rf]
|
||||
[day8.re-frame.trace.utils.localstorage :as localstorage]
|
||||
[clojure.string :as str]
|
||||
[day8.re-frame.trace.utils.re-com :as rc])
|
||||
[day8.re-frame.trace.utils.re-com :as rc]
|
||||
[mranderson047.reagent.v0v6v0.reagent.core :as r])
|
||||
(:require-macros [day8.re-frame.trace.utils.macros :refer [with-cljs-devtools-prefs]]))
|
||||
|
||||
(defn search-input [{:keys [title placeholder on-save on-change on-stop]}]
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
[garden.core :refer [css style]]
|
||||
[garden.units :refer [px]]
|
||||
[re-frame.trace]
|
||||
[reagent.core :as r]
|
||||
[day8.re-frame.trace.utils.re-com :as rc]
|
||||
[day8.re-frame.trace.common-styles :as common]))
|
||||
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
[day8.re-frame.trace.utils.pretty-print-condensed :as pp]
|
||||
[re-frame.trace :as trace]
|
||||
[clojure.string :as str]
|
||||
[reagent.core :as r]
|
||||
[day8.re-frame.trace.utils.localstorage :as localstorage]
|
||||
[cljs.pprint :as pprint]
|
||||
[clojure.set :as set]
|
||||
[mranderson047.reagent.v0v6v0.reagent.core :as r]
|
||||
[mranderson047.re-frame.v0v10v2.re-frame.core :as rf]))
|
||||
|
||||
(defn query->fn [query]
|
||||
|
@ -95,7 +95,8 @@
|
|||
true (remove (fn [trace] (and (= :sub/create (:op-type trace))
|
||||
(get-in trace [:tags :cached?]))))
|
||||
(seq @categories) (filter (fn [trace] (when (contains? @categories (:op-type trace)) trace)))
|
||||
(seq @filter-items) (filter (apply every-pred (map query->fn @filter-items))))
|
||||
(seq @filter-items) (filter (apply every-pred (map query->fn @filter-items)))
|
||||
true (sort-by :id))
|
||||
save-query (fn [_]
|
||||
(if (and (= @filter-type :slower-than)
|
||||
(js/isNaN (js/parseFloat @filter-input)))
|
||||
|
@ -103,6 +104,7 @@
|
|||
(do
|
||||
(reset! input-error false)
|
||||
(add-filter filter-items @filter-input @filter-type))))]
|
||||
|
||||
[:div.tab-contents
|
||||
[:div.filter
|
||||
[:div.filter-control
|
||||
|
|
Loading…
Reference in New Issue