Commit Graph
252 Commits
Author SHA1 Message Date
Desmond Brand db175052c0 Add links to docs for addons and top level API (#6555)
This makes it easier to figure out where the docs live.

Googling for e.g. `react-addons-update` also works, but this should
make things easier for people that hyperclick directly to the source.
2016-05-02 06:14:28 -07:00
cpojer 8e34514096 Update to Jest 12. Codemod to new Jest APIs. 2016-04-28 14:54:57 +09:00
Ike Peters 9df54e0fce properly handling invalid scryRenderedDOMComponentsWithClass args (#6529)
properly handling invalid scryRenderedDOMComponentsWithClass args

properly handle invalid scryRenderedDOMComponentsWithClass args
2016-04-21 17:09:04 -07:00
Dan Abramov 3b28602220 Ignore DOM writes outside the batch in ReactPerf
ReactDOMInput and a few other classes handle change event by scheduling updateWrapper() in an asap().
It gets executed after the batch, which confuses ReactPerf that expects all DOM writes to happen during a batch.
Since this implementation of ReactPerf relying on the stack is going away, let's plug the hole temporarily by ignoring DOM writes that occur during postponed updateWrapper(). In any case, they have no relation to actual calculations of wasted renders, as they don't occur due to updateComponent(), but rather due to onChange() special DOM behavior.

This fixes #5548
2016-04-14 20:57:44 +01:00
Dan Abramov ae56910573 Merge pull request #6362 from gaearon/no-owner-in-test-utils
Elements from functional components in TestUtils should have no owner
2016-04-14 18:54:10 +01:00
Paul O’Shannessy 95cd88d07a Ensure default injection is injected for test utils 2016-04-06 17:43:08 -07:00
Paul O’Shannessy 42b1cba048 Make sure simulated events don't warn when providing extra event properties 2016-04-05 14:53:25 -07:00
Paul O’Shannessy 1573baaee8 Use Object.assign directly and inject object-assign at compile 2016-04-04 09:53:25 -07:00
Dan Abramov 291379c272 Elements from functional components in TestUtils should have no owner
Fixes #5292 and #6194
2016-03-28 21:46:33 +01:00
Dan Abramov 0f1240e877 Fix ReactPerf.printOperations() test to work with createElement = false 2016-03-23 22:24:32 +00:00
Dan Abramov cfec10bd51 Remove unused export from DOMChildrenOperations 2016-03-19 21:05:05 +00:00
Dan Abramov b6547734c6 Strip complex values from ReactPerf.printDOM() output
Fixes #6288
2016-03-17 21:23:43 +00:00
Dan Abramov ea55d66760 Rename ReactPerf methods to match the upcoming ReactPerf revamp 2016-03-17 20:18:42 +00:00
Dan Abramov b322d65320 Fix the ReactDefaultPerf test to match changes in #6286 2016-03-17 19:23:21 +00:00
Dan Abramov 51d37c64c3 Make ReactPerf measurements opaque
We intend to change the measurement format significantly in #6046. In order to introduce the new ReactPerf during 15.x release cycle, we are making the measurement structure opaque-ish in 15.0.
2016-03-17 18:48:55 +00:00
Paul O’Shannessy 093bb22030 Update lint config, dependencies, fix issues
This also fixes messages from new synthetic events warnings
2016-03-03 10:16:02 -08:00
Michael McDermott 18af9bc91e Fixed some linting warnings and some mis-spacing in SyntheticEvent warnings. 2016-03-02 18:40:23 -05:00
Ben Alpert e8fb8c7870 Fix text component rendering with server markup
These weren't caught by CI in #5753 because we don't automatically test that yet... fixing that next.
2016-02-19 09:48:05 -08:00
Michael Wiencek 203850013a Don't wrap text in <span> elements
Instead, use opening and closing comment nodes to delimit text data.
2016-02-18 13:49:14 -06:00
Ben Alpert 3a4e1dbb5b Fix merge conflict in #4940 2016-02-17 17:20:37 -08:00
Ben Alpert acb49363d5 Remove "construct" call except on composites
This is a little simpler (and a teeny tiny bit faster). The one in ReactCompositeComponent stays because of the way we create ReactCompositeComponentWrapper inside instantiateReactComponent.
2016-02-17 15:48:24 -08:00
cpojer 383e2f938d Update to jest-cli 0.9. 2016-02-17 13:01:14 +09:00
jim dd390b3e36 Errors in componentWillUnmount should be caught by error boundary on initial render. 2016-02-11 17:44:35 -08:00
Paul O’Shannessy 422b4e105c Merge pull request #5840 from koba04/release-event-target-on-destructor
Release syntheticEvent.target on the destructor
2016-01-15 16:38:42 -08:00
Toru Kobayashi be0551d01e Release syntheticEvent.target on the destructor 2016-01-14 15:09:56 +09:00
jim e8af100849 Removed getDOMNode from react classes. 2016-01-11 23:32:22 -08:00
Ben Alpert 0ebc7b60e1 Revert "Merge pull request #5689 from jimfb/cleanup-5151"
This reverts commit 067547c1d1, reversing
changes made to 102cd29189.
2016-01-05 15:08:15 -08:00
Jim 067547c1d1 Merge pull request #5689 from jimfb/cleanup-5151
Get rid of getNativeNode()
2016-01-05 14:42:05 -08:00
Rick Beerendonk bef45b0b1a Year-agnostic copyright message, like React Native uses, to prevent the need for yearly changes. 2015-12-29 20:20:32 +01:00
jim 8eabf84204 Get rid of getNativeNode() 2015-12-17 19:04:27 -08:00
Justas Brazauskas 0886273438 Fix few typos in React docs and comments 2015-12-13 16:39:07 +02:00
Ben Alpert 46f5251c66 Remove @typechecks
These don't really do anything.

```
codemod.py -d src --extensions js -m '\s* \* @typechecks.*?\n' '\n'
```

with "yes to all".
2015-12-10 11:26:45 -08:00
Scott Feeney 9c21e2f3c4 shallow render: fix setState in componentWillMount 2015-12-01 19:43:52 -08:00
Ben Alpert 418ba27485 Kill global queue in ReactMultiChild
As we move away from using HTML for updates, this becomes less useful.
2015-11-25 12:59:02 -08:00
Ben Alpert 812e1a877f Merge pull request #5500 from hejld/master
Update DOM_OPERATION_TYPES mappings for ReactDefaultPerfAnalysis
2015-11-20 11:21:06 -08:00
Sebastian Markbåge 64f795e5ef Merge pull request #5411 from simonewebdesign/master
ReactShallowRenderer.render returns the rendered output
2015-11-20 11:20:37 -08:00
hejld a3779421a1 Update DOM_OPERATION_TYPES mappings for ReactDefaultPerfAnalysis 2015-11-18 20:58:32 +01:00
Ben Alpert 1a6d1e74e0 Merge pull request #5330 from laskos/fix-shallow-rendering-function-refs
Fix shallow renderer with ref as function
2015-11-17 23:53:00 -08:00
Simone Vittori c8b8c818b5 ReactShallowRenderer.render returns the rendered output 2015-11-08 13:07:07 +00:00
Tay Yang Shun d16754125f More consistent error message for findRenderedDOMComponentWithX 2015-11-06 03:05:08 +08:00
Ben Alpert 9419976e51 Revert #4993 with an added test for refs
We were shallow-rendering a component that used refs at FB so this can't go in as-is. It's a little unclear what we _should_ do though, since there is nothing to hold a ref to (since we're shallowly rendering) and we generally promise that child refs are resolved before a parent's componentDidMount. Also, changing shallow rendering to use the original `_renderValidatedComponent` (instead of `_renderValidatedComponentWithoutOwnerOrContext`) breaks tests because now the `_owner` field doesn't match up for `toEqual` (non-null in `getRenderOutput` but null if constructed in a test).
2015-11-04 17:53:40 -08:00
Ben Alpert 3cebadaa6b Remove now-unused _rootNodeID from composites 2015-11-04 11:39:44 -08:00
Ben Alpert 663c4b7d2e Stop relying on hierarchical IDs in ReactDefaultPerf 2015-11-04 11:39:43 -08:00
Ben Alpert 5d94d7d43c Perf: Static children count for wasted time 2015-11-04 11:39:43 -08:00
Ben Alpert 4ba0e95a96 Kill ReactMount.getNode/getID/purgeID with fire 2015-11-04 11:39:43 -08:00
Ben Alpert 796f8c353c put/deleteListener take an instance, not an ID
This removes SimpleEventPlugin's dependency on ReactMount.getID.
2015-11-04 11:39:43 -08:00
Ben Alpert f470cb88f8 Events: Pass native instances up until propagation
Next step: take advantage of having the native instances in EventPropagators instead of converting right back to IDs.
2015-11-04 11:39:43 -08:00
Ben Alpert ce528457a4 ReactDOMComponentTree
New module! With this, we have a new module that uses the component tree to store DOM nodes. Most of the logic in this file relates to markup adoption -- if we were to drop that (along with server rendering) this file could just be a `return inst._nativeNode;`.

This works with useCreateElement only because we need to reference each node as it's created.

Events is now the only thing using ReactMount.getNode -- I'll introduce pointers back from the DOM nodes (and a `ReactDOMComponentTree.getInstanceFromNode`) and make that work.
2015-11-03 17:03:40 -08:00
Ben Alpert 5a7c273a1b Always do useCreateElement for updates
Initial render can still be a markup string.
2015-11-03 17:03:40 -08:00
Ben Alpert c802e9ede9 Test fixups after #4993 2015-11-02 18:26:52 -08:00