Commit Graph

4843 Commits

Author SHA1 Message Date
petehunt fad7d58fc9 Update jsx-is-not-html.md 2013-06-17 03:11:57 -06:00
petehunt 97efa84676 Merge pull request #88 from vjeux/jsx_pitfall
Adding JSX pitfalls section in the docs
2013-06-17 02:05:55 -07:00
petehunt 22347ea54d Merge pull request #95 from groodt/patch-1
Small correction to tutorial.md
2013-06-17 01:36:51 -07:00
petehunt 46513c6d78 Merge pull request #96 from groodt/master
Very minor corrections to documentation
2013-06-17 01:26:31 -07:00
petehunt 1c7d01c2f4 Merge pull request #97 from spicyj/patch-1
Link to my own blog instead of Quora
2013-06-17 01:25:31 -07:00
ngavalas 7a0f2d71bb Add callbacks to all public-facing state/props methods
All public facing {set,replace,force}{props,state} methods now support
callbacks.
2013-06-16 22:45:36 -07:00
Ben Alpert 4104beadbb Link to my own blog 2013-06-15 18:59:45 -06:00
Greg Roodt 87f4b8be67 Minor grammar. 2013-06-15 11:08:06 +03:00
Greg Roodt 8d729d7da2 Minor typo. 2013-06-15 11:07:20 +03:00
Greg Roodt f016479289 Update tutorial.md
The ajax call happens every 5 seconds, not every 60 seconds.
2013-06-15 10:15:42 +03:00
ngavalas c81cc2e6d5 markdown syntax
Small problem with markdown syntax in syntax-highlighted block.
2013-06-14 16:41:02 -07:00
ngavalas f3aac85d01 Updated docs and check for truthiness
Change api docs to reflect presence of the new argument.  In addition,
callback was change to require only a "truthy" value.
2013-06-14 16:37:20 -07:00
ngavalas c6665e3460 Adds optional callback to `setState`
This commit adds an optional callback as a second argument to
`setState`, to be called after `setState` runs.

We never guarantee synchronous execution of `setState`, and as per
@phunt, we don't want to make that guarantee because we may eventually
batch calls to `setState`.  @jwalke agrees with him.
2013-06-14 16:23:06 -07:00
Timothy Yung c7295b9e09 Merge pull request #61 from spicyj/getdomnodeid
getDOMNodeID: Don't return .id on random objects
2013-06-14 11:27:44 -07:00
Ben Newman 9fd9f712bf Merge pull request #91 from yungsters/master
Fix `EventPluginRegistry` Unit Tests
2013-06-14 06:45:57 -07:00
Ben Alpert a9c70bcc1c getDOMNodeID: Don't return .id on random objects
If you defined a global named `id` (a horrible name, I know) then
getDOMNodeID(window) would return that object. Since only DOM nodes can
have IDs, this should be a noop change otherwise.

Test Plan:
Verified that document.documentElement and document.body both support
getAttributeNode properly in latest Chrome and in IE8.
2013-06-14 00:21:15 -07:00
Timothy Yung 80edd6ca87 Merge pull request #89 from vjeux/patch-4
Exposing ReactProps as React.Props
2013-06-13 21:08:10 -07:00
Timothy Yung 48f46b568d Merge pull request #92 from spicyj/fix-textchange
Fix textchange event enqueueing
2013-06-13 20:53:47 -07:00
yungsters 279792f891 Fix `EventPluginRegistry` Unit Tests
Dumping the mock cache isn't dirying the modules, so we have to unit test a different way. If we can fix our unit test framework, we should revert this.

