Commit Graph

1101 Commits

Author SHA1 Message Date
Christoph Pojer 2fe2cd5337 Ensure ReactPerf always uses a string as a URL 2013-11-20 14:19:13 -08:00
Tim Yung 04c3e2e407 Add nextContext to componentWillReceiveProps
Add `nextContext` as an argument to `componentWillReceiveProps`. We can figure out what to rename the method to later.
2013-11-20 14:19:01 -08:00
Christopher Chedeau a23d43bf05 Use this.getDOMNode() instead of last argument of componentDidMount 2013-11-20 14:18:49 -08:00
Marshall Roch 934ef1d4c2 Fix context in callbacks
callbacks like shouldComponentUpdate, componentDidUpdate, etc. were getting the full, unsanitized context, instead of the one that's been filtered down to only the fields allowed to be visible by contextTypes.
2013-11-20 14:18:28 -08:00
Christopher Chedeau c8b6fe51d9 Use this.getDOMNode() instead of last argument of componentDidUpdate
Context is adding another argument that shifts all of them by one. Since we can already use this.getDOMNode(), it doesn't really make sense to pass it as an argument to that function.
2013-11-20 14:18:07 -08:00
Marshall Roch 3fd3341ab9 remove transaction argument from componentWillReceiveProps 2013-11-20 14:17:23 -08:00
Paul O'Shannessy 060118c7e4 order object properties consistently 2013-11-20 14:17:13 -08:00
Pete Hunt 3651b8892f Merge pull request #578 from spicyj/patch-2
autoBind -> Autobinding
2013-11-20 11:47:22 -08:00
Ben Alpert d49d84b250 autoBind -> Autobinding
We don't use the term autoBind anywhere any more.
2013-11-20 11:42:05 -08:00
Pete Hunt 0df4be849f Merge pull request #577 from stillmotion/master
Add explination of autoBind to DOM Event Listener tip
2013-11-20 11:41:11 -08:00
Levi McCallum ceaf3fba32 Add explination of autoBind to DOM Event Listener tip 2013-11-20 11:29:05 -08:00
Paul O’Shannessy bd1f5e7e16 Put nav data in "_data"
New in Jekyll 1.3 - http://jekyllrb.com/docs/datafiles/
2013-11-19 15:52:42 -08:00
Paul O’Shannessy f37fd7a7a3 Fix pagination 2013-11-19 15:25:00 -08:00
Paul O’Shannessy 378a49bf3c Update jekyll to 1.3 2013-11-19 15:18:15 -08:00
Vjeux 96e97c1a87 Community round-up #11 2013-11-19 22:56:34 +01:00
Paul O’Shannessy 5f22259964 Merge pull request #565 from chenglou/className-htmlFor
docs highlight className and htmlFor transforms
2013-11-19 11:01:10 -08:00
Jeff Morrison ab47e99215 Merge pull request #495 from syranide/fixutils
utils.* is now used everywhere
2013-11-19 10:59:16 -08:00
Cheng Lou 1fcd6412fb docs highlight className and htmlFor transforms 2013-11-18 21:42:51 -05:00
Cheng Lou ce0eec97db docs classSet semicolons missing 2013-11-18 21:22:14 -05:00
Paul O’Shannessy 5d2f0b4e07 Merge branch 'chenglou-classSet'
closes #463
2013-11-18 18:00:24 -08:00
Paul O’Shannessy e79079d174 Merge pull request #539 from spicyj/doc-anchors-again
Make doc headers clickable again
2013-11-18 17:45:39 -08:00
Ben Alpert e94ebee15e Make doc headers clickable again
...without preventing clicks on other things.

Just use an `<a name="...">` tag that doesn't take up any space to make sure that we're not covering up something else.

For whatever reason, doing `position: relative; top: -$navHeight;` doesn't work and causes the anchor target not to be moved up. This solution works in both Chrome and Firefox.
2013-11-18 17:34:44 -08:00
Ben Newman 5d878ce914 Merge pull request #550 from subtleGradient/subtlegradient/code-coverage
Code coverage grunt tasks.
2013-11-18 14:03:56 -08:00
Thomas Aylott 5ae152cdcf simplified the sort function 2013-11-18 16:37:47 -05:00
Thomas Aylott c6f7fe00fa Lines too long; reformatted 2013-11-18 16:37:47 -05:00
Thomas Aylott 45063aed44 picked all the lint 2013-11-18 16:37:47 -05:00
Thomas Aylott 5feb745b02 fixes the case when coverage isn't turned on 2013-11-18 16:37:47 -05:00
Thomas Aylott eda56b7af2 new grunt test:coverage task 2013-11-18 16:37:47 -05:00
Thomas Aylott 8f96ec255b new grunt browserify:withCodeCoverageLogging task 2013-11-18 16:37:47 -05:00
Thomas Aylott ad0d9e4761 consoleLoggerMiddleware handles coverage logs 2013-11-18 16:37:47 -05:00
Thomas Aylott b5b60a6acf speed up server middleware slightly 2013-11-18 16:37:46 -05:00
Thomas Aylott cb6b7f37e7 fixes an issue where the list of files to test isn't complete 2013-11-18 16:37:46 -05:00
Thomas Aylott ef5a02c164 enable coverage logging from the worker 2013-11-18 16:37:46 -05:00
Thomas Aylott 646421f71f batch logs until the end unless ran with --debug 2013-11-18 16:37:46 -05:00
Thomas Aylott 4c881d8487 require coverify 2013-11-18 16:37:46 -05:00
Thomas Aylott 5aa901336c ignore logs and testing stuff 2013-11-18 16:37:46 -05:00
Thomas Aylott 61c1bf0a41 fixes browserify task transforms support 2013-11-18 16:37:46 -05:00
Daniel Lo Nigro d853c8568e Propagate events to parent components when nested
When events are captured, the nearest React-rendered ancestor is found and events are propagated to its tree. This causes issues when components are nested as only the innermost component receives the events.

