¶
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 theeventis structured as a 2-vector of[event-id payload-map]. Implemented as the outcome of #644.
Changed
- The
:coeffectsmap (withincontext) will now contain a new key called:original-eventwhich has as its value the original event dispatched, prior to any modification by interceptors such astrim-vandunwrap. To this another way, thecoeffectsmap will have BOTH an:eventand an:original-eventkey, which will reference the original event dispatched UNLESS interceptors have modified:event - The
trim-vinterceptor now produces a warning ifeventis not a vector. Just in case someone has mixed the use oftrim-vandunwraptogether. Thetrim-vinterceptor will not modify aneventif it is not a vector.
Breaking
- Previously, the
trim-vinterceptor stored the original event (prior to any modification) withincoeffectsusing the key:re-frame.std-interceptors/untrimmed-event. But, now,trim-vno longer does this. Any code relying on this implementation detail will now break. Instead, you should access the event stored in the:original-eventkey, 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-eventfor tracing.
1.1.1 (2020-08-26)¶
Added
- The built-in effect
:dispatch-latercan now take a single map value. Supplying a sequence of maps is now deprecated in favour of using multiple:dispatch-latereffects within the new:fxeffect. See the API documentation.
1.1.0 (2020-08-24)¶
Added
-
re-frame now guarantees that a
:dbeffect, 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
:fxbuilt-in effect handler. Previously, you might have returned effects like this:(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:(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 ignoredNotes:
- the effect
:fxwill be associated with aseq, typically a vector - the effects in
:fxwill be actioned inseqorder - each element in the
seqshould be a2-vector. This vector will contain an effect-id, typically a keyword, and an effect payload. - if any element of
:fxis nil, it will be ignored. This allows effects to be conditionally included via awhen(an example is given above) :dbeffects should not be put into:fx. re-frame will emit a warning if it finds one.
Benefits:
:fxallows 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*-nstyle 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:
(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-fxhandler 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-loadwhen 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