Skip to content

Commit

Permalink
1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
flexsurfer committed Apr 19, 2021
1 parent 60ead92 commit 638d820
Show file tree
Hide file tree
Showing 41 changed files with 3,148 additions and 350 deletions.
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ https://flexsurfer.github.io/conduit-re-frisk-demo/

<img src="./img/feature-app-db.png" height="300">

### Watching keys from app-db

<img src="./img/feature-watch.png" height="300">

### Events with app-db difference for each event

<img src="./img/feature-event.png" height="300">
Expand Down Expand Up @@ -48,8 +52,8 @@ Render trace is supported only in the re-frisk-remote

## Usage

`[re-frisk "1.4.0"]`
`[re-frisk-remote "1.4.0"]`
`[re-frisk "1.5.0"]`
`[re-frisk-remote "1.5.0"]`

**Important**: Please note the following compatibility table:

Expand All @@ -66,7 +70,7 @@ re-frisk Version | React Version | Reagent Versions

re-frisk will be embedded in the DOM of your application. So my suggestion is to use re-frisk-remote, it doesn't affect your application and has more features

1. Add re-frisk as a dev dependency `[re-frisk "1.4.0"]`
1. Add re-frisk as a dev dependency `[re-frisk "1.5.0"]`

2. Enable re-frisk

Expand All @@ -83,7 +87,7 @@ re-frisk will be embedded in the DOM of your application. So my suggestion is to

[![Clojars](https://img.shields.io/clojars/v/re-frisk-remote.svg)](https://clojars.org/re-frisk-remote)

1. Add re-frisk as a dev dependency `[re-frisk-remote "1.4.0"]`
1. Add re-frisk as a dev dependency `[re-frisk-remote "1.5.0"]`

2. Enable re-frisk on default port (4567):

Expand All @@ -103,7 +107,7 @@ re-frisk will be embedded in the DOM of your application. So my suggestion is to

add in `deps.edn`

`:aliases {:dev {:extra-deps {re-frisk-remote {:mvn/version "1.4.0"}}}}}`
`:aliases {:dev {:extra-deps {re-frisk-remote {:mvn/version "1.5.0"}}}}}`

create `re_frisk.clj`

Expand Down
3 changes: 2 additions & 1 deletion dev/re_frisk/demo.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
:jsobj js/setInterval
:time-color "#f88"
:clock? true
:form2-text "FORM 2"})
:form2-text "FORM 2"
:test {:test1 {:test2 {:test3 {:test4 {:test5 "DEMO"}}}}}})

;; -- Event Handlers ----------------------------------------------------------

Expand Down
Binary file added img/feature-watch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(defproject re-frisk-remote "1.4.0"
(defproject re-frisk-remote "1.5.0"
:description "Take full control of re-frame app"
:url "https://github.com/flexsurfer/re-frisk"
:license {:name "MIT"
Expand Down
4 changes: 3 additions & 1 deletion public/client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1359,7 +1359,9 @@
.inline-hyperlink > div {
display: inline;
}

input {
outline:none;
}
</style>
<link href="http://fonts.googleapis.com/css?family=Roboto:300,400,500,700,400italic" rel="stylesheet"
type="text/css">
Expand Down
9 changes: 7 additions & 2 deletions re-frisk/project.clj
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
(defproject re-frisk "1.4.0"
(defproject re-frisk "1.5.0"
:description "Take full control of re-frame app"
:url "https://github.com/flexsurfer/re-frisk"
:license {:name "MIT"
:url "https://opensource.org/licenses/MIT"}
:source-paths ["src"]
:plugins [[thomasa/mranderson "0.5.3"]]
:profiles {:mranderson {:mranderson {:project-prefix "re-frisk.inlined-deps"}
:dependencies ^:replace [^:source-dep [reagent "1.0.0"
:exclusions [cljsjs/react
cljsjs/react-dom
cljsjs/react-dom-server]]]}}
:dependencies [[org.clojure/clojure "1.10.1"]
[org.clojure/clojurescript "1.10.597"]
[reagent "0.10.0"]
[re-frame "0.12.0"]
[re-com "2.8.0"]])
16 changes: 13 additions & 3 deletions re-frisk/src/re_frisk/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
[re-frisk.db :as data]
[re-frisk.ui :as ui]
[re-frisk.diff.diff :as diff]
[reagent.core :as reagent]
[re-frisk.inlined-deps.reagent.v1v0v0.reagent.core :as reagent]
[re-frisk.utils :as utils]
[re-frame.trace]
[re-frisk.trace :as trace]
[re-frisk.subs-graph :as subs-graph]
[re-frame.interop :as interop]
[re-frisk.stat :as stat]
[day8.reagent.impl.batching :refer [patch-next-tick]]))
[day8.reagent.impl.batching :refer [patch-next-tick]]
[day8.reagent.impl.component :refer [patch-wrap-funs]]))

(defonce initialized (atom false))
(defonce prev-event (atom {}))
Expand All @@ -28,9 +29,14 @@
(reset! (:subs re-frame-data) (utils/get-subs))
(reset! (:app-db re-frame-data) @db/app-db))

(defn update-views [views]
(when (seq views)
(reset! (:views re-frame-data) views)))

(defn trace-cb [traces]
(when-not (:paused? @data/tool-state)
(let [ignore-events (get-in @data/tool-state [:opts :ignore-events])
traces (trace/update-views-and-get-traces update-views traces)
normalized (trace/normalize-traces traces ignore-events)
first-event (or (first @(:events re-frame-data)) (first normalized))]
(when (seq normalized)
Expand Down Expand Up @@ -91,14 +97,18 @@
(gOldOnError error-msg url line-number)
false)))))

(defn patch-reagent! []
(patch-wrap-funs)
(patch-next-tick))

(defn enable-re-frisk! [& [opts]]
(when-not @initialized
(reset! initialized true)
(swap! data/tool-state assoc :opts opts)
#_(register-exception-handler)
(if (re-frame.trace/is-trace-enabled?)
(do
#_(patch-reagent!)
(patch-reagent!)
(re-frame.trace/register-trace-cb :re-frisk-trace trace-cb))
(when-not (= (:events? opts) false)
(reset! prev-event {:app-db @db/app-db})
Expand Down
2 changes: 1 addition & 1 deletion re-frisk/src/re_frisk/db.cljs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(ns re-frisk.db
(:require [reagent.core :as reagent]
(:require [re-frisk.inlined-deps.reagent.v1v0v0.reagent.core :as reagent]
[re-frame.trace :as trace]))

(defonce
Expand Down
10 changes: 10 additions & 0 deletions re-frisk/src/re_frisk/inlined_deps/reagent/v1v0v0/reagent/core.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
(ns ^{:mranderson/inlined true} re-frisk.inlined-deps.reagent.v1v0v0.reagent.core
(:require [re-frisk.inlined-deps.reagent.v1v0v0.reagent.ratom :as ra]))

(defmacro with-let
"Bind variables as with let, except that when used in a component
the bindings are only evaluated once. Also takes an optional finally
clause at the end, that is executed when the component is
destroyed."
[bindings & body]
`(ra/with-let ~bindings ~@body))
Loading

0 comments on commit 638d820

Please sign in to comment.