(See legend at the end for some rough definition of the bold labels in front of each item.)
- upgrade
prop-types
dependency (#20) - use
:static-properties
instead of:class-properties
to pass:childContextTypes
(#20)
⚠️ Breakingderivatives-pool
now returns the record instead of a map with theget!
andrelease!
functions. If you did not directly call thederivatives-pool
function (and used the Rum mixins) this should not affect you. (e813f1ddfd7)- To upgrade replace uses of the
get!
andrelease!
functions with their pendants inorg.martinklepsch.derivatives
(same names) and pass the derivatives pool record that is now returned byderivatives-pool
as first argument. - Sorry for this breakage I hope it does not affect too many. 🙌
- To upgrade replace uses of the
- Improvement depend on
cljsjs/react-proptypes
for React 16 compatibility (#18) - Bugfix with a spec like
{:db [[] (atom {})]}
it was not possible to get ahold of the:db
atom. (64efb6f3)
-
Improvement Implement own
derived-value
that can be disposed, which will remove watches on sources (atoms or other watchable things). Previously Rum'sderived-atom
was used which does not support cleaning up watches when they are no longer needed. PR #2 -
New Feature Extend Rum
drv
mixin to accept multiple arguments PR #5 & PR #8. Previously you calledd/drv
multiple times:(rum/defcs block < rum/reactive (d/drv :product/page) (d/drv :product/images) (d/drv :product/text) [state] (let [page (d/react state :product/page) images (d/react state :product/images) text (d/react state :product/text)] ...))
Now it is possible to pass multiple keywords to the same function with the same result as multiple invocations. Also there is a new function
react-all
that can be used to dereference multiple or all known derivatives at once:(rum/defcs block < rum/reactive (d/drv :product/page :product/images :product/text) [state] (let [{:keys [:product/text]} (d/react-all state)] [:p text] ,,,))
(d/react-all state) -> {:product/page 'val :product/images 'val :product/text 'val} (d/react-all state :product/page) -> {:product/page 'val}
-
Improvement The
sync-derivatives!
function and theDerivativesPool
record constructors now receive an extra argumentwatch-key-prefix
that helps avoiding conflicts when creating multiple pools from a single source atom with specs that have overlapping keys. See #10 for details.- This change is breaking if you call
->DerivativesPool
,map->DerivativesPool
orsync-derivatives!
directly. Most likely you are not though :)
- This change is breaking if you call
-
Bugfix Fix wrong assumption in tests that would cause them to fail when a spec contains more complex keys:
37cda80
-
Bugfix Fix issue where
sync-derivatives!
would fail if spec keys don't implement IFnb5f9545
-
add tests
-
implement
build
in terms ofsync-derivatives
-
add assertions that spec is a map
-
when checking if something is a function to use to derive a new value or if it is a source we now use
(implements? IWatchable x)
instead of(fn? x)
-
refactor pooling implementation to allow testing of internals
-
Rum mixins: simplifiy keys used in
childContext
to be strings -
Rum mixins: make sure the token is correctly passed to
get!
andrelease!
functions
- initial release
- Breaking: A refactoring that may potentially break backwards compatibility
- Improvement: An improvement that is not breaking compatibility and thus should not require action from your side
- New Feature: An extension to the API that may make your life easier
- Bugfix: Fix of broken behavior. If you think you might rely on the bug check the linked commit.