2016-08-22 04:21:38 +00:00
## 0.8.1 (2016.08.XX) Unreleased
#### Improvements
- [#200 ](https://github.com/Day8/re-frame/pull/200 ) Remove trailing spaces from console logging
2016-08-19 06:57:27 +00:00
## 0.8.0 (2016.08.19)
2016-07-07 04:52:13 +00:00
2016-07-22 01:24:34 +00:00
Staying on the leading edge of new buzzwords is obviously critical for any framework.
2016-08-03 02:53:01 +00:00
Angular's terrifying faceplant is a sobering reminder to us all.
2016-07-23 00:09:19 +00:00
With this release, re-frame's already impressive buzzword muscles
2016-08-03 02:53:01 +00:00
bulge further with new walnuts like "effects", "coeffects", "interceptors"
and "de-duplicated signal graph". I know, right?
2016-07-09 03:42:08 +00:00
2016-07-11 06:53:57 +00:00
Some may even find these new features useful.
2016-05-04 23:56:09 +00:00
2016-08-08 13:16:44 +00:00
Joking aside, this is a substantial release which will change how you use re-frame.
2016-07-19 23:52:39 +00:00
2016-08-19 08:20:21 +00:00
#### Headline
2016-07-19 23:52:39 +00:00
2016-07-14 01:21:12 +00:00
- re-frame subscriptions are now de-duplicated. As a result,
2016-07-20 05:42:56 +00:00
many Signal graphs will be more efficient. The new behaviour better
matches programmer intuitions about what "should" happen.
2016-07-14 01:21:12 +00:00
2016-05-29 13:23:17 +00:00
Each subscription causes a handler to execute, producing
2016-07-07 05:16:49 +00:00
a reactive stream of updates. Two calls to `(subscribe [:some :query])` results in two copies of the same
subscription handler running, each delivering a stream of updates. Now, if these two subscriptions
2016-05-29 13:23:17 +00:00
were running at the same time, this would be inefficient. Both handlers would be
doing the same computations and delivering the same stream of updates. Unnecessary, duplicate work.
2016-07-14 01:21:12 +00:00
Starting with this version, this sort of duplication has been eliminated. Two, or more, concurrent
subscriptions for the same query will now source reactive updates from the one executing handler.
2016-06-14 11:08:32 +00:00
So, how do we know if two subscriptions are "the same"? Answer: two subscriptions
2016-05-29 13:23:17 +00:00
are the same if their query vectors test `=` to each other.
2016-07-14 01:21:12 +00:00
So, these two subscriptions are *not* "the same": `[:some-event 42]` `[:some-event "blah"]` . Even
though they involve the same event id, `:some-event` , the query vectors do not test `=` .
2016-07-24 07:08:09 +00:00
- added a new subscription handler registration function called `re-frame.core/reg-sub` . It is an
alternative to `re-frame.core/register-sub` (now renamed to `re-frame.core/reg-sub-raw` ).
`reg-sub` is significantly easier to use and understand,
2016-07-14 01:21:12 +00:00
while often also being more performant. The design has really fallen out nicely and we're
2016-07-09 03:42:08 +00:00
delighted with it.
2016-07-14 01:21:12 +00:00
2016-07-24 07:08:09 +00:00
With `reg-sub` , you no longer need to use `reaction` explicitly. Subscription handlers are now pure
2016-08-08 13:16:44 +00:00
which makes them easier to understand, trace and test etc. Plus, as you'll see in the docs, there is some
gratuitous syntactic sugar. Who doesn't like sugar?
2016-07-14 01:21:12 +00:00
2016-07-26 01:41:42 +00:00
At this point, the todomvc example represents the best tutorial on the subject:
2016-07-07 04:52:13 +00:00
https://github.com/Day8/re-frame/blob/master/examples/todomvc/src/todomvc/subs.cljs
2016-07-14 01:21:12 +00:00
2016-08-22 00:01:33 +00:00
- re-frame now supports the notion of Event Handlers accepting coeffects and returning effects. < br >
There's now three kinds of event handlers: `-db` , `-fx` and `-ctx` . < br >
2016-08-16 22:43:27 +00:00
For a tutorial see: https://github.com/Day8/re-frame/tree/develop/docs < br >
2016-08-22 00:01:33 +00:00
For Effect Handler examples see:
2016-08-16 22:43:27 +00:00
2016-07-15 13:50:33 +00:00
1. https://github.com/Day8/re-frame-http-fx
2. https://github.com/Day8/re-frame-forward-events-fx
3. https://github.com/Day8/re-frame-async-flow-fx
2016-07-14 01:21:12 +00:00
2016-08-08 13:16:44 +00:00
- You can now run and debug re-frame tests on the JVM.
2016-07-26 01:41:42 +00:00
Just to be clear: this does not mean you can run re-frame apps on the JVM (there's no React or
2016-08-08 13:16:44 +00:00
Reagent available). But you can debug your event handler tests using full JVM tooling goodness.
2016-07-22 01:24:34 +00:00
2016-08-16 22:43:27 +00:00
@samroberton and @escherize have provided the thought leadership and drive here. They converted
2016-07-26 01:41:42 +00:00
re-frame to `.cljc` , supplying plugable interop for both the `js` and `jvm` platforms.
2016-08-08 13:16:44 +00:00
Further, they have worked with @danielcompton to create a library of testing utilities which
will hopefully evolve into a nice step forward on both platforms: < br >
2016-08-16 02:24:49 +00:00
https://github.com/Day8/re-frame-test
2016-08-08 13:16:44 +00:00
Work is ongoing in this area.
2016-07-26 01:41:42 +00:00
2016-08-08 13:16:44 +00:00
- the undo/redo features buried in re-frame has been factored out into
[a standalone library ](https://github.com/Day8/re-frame-undo ).
2016-07-26 01:41:42 +00:00
2016-08-03 07:36:18 +00:00
undo and redo have been a part of re-frame from the beginning, but they have never officially
been made a part of the API, and have not been documented. So it nice to see it available, and fully
2016-08-03 02:53:01 +00:00
documented.
2016-07-22 01:24:34 +00:00
2016-08-03 07:36:18 +00:00
This new library includes [various enhancements ](https://github.com/Day8/re-frame-undo#harvesting-and-re-instating )
2016-08-15 01:55:19 +00:00
over that which previously existed, and it works in with effectful handlers described above.
2016-08-08 13:16:44 +00:00
- Middleware is dead, long live Interceptors.
Up until now, re-frame has allowed you to decorate event handlers with
middleware which looked after the cross cutting concerns of
tracing, undo/redo, validation, etc. This has proved a neat and
successful part of the framework. We thought we were happy.
But recently @steveb8n gave a cljsyd talk on
2016-08-15 01:54:03 +00:00
Pedistal's Interceptor pattern which suddenly transformed them from
2016-08-08 13:16:44 +00:00
arcane to delightfully simple in 20 mins. Interceptors are
2016-08-15 01:54:03 +00:00
really "middleware via data" rather than "middleware via higher order functions".
2016-08-16 22:43:27 +00:00
So it is another way of doing the same thing, but thanks to @steveb8n
Interceptors appear a more flexible base, and simpler.
2016-08-08 13:16:44 +00:00
Interceptors also dovetail really nicely with the effects and coeffects
story which has emerged in re-frame through this 0.8.0 release.
2016-08-16 22:43:27 +00:00
Docs: https://github.com/Day8/re-frame/tree/develop/docs
2016-08-08 13:16:44 +00:00
2016-07-26 01:41:42 +00:00
- we now have a logo designed by Sketch Maester @martinklepsch . Thank you Martin! But remember, no
good deed ever goes unpunished - we'll be pestering you every time from now on :-)
2016-07-22 23:45:54 +00:00
2016-08-19 08:20:21 +00:00
#### Breaking
2016-07-22 10:41:37 +00:00
2016-07-14 01:21:12 +00:00
- requires Reagent >= v0.6.0
2016-08-03 07:36:18 +00:00
- `re-frame.core/register-handler` has been renamed `re-frame.core/reg-event-db` . There's now
three kinds of event-handlers, `-db` , `-fx` and `-ctx` . Event handlers of the 2nd and 3rd kinds
should be registered via the new registration functions `re-frame.core/reg-event-fx` and
`re-frame.core/reg-event-ctx`
2016-07-14 01:21:12 +00:00
2016-07-24 07:08:09 +00:00
- `re-frame.core/register-sub` has been renamed `re-frame.core/reg-sub-raw` . This is to indicate that
2016-08-03 07:36:18 +00:00
this kind of registration is now considered the low level, close to the metal way to
create subscriptions handlers. This release introduced `reg-sub` which becomes the preferred way
to register subscription handlers.
2016-07-26 01:41:42 +00:00
2016-08-16 22:43:27 +00:00
- middlewares have been replaced by Interceptors. In day to day use, there's a good
chance you won't notice the change UNLESS:
1. You have written your own middleware. If so, you'll have to rewrite it.
See how [the builtin interceptors are done ](https://github.com/Day8/re-frame/blob/develop/src/re_frame/std_interceptors.cljc ).
2. You explicitly use `comp` to compose middleware like this:
```clj
(reg-event-db
:some-id
(comp debug tim-v) ;; < -- change to [ debug trim-v ]
(fn [db event]
...))
```
2016-08-08 13:16:44 +00:00
2016-08-03 07:36:18 +00:00
- if you have previously used the undo/redo capabilities buried in re-frame, be aware they have
extracted into a sibling library: https://github.com/Day8/re-frame-undo.
2016-07-14 01:21:12 +00:00
- By default, re-frame uses `js/console` functions like `error` and `warn` when logging, but you can
supply alternative functions using `re-frame.core/set-loggers!` .
With this release, any alternatives you supply will be called with different parameters.
Previously loggers were called with a single `str` parameter but now they are expected to act
2016-05-30 21:50:49 +00:00
like `console.log` itself and take variadic, non string params. Sorry to break things, but
2016-07-14 01:21:12 +00:00
we are trying to maximise use of cljs-devtools and information is lost when strings are
2016-06-03 02:49:49 +00:00
output, instead of actual data.
2016-07-14 01:21:12 +00:00
Of course, you need only worry about this if you are using `re-frame.core/set-loggers!` to
hook in your own loggers. If you are, then, to transition, you'll need to tweak like this:
2016-05-30 21:50:49 +00:00
```
2016-05-30 22:04:36 +00:00
;; your old log function might have looked like this. Single string parameter.
2016-07-14 01:21:12 +00:00
(defn my-logger [s] (do-something-with s))
2016-05-30 21:50:49 +00:00
;; your new version will have variadic params, and turn them into a string
2016-05-30 22:04:36 +00:00
(defn my-logger [& args] (do-something-with (apply str args))
2016-05-30 21:50:49 +00:00
```
2016-06-03 02:49:49 +00:00
2016-08-19 08:20:21 +00:00
#### Improvements
2016-06-14 11:08:32 +00:00
2016-07-07 06:05:37 +00:00
- Bug fix: `post-event-callbacks` were not called when `dispatch-sync` was called.
2016-07-28 04:50:39 +00:00
- added new API `re-frame.core/clear-post-event-callback` which de-registers a callback
2016-08-03 02:53:01 +00:00
previously added by `re-frame.core/add-post-event-callback`
2016-07-14 01:21:12 +00:00
- when an event-handler makes no change to `app-db` , the `debug` middleware now logs a
single line saying so, rather than a "group". Makes it slightly easier to grok
2016-05-29 13:23:17 +00:00
the absence of change.
2016-07-14 01:21:12 +00:00
- Standardised test namespaces: renamed to use -test suffix and moved to eliminate redundant /test folder
2016-07-20 05:42:56 +00:00
- Added cljs.test based tests via browser/html. These mimic original karma tests. NOTE: previous
lein aliases `once` and `auto` have been replaced by `test-once` , `test-auto` & `karma-once`
2016-07-14 06:41:54 +00:00
see [CONTRIBUTING.md ](CONTRIBUTING.md )
2016-05-04 23:56:09 +00:00
2016-03-14 12:32:24 +00:00
## 0.7.0 (2016-03-14)
2015-12-16 18:26:30 +00:00
2016-03-14 10:00:33 +00:00
Breaking:
2016-05-04 23:56:09 +00:00
- removed middleware `log-ex` . It is no longer needed because browsers now correctly report the
throw site of re-thown exceptions. In the unlikely event that you absolutely still need it,
the source for `log-ex` is still in `middleware.cljs` , commented out. Just transfer it to your project.
- `debug` middleware now produces slightly different output (to console). So no code will need to change,
just your expectations of what you see in console. Previously all console output from an event handler was put
into the one console group, which could lead to exceptions being hidden (down in a closed group).
2015-12-16 18:26:30 +00:00
Improvements:
2016-08-21 14:11:57 +00:00
- added one tick of extra pause when events have `:flush-dom` metadata. Previously, there were odd times when
2016-05-04 23:56:09 +00:00
the pause wasn't long enough to ensure redraws.
- now compatible with Reagent 0.6.0 (but this not fully tested) while remaining backwards compatible with
2016-03-14 12:32:24 +00:00
Reagent v0.5.1
2015-12-16 18:26:30 +00:00
- [#138 ](https://github.com/Day8/re-frame/pull/138 ) Switch to using CircleCI and automated testing with Karma
2016-01-28 22:07:58 +00:00
Fixed:
- [#149 ](https://github.com/Day8/re-frame/pull/149 ) Undo now discards oldest undo states, not the newest ones.
2015-12-08 20:40:47 +00:00
## 0.6.0 (2015-12-09)
2015-12-07 20:37:55 +00:00
New API:
2016-05-04 23:56:09 +00:00
- [#118 ](https://github.com/Day8/re-frame/pull/118 ) - Add `add-post-event-callback` to the API.
@pupeno is developing [preprender ](https://carouselapps.com/prerenderer ) which looks pretty neat.
Support this effort by adding a way for preprender to hook event processing.
2015-12-10 11:44:58 +00:00
- `on-changes` middleware now official. No longer experimental.
2016-05-04 23:56:09 +00:00
2015-12-07 20:37:55 +00:00
Improvements:
- [#134 ](https://github.com/Day8/re-frame/pull/134 )
My thanks to @scgilardi for a nice simplification of the routing state machine. Again!
- [#133 ](https://github.com/Day8/re-frame/pull/133 ) Improve Readme formatting
2016-05-04 23:56:09 +00:00
2015-12-07 20:37:55 +00:00
2015-11-05 06:20:23 +00:00
## 0.5.0 (2015-11-5)
New Features:
2016-05-04 23:56:09 +00:00
- [#108 ](https://github.com/Day8/re-frame/pull/108 ) - Add dynamic subscriptions.
2015-11-05 07:32:06 +00:00
Docs to follow, and your cheque is in the mail.
2015-07-17 02:43:22 +00:00
2015-11-02 12:43:19 +00:00
Improvements:
2015-07-17 02:43:22 +00:00
- fixed problem with log grouping
- removed `-------New Event-------` log msg
- made groups collapsed by default
2015-11-05 07:32:06 +00:00
- [#104 ](https://github.com/Day8/re-frame/pull/104 ) - Updated to the latest TodoMVC CSS
2016-05-04 23:56:09 +00:00
- Reimplemented the router loop. Removed use of core.async. Replaced with hand rolled scheduling.
2015-11-04 02:33:50 +00:00
See [420e42a ](https://github.com/Day8/re-frame/commit/420e42aacccbac2d81fedc5ff861442a4ce70c1d )
As a result:
- there is less of a pause between a `dispatch` and the associated event handler being run. (< 1ms vs 5ms ??)
2016-05-04 23:56:09 +00:00
- groups of events queued up will be handled in a batch, one after the other, without yielding
2015-11-04 02:33:50 +00:00
to the browser (previously re-frame yielded to the browser before every single event).
2016-05-04 23:56:09 +00:00
This fixes issues like [#39 ](https://github.com/Day8/re-frame/pull/39 ) and
2015-11-02 11:56:18 +00:00
[#121 ](https://github.com/Day8/re-frame/pull/121 )
2016-05-04 23:56:09 +00:00
2015-11-04 02:33:50 +00:00
I doubt this will affect normal apps. But it could affect games which depend on existing timings. Maybe.
It could affect apps which dispatch large volumes of events (telemetry?) very quickly. Maybe.
2016-05-04 23:56:09 +00:00
2015-04-26 21:38:37 +00:00
2015-05-28 13:15:47 +00:00
## v0.4.1 (2015-05-29)
2015-05-08 14:06:38 +00:00
2015-05-28 13:15:47 +00:00
Improvements:
- fix #65 - Detect mistaken use of middleware factories
- `examples/` now work with figwheel
2015-07-24 14:34:45 +00:00
2015-04-26 21:38:37 +00:00
2015-05-03 23:46:20 +00:00
## v0.4.0 (2015-05-04)
Headline:
2015-07-24 14:34:45 +00:00
- Exceptions in event handlers no longer break the router loop.
2015-05-03 23:46:20 +00:00
Previously, any exception in an event handler broke the app
permanently. This change will:
2015-07-24 14:34:45 +00:00
- improve the debugging experience with figwheel
2015-05-03 23:46:20 +00:00
- mean apps, in production, stand a chance of reporting UHE
to the user, and can perhaps even recover to a sane state.
- #53 Fix Logging And Error Reporting
2015-07-24 14:34:45 +00:00
You can now provide your own logging fucntions.
2015-05-03 23:46:20 +00:00
Further explanation [here ](https://github.com/Day8/re-frame/wiki/FAQ#3-can-re-frame-use-my-logging-functions ).
2015-07-24 14:34:45 +00:00
2015-05-03 23:46:20 +00:00
Deprecated:
2015-07-24 14:34:45 +00:00
- `log-ex` middleware is no longer needed. Simply remove its use.
2015-05-03 23:46:20 +00:00
Sometime in the last couple of months, changes to the CLJS
runtime meant that useful exceptions could escape go-loops, and
2015-07-24 14:34:45 +00:00
good stack traces appear (at least in Chrome).
2015-04-26 21:38:37 +00:00
New Features:
- #52 Add a way to purge redos `(dispatch [:purge-redos])`
2015-07-24 14:34:45 +00:00
When trying to recover from an UHE, do an undo to get back to the
last sane state, and then use this new feature to purge the
just-generated-redo.
- #43 Add ability to clear handlers (event and subs) via
2015-05-03 09:04:31 +00:00
two new API functions:
2015-04-25 00:06:14 +00:00
- re-frame.core/clear-sub-handlers!
- re-frame.core/clear-event-handlers!
Useful for those using the [ClojureScript fork ](https://github.com/quile/component-cljs ) of [Component ](https://github.com/stuartsierra/component ).
2015-07-24 14:34:45 +00:00
2015-04-26 21:38:37 +00:00
Experimental:
2015-05-03 23:46:20 +00:00
- #50 Add "reaction-like" middleware called `on-changes` .
2015-07-24 14:34:45 +00:00
2015-05-03 23:46:20 +00:00
Other:
- improve some comments in todomvc example
2015-07-24 14:34:45 +00:00
2015-03-05 23:47:28 +00:00
2015-04-21 14:18:31 +00:00
## v0.3.2 (2015-04-21)
2015-04-17 13:49:31 +00:00
2015-04-21 14:18:31 +00:00
Improvements:
- Fix #42 - Put in checks for dispatch-sync
- Fix #49 - add table of content and link to wiki for middleware
2015-04-21 14:22:54 +00:00
- Fix #46 - Minor typos fixed
2015-04-17 13:49:31 +00:00
2015-04-17 12:34:40 +00:00
## v0.3.1 (2015-04-18)
2015-04-15 14:13:11 +00:00
2015-04-17 12:34:40 +00:00
Various small improvements and bug fixes:
2015-03-07 09:47:56 +00:00
2015-04-17 12:51:03 +00:00
- log-ex middleware added to core api (it was a mistake that it was missing)
2015-04-17 12:34:40 +00:00
- modest improves to simple example. Better comments, layout, etc.
- the anonymous functions in standard middleware now have meaningful
names, which makes stack traces easier to understand.
2015-04-16 06:04:41 +00:00
- #24 - Fix missing paren in README
2015-04-15 14:26:49 +00:00
- #31 - Fix list formatting in README
2015-04-16 06:04:41 +00:00
- #32 - fix a broken wiki link
- #30 - Fix up the enrich docstring
2015-04-15 14:22:40 +00:00
2015-04-15 13:02:37 +00:00
## v0.3.0 (2015-04-15)
2015-03-07 09:47:56 +00:00
2015-03-13 22:47:31 +00:00
### Headline
2015-03-07 09:47:56 +00:00
2015-04-15 13:02:37 +00:00
- the middleware `after` and `enrich` now call the supplied function `f` with
both `db` and `v` (previously just `db` ). Because javascript is so forgiving
about function arity, this change is backwards compatible.
2015-03-17 11:49:24 +00:00
- new event handler middleware `log-ex` for correctly printing handler stacktraces.
See [explanation ](https://github.com/Day8/re-frame/wiki/Debugging-Event-Handlers#1-an-exception-is-thrown ).
2015-03-13 22:47:31 +00:00
- ongoing improvements to the docs in Wiki
2015-03-07 09:47:56 +00:00
2015-03-13 22:47:31 +00:00
### Other
2015-03-07 09:47:56 +00:00
2015-04-15 13:02:37 +00:00
- move to reagent v0.5.0
2015-03-17 11:49:24 +00:00
- fix undo bug which could result in incorrect explanations.
2015-03-13 22:47:31 +00:00
- improve todomvc's use of localstorage
- experimental work with slimmer.js for testing
2015-04-15 13:02:37 +00:00
- correct README wiki links
2015-03-13 22:47:31 +00:00
- license.txt was incorrectly named previously
2015-03-07 09:47:56 +00:00
2015-03-05 23:47:28 +00:00
## v0.2.0 (2015-03-06)
### Breaking
Renames:
- `register-pure-handler` renamed to `register-handler` (and existing low level `register-handler` becomes `register-handler-base` but is not a part of the API).
- remove `apply-event` middleware and replace with similar `trim-v`
- rename `register-subs` to `register-sub` (avoid confusion over possible plurals)
- rename `set-max-undos` to `set-max-undos!`
Changes:
- `undoable` middleware is now a factory. Where before you used this `undoable` ,
you must now use this `(undoable "some explanation")` . See further below.
### Headline
2015-03-06 02:02:30 +00:00
- exceptions in handler now reported more sanely via console.error.
(core.async really messes with a good stack)
2015-03-05 23:47:28 +00:00
- example `todomvc` available in examples folder.
- Wiki documentation is now more substantial.
2015-03-06 02:02:30 +00:00
- introduce new handler middleware: `debug` , `enrich` and `after`
2015-03-05 23:47:28 +00:00
### Other:
- exceptions in a go loop are a special type of hell. Improve the reporting of exceptions happening in event handlers.
- allow Middleware to be registered as a vector. data > functions > macros
- fix two bugs in undo implementation
- name licence file correctly, thanks to @smith
- fix typo in readme, thanks to @btheado
- Readme now admits to 200 lines of code, not 100.
- dispatch now explicitly returns nil
- travis integration (not that we have any tests currently)
### Details On Undo Changes
2015-03-06 02:02:30 +00:00
The undo/redo feature built into re-frame is now more functional
(at the cost of a breaking change).
2015-03-05 23:47:28 +00:00
2015-03-06 02:02:30 +00:00
There is now an explanation associated with each undo state describing
modification. This allows an app to inform the user what actions
they will be undoing or redoing.
2015-03-05 23:47:28 +00:00
2015-03-06 02:02:30 +00:00
Previously `undoable` was simply middleware, but it is now a middleware factory.
2015-03-05 23:47:28 +00:00
2015-03-06 02:02:30 +00:00
Essentially, that means you can't use it "plain" anymore, and instead you must
call it, like this `(undoable "Some explanation")`
2015-03-05 23:47:28 +00:00
The `explanation` provided to undoable must be either a `string` (static
2015-03-06 02:02:30 +00:00
explanation) or a function `(db event) -> string` , allowing you to customize
the undo message based on details of the event.
2016-07-11 06:53:57 +00:00