This change modifies this behaviour so events propagate all the way up the DOM hierarchy. To reduce the performance cost, this DOM traversal is only done if the component is actually nested (determined by the `containerIsNested` map which is lazily initialised).
2013-11-18 10:56:29 -08:00
Marshall Roch b91396be8e Contexts
Summary:
adds `this.context` which you can think of as implicit props, which are passed automatically down the //ownership// hierarchy.

Contexts should be used sparingly, since they essentially allow components to communicate with descendants (in the ownership sense, not parenthood sense), which is not usually a good idea. You probably would only use contexts in places where you'd normally use a global, but contexts allow you to override them for certain view subtrees which you can't do with globals.

The context starts out `null`:

  var RootComponent = React.createClass({
    render: function() {
      // this.context === null
    }
  });

You should **never** mutate the context directly, just like props and state.

You can change the context of your children (the ones you own, not `this.props.children` or via other props) using the new `withContext` method on `React`:

  var RootComponent = React.createClass({
    render: function() {
      // this.context === null
      var children = React.withContext({foo: 'a', bar: 'b'}, () => (
        // In ChildComponent#render, this.context === {foo: 'a', bar: 'b'}
        <ChildComponent />
      ));
      // this.context === null
    }
  });

Contexts are merged, so a component can override its owner's context **for its children**:

  var ChildComponent = React.createClass({
    render: function() {
      // this.context === {foo: 'a', bar: 'b'} (for the caller above)
      var children = React.withContext({foo: 'c'},() => (
        // In GrandchildComponent#render,
        // this.context === {foo: 'c', bar: 'b'}
        <GrandchildComponent />
      ));
      // this.context === {foo: 'a', bar: 'b'}
    }
  });
2013-11-18 10:56:24 -08:00
Pete Hunt 7df127db31 Better error message for renderComponentToString()
Reported on Twitter by AirBnb (who are integrating React into their open-source JS framework). They made a mistake and passed a string in as the
component. We should have a better error message for that.
2013-11-18 10:54:05 -08:00
Tim Yung 8529f1b053 Remove Obsolete IE8 Compatibility Code
See the TODO comment. Synthetic events have shipped and this is no longer necessary.
2013-11-18 10:54:03 -08:00
Marshall Roch 381a3392c6 Rename receiveProps to receiveComponent
This renames receiveProps and changes it to take the next component to copy props from instead of just the props. That is,

  component.receiveComponent(nextComponent, transaction)

instead of

  component.receiveProps(nextComponent.props, transaction)

This is a precursor to adding contexts, which will also need to get propagated just like props. This change allows ReactCompositeComponent to override `receiveProps` and do something like

  this._pendingContext = nextComponent.context;
2013-11-18 10:53:58 -08:00
Andreas Svensson a39b8fda70 utils.* is now used everywhere 2013-11-15 11:17:24 +01:00
Pieter Vanderwerff 1e1d7fe770 Set docs menu item to active when viewing a “tips” page 2013-11-15 15:27:31 +13:00
Paul O’Shannessy e6010bf75e Merge pull request #362 from mcsheffrey/feat-documentation-cookbook
React Tips documentation
2013-11-14 14:59:41 -08:00
Paul O’Shannessy d1fa53ca03 Cleanup lint warnings from recent testing changes
Also, relaxed a rule for dot notation (and unrelaxed it in src).
2013-11-14 11:24:06 -08:00
Connor McSheffrey 26c142df82 Merge pull request #20 from zpao/tips
Updates to tips
2013-11-14 11:17:34 -08:00
Ben Newman b61eacd3c5 Explicitly require the assert module in vendor/constants.js. 2013-11-14 13:48:08 -05:00
Paul O’Shannessy 1324eb5556 "use strict" in shouldUpdateReactComponent 2013-11-14 10:37:33 -08:00
Paul O’Shannessy 9cb3a3a182 Remove modules cache with grunt clean 2013-11-14 10:37:07 -08:00