Also, I added strict mode to `EventPluginRegistry.js`.
2013-06-13 20:38:23 -07:00
Ben Alpert 792b69ba11 Fix textchange event enqueueing
(Was broken by e1535fbd71d8c89c82cd9d9073c1ee97ee6a3b00.)
2013-06-13 20:34:14 -07:00
Paul O’Shannessy 06cff60bc1 Sync latest JSX transform - all children passed as separate arguments
This was a part of e1fe13d0cb upstream.
2013-06-13 18:18:54 -07:00
CommitSyncScript 770ec5946a Unbreaking falsy check on style values
Style values can be the number zero which is an actual value. So we check for
null instead. The empty string case falls through.
2013-06-13 17:49:04 -07:00
CommitSyncScript b525a0c061 Unnecessary `this._rootNodeID` Invariant
Summary: This invariant is unnecessary because `ReactComponent.Mixin.receiveProps` already asserts that this component is mounted. (Being mounted guarantees you have a DOM ID, look at `ReactComponent` and see when `this._rootNodeID` is mutated.)
2013-06-13 17:48:09 -07:00
CommitSyncScript 34970fd785 Fix tht typos 2013-06-13 17:47:59 -07:00
Paul O’Shannessy ceb5303581 Merge pull 75 upstream
Needed to make some small changes since we weren't synced when it was
merged.
2013-06-13 17:47:51 -07:00
CommitSyncScript f456f8fa8d Remove `isStatic`
This can be replicated with a custom component that always returns false`
from `shouldComponentUpdate`. A generic implementation might look like:

```
var StaticContainer = React.createClass({
  shouldComponentUpdate: function() {
    return false;
  },

  render: function() {
    return this.transferPropsTo(this.props.children[0]);
  }
});
```

And then used in JSX as
`<StaticContainer><div>Hello!</div></StaticContainer>`, resulting in
only `<div>Hello!</div>` being inserted into the DOM.
2013-06-13 17:40:52 -07:00
CommitSyncScript e1fe13d0cb Pass multiple children in JSX as additional arguments
This is an alternative to D809298. In normal usage you'd end up with a single
flat array in props.children.
2013-06-13 17:40:05 -07:00
CommitSyncScript 01511ea557 Remove Unnecessary DOM Mutations
This fixes an edge case that can cause unnecessary mutations in the DOM. Namely, if a prop is falsey, it will get touched on every update by reconciliation. See unit test.
2013-06-13 17:39:47 -07:00
CommitSyncScript 802241a660 Cleanup `style` Prop Reconciliation
This cleans up the reconcilation path when adding a `style` prop (going from a falsey or no `style` to having one) by reducing the need for an object allocation and for-loop.
2013-06-13 17:39:23 -07:00
CommitSyncScript e1535fbd71 Create `EventPluginRegistry`
The `EventPluginHub` module was getting huge and scary. This pulls out all of the logic required to inject plugins and publish their event registration names into a new `EventPluginRegistry` module.

Functionally, nothing should have changed. I added many error checks to cover edge cases that we were not yet running into, but they are all in `EventPluginRegistry` and unit tested.
2013-06-13 17:38:49 -07:00
CommitSyncScript aea8e16b4a Add `ReactComponent#isMounted`
There is currently no way for components to know whether or not they are mounted. This means there's no way for callbacks to figure out if they can make certain assumptions (e.g. can `getDOMNode()` or `setState()` be safely invoked).

This adds an `isMounted` protected method that lets components properly handle callback behavior when unmounted.
2013-06-13 17:38:20 -07:00
CommitSyncScript 0d6bb650cb Add HTML5 Drag/Drop events to React 2013-06-13 17:37:58 -07:00
Ben Alpert ddc4ffffa0 Don't let textarea value change via textContent
Turns out my tests before weren't particularly useful because
receiveProps doesn't end up running componentDidUpdate since the
transaction never finishes. Now they use replaceProps instead (and I
verified that commenting out the "rootNode.value = ..." line makes the
tests fail, which wasn't true before).
2013-06-12 19:12:52 -07:00
Vjeux d7a5f137ff Adding JSX pitfalls section in the docs 2013-06-13 03:08:50 +02:00
Christopher Chedeau 34173638d4 Exposing ReactProps as React.Props
Right now, even though ReactProps is committed, there is no way to use it as it is not exposed.
2013-06-12 18:28:25 -06:00
Timothy Yung c9618587ef Merge pull request #67 from vjeux/fb_comments
Facebook comments integration on Docs and Blog
2013-06-12 16:13:05 -07:00
Vjeux 101bfa3112 Facebook comments integration on Docs and Blog 2013-06-13 01:08:31 +02:00
Vjeux 523bde4dc5 Community round-up blog post 2013-06-12 13:55:51 -07:00
Jordan W 483350905b Merge pull request #86 from petehunt/fixed-width-height
Fixed width/height on React logo
2013-06-12 12:35:33 -07:00
petehunt 5b72334852 Fixed width/height on React logo 2013-06-12 12:33:38 -07:00
Ben Alpert d13a37ce22 Don't set value if it'll be a noop 2013-06-12 01:55:26 -07:00
Ben Alpert 0c6f4b3bcc Set textarea value when changing content
At http://jsfiddle.net/spicyj/W4QLq/, typing into the textbox would cause
clicking the button to do nothing; now it should work.
2013-06-12 00:14:58 -07:00
Timothy Yung 0e6fca4a38 Merge pull request #68 from vjeux/twitter
Integrate twitter in the support page
2013-06-11 22:34:44 -07:00
Timothy Yung dfd76be568 Merge pull request #75 from spicyj/textchange
Add new textChange event: input + IE shim
2013-06-11 22:00:19 -07:00
Ben Alpert 0dc08c2115 Missing semicolon 2013-06-11 21:54:50 -07:00
Ben Alpert 6b572b3f25 Refactor based on review feedback 2013-06-11 21:51:47 -07:00
Timothy Yung c6c40a5fb3 Merge pull request #84 from spicyj/remove-props
Correctly remove attributes when deleting props
2013-06-11 19:54:36 -07:00
Ben Alpert fdc6beed1a Fix nit and comment 2013-06-11 19:53:24 -07:00
Ben Alpert 731aa8ead1 internalPropNames isn't necessary, so remove it
Perhaps we'll bring it back as a future perf optimization if that
appears useful.
2013-06-11 19:02:35 -07:00
Ben Alpert 8762634cf1 Remove unused require 2013-06-11 17:28:06 -07:00