Dan Holmsand
8f1c02b273
Render without allocating ratom unless necessary
2014-02-10 15:29:38 +01:00
Dan Holmsand
51ac2be955
Avoid allocation in ratom
2014-02-10 12:46:17 +01:00
Dan Holmsand
cff71b0119
Make render function part of prototype
2014-02-10 11:50:11 +01:00
Dan Holmsand
16a41f67e4
Remove replace-args
...
Probably not very useful, and easy to add back if need be
2014-02-10 09:31:25 +01:00
Dan Holmsand
e76d81f16a
Allow e.g dangerously-set-inner-HTML
2014-02-10 09:12:29 +01:00
Dan Holmsand
b09c35457e
Improve error message for invalid Hiccup forms
2014-02-09 12:42:51 +01:00
Dan Holmsand
e32c3ad044
Fix bug in the new extract-children, and simplify wrapping
2014-02-09 08:48:55 +01:00
Dan Holmsand
3c2c63402e
Breaking change: Allow arbitrary arguments to component functions
...
Previously, the first argument had to be a map, and the rest of the
arguments where passed as a vector as the second argument.
Now [my-comp foo...] generally behaves as (my-comp foo...).
Since `this` is no longer passed to component functions, add
current-component function.
Also change signatures of React callbacks, to reflect that arbitrary
arguments can be passed.
Remove set-props and replace-props for the same reason.
Add argv accessor and set-args instead.
2014-02-08 13:55:01 +01:00
Dan Holmsand
69384d98c6
Simplify create-class
2014-02-08 10:55:29 +01:00
Dan Holmsand
aca69347b7
Merge branch 'delayed'
...
Conflicts:
src/reagent/impl/template.cljs
2014-02-03 14:07:02 +01:00
Dan Holmsand
046912a322
Add some doc strings
2014-02-03 13:59:02 +01:00
Dan Holmsand
e10548f8ba
Reduce is great, and fast. Use it more
2014-02-02 11:40:23 +01:00
Dan Holmsand
1b6b4e449e
Make sure all React lifecycle callbacks are supported
2014-02-02 11:38:25 +01:00
Dan Holmsand
d3407ff664
Consider symbols to be "identical"
...
And test some more obscure should-component-update variants.
2014-01-30 10:34:41 +01:00
Dan Holmsand
344e9e5db5
Make should-component-update a little faster for :style attrs
2014-01-29 11:40:07 +01:00
Dan Holmsand
b45a215f52
Speed up conversion to js a lot by using reduce-kv
2014-01-29 11:00:05 +01:00
Dan Holmsand
a91214e434
Add next-tick as utility on core.cljs
2014-01-28 20:19:10 +01:00
Dan Holmsand
e055fbad26
Make Closure stop whining about "dangerous use of this in static method"
2014-01-28 20:18:19 +01:00
Dan Holmsand
f654c6663f
Make textarea, radio buttons and checkboxes async-friendly
...
And clean up code a little
2014-01-28 19:34:06 +01:00
Dan Holmsand
d1851d5a42
Allow dynamic id with hiccup-style classes
...
And id in props wins over static id.
Fixes #11
2014-01-28 18:00:15 +01:00
Dan Holmsand
8b4ec9fda6
Make managed inputs work better with async rendering
2014-01-28 17:23:39 +01:00
Dan Holmsand
4a537af429
Use prefixed requestAnimationFrames if available
2014-01-27 16:26:21 +01:00
Dan Holmsand
dfe0eb41d5
Batch updates properly by rendering parents before children
2014-01-27 16:17:37 +01:00
Dan Holmsand
eb381f13bb
Start experimenting with batched rendering with requestAnimationFrame
2014-01-27 13:37:59 +01:00
Dan Holmsand
f9d0b58af8
Allow data-* and aria-* attrs, pass string attrs as-is to React
2014-01-25 13:47:41 +01:00
Dan Holmsand
c23bb970e7
Make components look nicer in React's Chrome plugin
2014-01-24 11:02:27 +01:00
Dan Holmsand
44f20f94e0
Rename the cloact directory as well
2014-01-17 11:24:03 +01:00
Dan Holmsand
8e542292a2
Cloact -> Reagent
2014-01-17 11:12:11 +01:00
Dan Holmsand
7bbe917285
Breaking change: Require react.js to be included separately
...
This makes the project.clj a little messier, but makes it a lot
easier to use a different version or a custom build of React.
2014-01-10 11:10:09 +01:00
Dan Holmsand
5fa400c86a
Fix line break
2014-01-09 15:38:16 +01:00
Dan Holmsand
416fb91cc4
Add some doc-strings
2014-01-09 15:23:15 +01:00
Dan Holmsand
97799ae63c
Improve demo a bit
2014-01-09 14:37:11 +01:00
Dan Holmsand
c0744c7fed
Call render functions with props, children, component
2014-01-08 16:51:10 +01:00
Dan Holmsand
6bf6b3f7d4
More cleanup
...
todomvc is now down to 87 lines!
2014-01-08 16:34:36 +01:00
Dan Holmsand
5818976f78
Use js-obj/aset/aget for props and state
2014-01-08 16:00:21 +01:00
Dan Holmsand
c6b56a7a76
Simplify props handling
...
Call Cloact components with separate cljsArgs and cljsChildren
props. That simplifies (and speeds up) code, for the small
price of one call to subvec.
2014-01-08 15:08:29 +01:00
Dan Holmsand
8a8779c736
Cleanup
2014-01-08 09:47:12 +01:00
Dan Holmsand
176f7b885c
Make ratom macros less fancy
2014-01-07 20:32:00 +01:00
Dan Holmsand
53fef42768
Breaking change: Stop implementing IDeref in cloact components
...
Introduce set-state, replace-state and state functions instead.
Since we already have our own atom, it doesn't make any sense
to duplicate functionality. Also, the implementation was necessarily
very messy, and fragile.
2014-01-07 19:57:40 +01:00
Dan Holmsand
16c50fdf1d
Make equal-args use = less often
2014-01-07 12:43:53 +01:00
Dan Holmsand
4099c00838
Refactor template a bit
2014-01-06 18:35:05 +01:00
Dan Holmsand
11a1c62024
Wrap different React classes in distinct wrappers
...
That should improve performance a little, and help React's diffing
2014-01-06 16:35:39 +01:00
Dan Holmsand
dd3f9b10e1
Move equal-args out to util
2014-01-06 15:19:12 +01:00
Dan Holmsand
62322c474f
Add a couple of asserts, and a link
2014-01-05 13:29:22 +01:00
Dan Holmsand
2c2dca026c
Generate demo page
2014-01-05 11:16:01 +01:00
Dan Holmsand
9df8609f45
Update React to 0.8.0
2014-01-03 16:54:38 +01:00
Dan Holmsand
af45084966
Remove support for refs for now
...
It shouldn't be necessary for Cloact, since we can share data
between components using atoms. And it was broken and untested
anyway...
2014-01-03 16:40:10 +01:00
Dan Holmsand
cb60a6094f
Make conversion to js a tiny bit faster
2014-01-02 11:18:00 +01:00
Dan Holmsand
42f392f208
Only pass key and ref to react if necessary
2013-12-20 19:23:24 +01:00
Dan Holmsand
9344edc7da
Compare props map using identical? only
...
That makes shouldComponentUpdate even faster, especially with big
maps/vectors as args
2013-12-20 19:18:02 +01:00