Skip to content

Commit

Permalink
Revert "Dispatch an init event in the client to fix 10x trace state (…
Browse files Browse the repository at this point in the history
…opt-in)"

This reverts commit 0714488.

A workaround that didn't work very well. Making progress on a real
solution.

See #263
  • Loading branch information
kimo-k committed Dec 7, 2023
1 parent 343df85 commit 99fca6b
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 14 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,6 @@ name | description | type | example
...`time-travel?` | selecting an event reverts your app-db | boolean | `true`
...`ignored-libs` | ignore low-level trace | seq of keywords | `"[:reagent :re-frame]"`
...`ns-aliases` | display aliased keywords in data inspectors | map of symbol->symbol | `"{long-namespace ln}"`
...`init-event?` | lets 10x dispatch its own init event in your client re-frame (this fixes some [quirks](https://github.com/day8/re-frame-10x/issues/263)) | boolean | `false`
Expand Down
3 changes: 1 addition & 2 deletions examples/todomvc/shadow-cljs.edn
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
:closure-defines
{re-frame.trace.trace-enabled? true
day8.re-frame-10x.debug? true
day8.re-frame.tracing.trace-enabled? true
day8.re-frame-10x.init-event? true}
day8.re-frame.tracing.trace-enabled? true}
:external-config
{:devtools/config
{:features-to-install
Expand Down
4 changes: 1 addition & 3 deletions src/day8/re_frame_10x.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@
(goog-define time-travel? true)
(goog-define ignored-libs "[:reagent :re-frame]")
(goog-define ns-aliases "{long-namespace ln}")
(goog-define init-event? false)

(def project-config
(let [read reader.edn/read-string-maybe
Expand All @@ -164,6 +163,5 @@
:filtered-view-trace (some->> hidden-namespaces read (map view) sortable-uuid-map)
:app-db-follows-events? time-travel?
:low-level-trace (some-> ignored-libs read (pred-map #{:re-frame :reagent}))
:ns-aliases (some->> ns-aliases read (map alias) sortable-uuid-map)
:init-event? init-event?}
:ns-aliases (some->> ns-aliases read (map alias) sortable-uuid-map)}
(into {} keep-vals))))
4 changes: 0 additions & 4 deletions src/day8/re_frame_10x/preload/react_17.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@

(rf/dispatch-sync [::events/init re-frame-10x/project-config])

(when re-frame-10x/init-event?
(re-frame.core/reg-event-db :day8.re-frame-10x/init (fn [db _] db))
(re-frame.fx/dispatch-later {:ms 500 :dispatch [:day8.re-frame-10x/init]}))

(rf/clear-subscription-cache!)

(def shadow-root (re-frame-10x/create-shadow-root))
Expand Down
4 changes: 0 additions & 4 deletions src/day8/re_frame_10x/preload/react_18.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@

(rf/dispatch-sync [::events/init re-frame-10x/project-config])

(when re-frame-10x/init-event?
(re-frame.core/reg-event-db :day8.re-frame-10x/init (fn [db _] db))
(re-frame.fx/dispatch-later {:ms 500 :dispatch [:day8.re-frame-10x/init]}))

(rf/clear-subscription-cache!)

(def shadow-root (re-frame-10x/create-shadow-root))
Expand Down

0 comments on commit 99fca6b

Please sign in to comment.