re-frame/CHANGES.md

258 lines
11 KiB
Markdown
Raw Normal View History

## 0.8.0 (2016.06.XXXX)
2016-05-29 13:23:17 +00:00
Headline:
- re-frame subscriptions are now de-duplicated. As a result, some Signal graphs will be much more
efficient. The new behaviour better matches programmer intuitions about what "should" happen.
*Explanation*
Each subscription causes a handler to execute, producing
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
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.
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.
So, how do we know if two subscriptions are "the same". Answer: two subscriptions
are the same if their query vectors test `=` to each other.
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-05-29 13:23:17 +00:00
Breaking:
2016-05-30 21:50:49 +00:00
- requires Reagent >= 0.6.0 or later. It won't work with <= Reagent 0.5.2.
- By default, re-frame uses `js/console` functions like `error` and `warn` when logging, but you can
2016-05-30 22:04:36 +00:00
supply alternatives using `re-frame.core/set-loggers!`.
2016-05-30 21:50:49 +00:00
2016-05-30 22:04:36 +00:00
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
we are trying to maximise use of cljs-devtools and information is lost when strings are
output, instead of actual data.
2016-05-30 21:50:49 +00:00
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-05-30 21:50:49 +00:00
(defn my-logger [s] (do-something-with s))
;; 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
```
Of course, you only have to worry about this if you are using `re-frame.core/set-loggers!` to
hook in your own loggers. Otherwise, you have nothing to do.
2016-05-30 21:50:49 +00:00
Improvements
2016-05-29 13:23:17 +00:00
- XXXX middleware for spec checking of event vectors
- XXXX better subscriptions of subscriptions
- XXX spec definitions of what subscriptions deliver ??
- Bug fix: `post-event-callbacks` were not called when `dispatch-sync` was called.
- added new API `re-frame.core/remove-post-event-callback`. See doc string.
2016-05-29 13:23:17 +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
the absence of change.
## 0.7.0 (2016-03-14)
2015-12-16 18:26:30 +00:00
Breaking:
- 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:
- added one tick of extra pause when events have `:flush=dom` metadata. Previously, there were odd times when
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
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)
New API:
- [#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.
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
## 0.5.0 (2015-11-5)
New Features:
- [#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
- 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??)
- 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).
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)
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.
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-04-26 21:38:37 +00:00
## v0.4.0 (2015-05-04)
Headline:
- Exceptions in event handlers no longer break the router loop.
Previously, any exception in an event handler broke the app
permanently. This change will:
- improve the debugging experience with figwheel
- 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
You can now provide your own logging fucntions.
Further explanation [here](https://github.com/Day8/re-frame/wiki/FAQ#3-can-re-frame-use-my-logging-functions).
Deprecated:
- `log-ex` middleware is no longer needed. Simply remove its use.
Sometime in the last couple of months, changes to the CLJS
runtime meant that useful exceptions could escape go-loops, and
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])`
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:
- 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-04-26 21:38:37 +00:00
Experimental:
- #50 Add "reaction-like" middleware called `on-changes`.
Other:
- improve some comments in todomvc example
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-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-13 22:47:31 +00:00
### Headline
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-13 22:47:31 +00:00
### Other
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-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.