216 Commits

Author SHA1 Message Date
Dan Holmsand
6eb501b9cb Update changelog
And remove unnecessary logging.
2014-10-28 16:32:28 +01:00
Dan Holmsand
a1a244e573 Merge branch 'master' of https://github.com/seancorfield/reagent 2014-10-20 13:29:19 +02:00
Dan Holmsand
e1f9ae20c6 Update ClojureScript version 2014-09-14 10:56:12 +02:00
Sean Corfield
5d2fc0254e Add cursor support.
Adds RCursor type: wraps Reagent's RAtom along with a path that provides focus into a specific part of that atom.

Adds reagent.ratom/cursor as a constructor for the RCursor type.

Adds reagent.core/cursor as the public API. This can be called with just a path, and returns a function that accepts a Reagent atom, or with both a path and an atom.

Dereferences of a cursor behave like get-in on the underlying atom with the specified path.

If you reset! a cursor, it behaves like a swap! assoc-in on the underlying atom. If swap! a cursor, it behaves like a swap! update-in on the underlying atom.
2014-09-08 19:31:05 -07:00
Dan Holmsand
41a687faa7 Add import-react macro 2014-04-09 16:50:15 +02:00
Dan Holmsand
429ed50fab Make demo code more Light Table-friendly 2014-04-01 19:50:28 +02:00
Dan Holmsand
4060bfc6fe Simplify the fvar macro 2014-04-01 15:17:33 +02:00
Dan Holmsand
9fee64b1bf Remove old interop code 2014-03-25 17:51:03 +01:00
Dan Holmsand
2e0e369d93 Use new javascript interop macros 2014-03-25 12:37:28 +01:00
Dan Holmsand
976cf8ef0b Add fvar macro 2014-03-25 11:33:15 +01:00
Dan Holmsand
6389a3889a Add better javascript interop macros 2014-03-25 07:58:22 +01:00
Dan Holmsand
907a85db9c Update React to 0.10.0 2014-03-25 06:23:44 +01:00
Dan Holmsand
0f2136d4b4 Allow render-component to take a function returning a component 2014-03-18 16:43:19 +01:00
Dan Holmsand
ba995c2e0d Add force-update-all, to make LightTable integration easier
force-update-all re-mounts all root components, and makes all
their children re-render.
2014-03-18 13:09:55 +01:00
Dan Holmsand
82a1dd73eb Make javascript interop macros more like aset and aget
Drop js-global, probably not worth the trouble
2014-03-17 12:02:26 +01:00
Dan Holmsand
f84369a53a Make native components a little faster by optimizing common cases 2014-03-16 08:29:35 +01:00
Dan Holmsand
56e11f99c7 Use interop macros everywhere, delete unnecessary hacks 2014-03-14 13:47:10 +01:00
Dan Holmsand
58dd46f4ae More usage of interop macros 2014-03-14 12:28:10 +01:00
Dan Holmsand
e21e58e509 Rename jget to get. etc 2014-03-14 11:45:44 +01:00
Dan Holmsand
c3932c9cf1 Start using interop macros 2014-03-14 11:21:05 +01:00
Dan Holmsand
8b59d1509b Add macros for more convenient javascript interop 2014-03-14 10:27:49 +01:00
Dan Holmsand
c4679b204a Use new memoize everywhere 2014-03-06 13:01:33 +01:00
Dan Holmsand
a3b04d6cc2 Simplify rendering of wrapped components 2014-03-06 12:29:09 +01:00
Dan Holmsand
5c194e8fe5 Use nth throughout for consistency 2014-03-06 12:26:20 +01:00
Dan Holmsand
c189bd4460 core/memoize is very slow, so use our own instead 2014-03-06 12:24:07 +01:00
Jacob Maine
6302c8ecd6 Make multimethods work as component functions.
This is actually a bug in ClojureScript
(http://dev.clojure.org/jira/browse/CLJS-777).  In regular Clojure a
`MultiFn` is `ifn?`, but in ClojureScript it wasn't.  The bug is now
fixed
(525154f2a4)
but not yet released.

This code can be reverted after Reagent's ClojureScript version is
updated.
2014-03-03 17:55:40 +02:00
Dan Holmsand
34083ee872 Make sure inputs are not re-rendered unnecessarily 2014-03-02 09:58:23 +01:00
Dan Holmsand
e539069947 Allow on-change on controlled inputs to keep value unchanged 2014-02-28 12:55:20 +01:00
Dan Holmsand
908452c126 Be compatible with ClojureScript 0.0-2173: implement IAtom, ISwap,
IReset
2014-02-22 08:04:52 +01:00
Dan Holmsand
7951b43aeb into-array is a tiny bit faster than reduce for seqs 2014-02-21 21:39:43 +01:00
Dan Holmsand
ec7b9acf23 Expose as-component, document current-component 2014-02-21 08:23:16 +01:00
Dan Holmsand
b9c3e106e8 Update React to 0.9.0 2014-02-21 08:04:16 +01:00
Dan Holmsand
b6c20ac863 Compare all maps passed to components the same way 2014-02-17 12:42:08 +01:00
Dan Holmsand
ba18691674 Cleanup 2014-02-15 12:29:16 +01:00
Dan Holmsand
1555fd9c3e Revert ref support for the time being
There might be a more elegant way of supporting refs...
2014-02-15 12:27:46 +01:00
Dan Holmsand
2bb32eb21f Make set-state etc async as well, by using an atom 2014-02-15 11:57:52 +01:00
Dan Holmsand
305fc73d8a First stab at ref support 2014-02-15 11:03:24 +01:00
Dan Holmsand
b2bfc14afb Move test code for partial 2014-02-14 11:27:45 +01:00
Dan Holmsand
effcbe6615 Move props accessors to util, add asserts for accessors in core 2014-02-14 11:13:30 +01:00
Dan Holmsand
695383c9a1 Cleanup template a little 2014-02-14 10:08:57 +01:00
Dan Holmsand
93c3f7194e Introduce dev? macro 2014-02-14 09:38:09 +01:00
Dan Holmsand
7792f493c0 Avoid duplicating :key in both wrapper and child 2014-02-12 07:16:55 +01:00
Dan Holmsand
12ee54b083 Allow "key" to be specified with meta-data
These are now equivalent
[foo {:key 1}] and
(with-meta [foo] {:key 1})
2014-02-11 20:56:48 +01:00
Dan Holmsand
4882b51b64 Move react.js to vendor directory 2014-02-11 17:10:04 +01:00
Dan Holmsand
0b5f8c423e next-tick moved as well 2014-02-11 15:52:16 +01:00
Dan Holmsand
6eb6b482f5 Factor out batching logic into own ns 2014-02-11 15:34:06 +01:00
Dan Holmsand
c18b8c318e Get rid of pesky circular dependency 2014-02-11 15:08:50 +01:00
Dan Holmsand
c1f2f59bbc Make equality checking more consistent 2014-02-11 13:57:56 +01:00
Dan Holmsand
41962bbe18 Reduce is great. Use it more 2014-02-11 12:41:00 +01:00
Dan Holmsand
b041427e94 Allow Hiccup tags to be strings and symbols as well 2014-02-11 12:03:44 +01:00