¶
The re-frame Clojars page contains dependency coordinates for Maven/deps/Lein.
1.1.2 (2020-11-11)¶
Added
- Add a new interceptor called
unwrap
. It decreases the amount of destructuring necessary in an event handler where theevent
is structured as a 2-vector of[event-id payload-map]
. Implemented as the outcome of #644.
Changed
- The
:coeffects
map (withincontext
) will now contain a new key called:original-event
which has as its value the original event dispatched, prior to any modification by interceptors such astrim-v
andunwrap
. To this another way, thecoeffects
map will have BOTH an:event
and an:original-event
key, which will reference the original event dispatched UNLESS interceptors have modified:event
- The
trim-v
interceptor now produces a warning ifevent
is not a vector. Just in case someone has mixed the use oftrim-v
andunwrap
together. Thetrim-v
interceptor will not modify anevent
if it is not a vector.
Breaking
- Previously, the
trim-v
interceptor stored the original event (prior to any modification) withincoeffects
using the key:re-frame.std-interceptors/untrimmed-event
. But, now,trim-v
no longer does this. Any code relying on this implementation detail will now break. Instead, you should access the event stored in the:original-event
key, as described above.
Fixed
- Fix reg-global-interceptor code reloading by replacing interceptors with duplicate ids in place to maintain the ordering of global interceptors. Previously would result in the interceptor actually being duplicated. See #655
- Fix event handlers passing events modified by interceptors to tracing, instead
all event handlers now use
:original-event
for tracing.
1.1.1 (2020-08-26)¶
Added
- The built-in effect
:dispatch-later
can now take a single map value. Supplying a sequence of maps is now deprecated in favour of using multiple:dispatch-later
effects within the new:fx
effect. See the API documentation.
1.1.0 (2020-08-24)¶
Added
-
re-frame now guarantees that a
:db
effect, if present, will be actioned before any other sibling effects. re-frame continues to provide no guarantees about the order in which other effects will be actioned. -
Added an new
:fx
built-in effect handler. Previously, you might have returned effects like this:1 2 3 4 5 6 7 8 9
(reg-event-fx :token (fn [{:keys [db]} [_ id]] {:db (assoc db :twirly true) :dispatch [:blah] :full-screen true :http (list {:method :GET :url "http://abc.com/endpoint" ...} {:method :POST :url "http://blah.com/endpoint" ...})}))
but now, using
:fx
:1 2 3 4 5 6 7 8 9 10
(reg-event-fx :token (fn [{:keys [db]} [_ id]] {:db (assoc db :twirly true) :fx [ [:dispatch [:blah]] [:full-screen true] [:http {:method :GET :url "http://abc.com/endpoint" ...}] [:http {:method :POST :url "http://blah.com/endpoint" ...}] (when seventies? [:hair "side burns"])] ;; nils are ignored
Notes:
- the effect
:fx
will be associated with aseq
, typically a vector - the effects in
:fx
will be actioned inseq
order - each element in the
seq
should be a2-vector
. This vector will contain an effect-id, typically a keyword, and an effect payload. - if any element of
:fx
is nil, it will be ignored. This allows effects to be conditionally included via awhen
(an example is given above) :db
effects should not be put into:fx
. re-frame will emit a warning if it finds one.
Benefits:
:fx
allows for effects to be ordered- you can include the same kind of effect multiple times (eg
:dispatch
) which means there is no longer any need for special effects like:dispatch-n
. Indeed, all*-n
style effects are now redundant. -
this feature is a stepping stone towards making it easier to create an event handler which is a composition of other functions. We imagine circumstances in the future in which event handlers might be written more like this:
#!clj (reg-event-xxxx ;; <-- a new kind of registration function :event-id
interceptors [function1 function2 function3])
See exploratory discussion here and here
This new effect is described in the API docs. Further discussion on its introduction can be found in issue #639.
- the effect
Changed
- if your
reg-event-fx
handler returns an effect map containing an unknown effect key, re-frame will now produce a warning, not a hard error. See #639.
1.0.0 (2020-07-20)¶
No changes since 1.0.0-rc6. Final 1.0.0 release.
1.0.0-rc6 (2020-07-06)¶
Fixed
- Handle exception in
interop/on-load
when in an environment that does not supportgoog.events/listen
(e.g. React Native). See #604.
1.0.0-rc5 (2020-07-04)¶
Changed
- Revert changes in 1.0.0-rc4 as 'fixed' bug was a false positive.
1.0.0-rc4 (2020-07-04)¶
Changed
- ~Change impl of execution of global interceptor functions in attempt to fix supposed order execution bug that later turned out to be a false positive.~
1.0.0-rc3 (2020-05-27)¶
Changed
- Upgrade binaryage/devtools to 1.0.2
Fixed
- Fix ReferenceError exception in Web Worker. See #614 and #615. Might also fix use in React Native. See #604.
1.0.0-rc2 (2020-05-23)¶
Fixed
- Fix cljdoc config (
doc/cljdoc.edn
) with updateddocs/
structure.
1.0.0-rc1 (2020-05-16)¶
Added
- Add support for cljs-oss/canary builds. See #478.
- Add global interceptors. See #570.
- Add cljdoc config. See #592
- Add missing docstrings to re-frame.core cs. See #588
Fixed
- Fix documentation for re-frame.core ns. See #456 and #216
- Fix excessive overwriting handler warnings. See #204.
- Consistently use (co)effect helpers. See #548. Thanks to @mbertheau.
- Fix use of deprecated reagent/render for reagent.dom/render. See #577. Thanks to @pathammer
- Fix support for layer 3 subscriptions in clj environment. See #541. Thanks to @dawran6.
- Fix infer externs warnings. See #591.
Changed
- Change sample apps to use source files from the repo checkout instead of re-frame release artifacts.
- Upgrade shadow-cljs to 2.8.110
- Upgrade lein-shadow to 0.2.0
- Upgrade ClojureScript to 1.10.764
Removed
0.12.0 (2020-03-08)¶
Changed
- Upgrade reagent to 0.10.0. Important: If using re-frame-10x you need to upgrade to 0.6.0. If using re-com you need to upgrade to 2.8.0.
0.11.0 (2020-01-20)¶
Everything in 0.11.0-rc1 to 0.11.0-rc4 or in other words the same as 0.11.0-rc4.
0.11.0-rc4 (2020-01-16)¶
Changed
- Upgrade reagent to 0.9.1
- Clarify debug interceptor log message. See #546. Thanks to @mbertheau
- Refactoring of
fx-handler->interceptor
. See #547. Thanks to @mbertheau - Upgrade shadow-cljs to 2.8.83
- Upgrade ClojureScript to 1.10.597
- Upgrade lein-git-inject to 0.0.11