Commit Graph

444 Commits

Author SHA1 Message Date
Dan Holmsand a074ac9825 Cleanup
Avoid compiler warnings, some commented code
2014-11-22 15:57:40 +01:00
Dan Holmsand a1c6990c18 Re-render components in mount order instead of tree depth
This should be more robust, and allows us to stop passing tree
levels along to every component.
2014-11-22 12:36:36 +01:00
Dan Holmsand 7244ffc25d Add test for wrap 2014-11-22 11:08:17 +01:00
Dan Holmsand f94fcd5542 Add equality test for cursor 2014-11-22 10:45:36 +01:00
Dan Holmsand 6b87349d88 Make sure returning new class from render works 2014-11-22 09:42:31 +01:00
Dan Holmsand a56f1c3ef1 Update React to 0.12.1 2014-11-20 13:35:53 +01:00
Dan Holmsand 30427973d6 Add some docs and assert 2014-11-20 13:13:11 +01:00
Dan Holmsand e76c4b9c72 Add wrap and new cursor functionality to core.cljs 2014-11-13 19:59:42 +01:00
Dan Holmsand 02ffe6bcfa Update cursor test 2014-11-13 19:58:56 +01:00
Dan Holmsand a8ea307f85 Add Wrapper, a [value callback] combo that looks like an atom 2014-11-13 19:56:27 +01:00
Dan Holmsand 347bb4d1a3 Try to make RCursor a bit more efficient and flexible
It now avoids unnecessary re-renderings, by comparing equality
with all its arguments, and by using a Reaction to filter out
only the changes that affects its value.

This also adds an optional setter callback, that is called instead
updating the parent atom directly.
2014-11-13 19:52:59 +01:00
Dan Holmsand 92fdf36aa5 Improve managed inputs
Make sure they are reset to their current value just after the
next render (if they are not changed during that rendering).
2014-11-13 19:42:48 +01:00
Dan Holmsand b1bec33448 Make todomvc feel more responsive 2014-11-11 11:08:43 +01:00
Dan Holmsand d188be004e Change links to point to reagent-project 2014-11-06 20:21:38 +01:00
Dan Holmsand cf84b88e60 Compare component arguments with = in shouldComponentUpdate
This makes most comparisons faster, and should result in fewer
re-renderings. And it should be a lot easier to explain and
reason about than the old heuristics.

It also makes it much easier to make custom objects, e.g. different
cursor implementations, avoid unnecessary re-renderings.

The main downside is that it is no longer possible to pass infinite
sequences to components.
2014-11-06 19:45:49 +01:00
Dan Holmsand d74ae49c70 Add to Changelog 2014-11-06 19:33:06 +01:00
Dan Holmsand 3f696a3922 Make sure render-to-string etc work better in a browser
Previously, they would be reactive, which could lead to all
kinds of strangeness.

Also fix pesky Closure warning.
2014-11-06 19:18:56 +01:00
Dan Holmsand 12d475fc62 Introduce render, render-to-string and render-to-static-markup
The new names correspond to changes in React in 0.12.0.

Both render-component and render-component-to-string are kept for
backward compatibility.

Call React.render etc to avoid deprecation warnings from React.
2014-11-06 11:34:51 +01:00
Dan Holmsand b491098d5e Avoid unnecessary object creation
And fix check for input/textarea
2014-10-29 21:16:45 +01:00
Dan Holmsand 0267f69d3b Use React.createElement throughout 2014-10-29 17:37:27 +01:00
Dan Holmsand a27edf81c8 Use isValidElement and createElement to avoid deprecation messages 2014-10-29 14:47:55 +01:00
Dan Holmsand a658d28d93 Start updating react to 0.12.0 2014-10-29 14:18:28 +01:00
Dan Holmsand 14d5efc3f0 Use plain old curl instead of bower to download React 2014-10-29 11:38:40 +01:00
Dan Holmsand 2a52b6da8e Use clojurescript 2342
Later versions won't work with Light Table yet
2014-10-29 11:17:57 +01:00
Dan Holmsand a555484e9c Version 0.4.3 2014-10-28 16:34:26 +01:00
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 0d71356183 Update to react v0.11.2 2014-10-15 18:54:44 +02:00
Dan Holmsand 6ce5bc16f5 Add test for null component return 2014-09-16 16:31:29 +02:00
Dan Holmsand e19c20d0cc Update React to 0.11.1 2014-09-14 10:59:55 +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 f8ca11e767 Update clojurescript and cljsbuild 2014-04-09 16:50:49 +02: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