Commit Graph

6726 Commits

Author SHA1 Message Date
chico
655ac0f0dd update typescript 2016-05-19 19:24:40 -07:00
Ben Berman
eda08d9656 Minor comment typo (#6808) 2016-05-19 14:21:59 -07:00
Dan Abramov
d1256825bc Merge pull request #6801 from iamdustan/instrumentation-to-shared
Move instrumentation to renderers/shared. Closes #6797
2016-05-19 13:24:06 +01:00
Dustan Kasten
d51981eeea Move instrumentation to renderers/shared. Closes #6797 2016-05-18 22:34:09 -04:00
Tony Rossi
8ea1cf4ee0 Update shallowCompare to accept nextContext (#6661)
* Update shallowCompare to accept nextContext

Across our application we are using immutable objects as properties and thus using shallowCompare for all our {{shouldComponentUpdate}}.  Because of this children with contextTypes don't get updates when the context on the parent changes.  Adding an additional comparison for context (when it is provided) fixes this problem.

* Remove the undefined check

* Add nextContext
2016-05-17 16:50:23 -07:00
Dan Abramov
7f08961604 Merge pull request #6789 from gaearon/tree-devtool-fixes
Make sure element is reported correctly by tree devtool
2016-05-17 23:34:58 +01:00
Dan Abramov
1070b4aa6c Make sure element is reported correctly by tree devtool
This adds some tests for getElement() and verifies that it works for text components too.
The code that calls the instrumentation is fixed where necessary so that the tests pass.
2016-05-17 23:07:35 +01:00
Jim
2e881aa4b4 Fire unknown prop warning when rendering client side. (#6693) 2016-05-17 15:06:31 -07:00
Dan Abramov
4ab203cd73 Test that elements are tracked by tree devtool
The test is currently failing because text elements are not reported in some cases.
2016-05-17 22:16:53 +01:00
Dan Abramov
503cbd3356 Merge pull request #6787 from gaearon/tree-devtool-test-tweaks
Refactor ReactComponentTreeDevtool test
2016-05-17 21:15:49 +01:00
Dan Abramov
9301cfbc80 Refactor ReactComponentTreeDevtool test
We extract common logic between DOM and native tests so they don't diverge.

Also, rather than build a tree object in advance for testing, we will walk the tree on the go.
This lets us have much more specific error messages with a clear path when something goes wrong.
2016-05-17 20:51:00 +01:00
David Aurelio
151e1d7014 Require modules from React Native as node modules. (#6715) 2016-05-16 13:03:38 -07:00
Ben Alpert
6afd51061a Embed JSX filename paths relative to repo root (#6778)
Test Plan: Changed the preprocessor to log the output of babel.transform and saw

```
var _jsxFileName = 'src/isomorphic/modern/element/__tests__/ReactJSXElementValidator-test.js';
```

in the resulting output, instead of an absolute path.
2016-05-16 11:15:12 -07:00
Sebastian McKenzie
3703b63a11 Remove unnecessary require causing excess memory usage (#6781) 2016-05-16 08:52:05 -07:00
Rachel D. Cartwright
207fe0b478 make test utils format consistent (#6777) 2016-05-15 13:46:03 -07:00
Ben Alpert
378c879a6a Show component stack in PropTypes warnings (#6771) 2016-05-14 17:40:39 -07:00
Ben Alpert
3cc733add4 Fix severe perf problems in component tree devtool (#6770)
One of the ReactMultiChildText tests renders 2145 roots (and even more components) and unmounts none of them. Now we don't loop through them all a bunch of times so the test takes 20 seconds instead of 60.

We should clean up instantiateReactComponent somehow so that the onSetDisplayName call isn't produced for the TopLevelWrapper, which should allow us to just store an array of unmountedIDs instead of a hash map so we at least don't have double maps. This change mirrors the old logic though.

Reviewers: @gaearon, @sebmarkbage
2016-05-14 12:13:48 -07:00
Ben Alpert
5b5bd5eb75 Print stack in devtool exception warning (#6768) 2016-05-14 12:12:19 -07:00
Ben Alpert
03f4ba260b Track source more generically in ReactComponentTreeDevtool (#6765)
Being able to get the source for your parent components seems useful, and ReactComponentTreeDevtool is best poised to be able to do that.

I'm also not sure it makes sense to have separate DOM-specific `onMountDOMComponent` and `onUpdateDOMComponent` events, so I removed them for now. Even if we want them, their timing seemed sort of arbitrary.

I also made it so DOM devtools can listen to non-DOM events too. Willing to change that if people think it's ugly though.
2016-05-14 12:12:12 -07:00
Ben Alpert
c0007d56e9 Interleave trials in benchmark script
This should be more of a fair A/B test so the timings aren't affected by having different load on your system when testing the two alternatives.
2016-05-14 12:04:25 -07:00
Ben Alpert
cab835d3a0 Make benchmark script work in React 15 2016-05-14 12:03:51 -07:00
Nima Jahanshahi
32c750de5c Fixed an invalid escape char in attribute name regexp (#6772)
more info: https://www.w3.org/TR/xml/#NT-Name
2016-05-14 10:10:30 -07:00
Dan Abramov
74cce27fe0 Merge pull request #6767 from gaearon/fix-broken-master
Fix remaining onNativeOperation => onHostOperation rename
2016-05-14 01:47:31 +01:00
Dan Abramov
dea7cafd9d Fix remaining onNativeOperation → onHostOperation rename
We renamed it in #6754 but #6748 got merged after that referencing the old name.
2016-05-14 01:09:53 +01:00
Dan Abramov
5569d1d40e Merge pull request #6763 from nfcampos/is-running
added isProfiling() to ReactDebugTool and isRunning() to PerfTools
2016-05-13 20:50:38 +01:00
Nuno Campos
5b93a2bdbe added tests for repeated calls to ReactPerf.start/stop 2016-05-13 20:28:14 +01:00
Nuno Campos
201d03268e changed test 2016-05-13 08:24:25 +01:00
Ben Alpert
20bcabb1ea Remove some dead code (#6764) 2016-05-12 17:10:18 -07:00
Chad Fawcett
5d64199bb6 Add information on JSX element keys (#6751) 2016-05-12 17:02:07 -07:00
Dmitriy Kubyshkin
0e889d7c72 Fixed removing attributes during custom element update. Fixes #6747 (#6748) 2016-05-12 17:00:04 -07:00
Nuno Campos
a027d15aff added isProfiling() to ReactDebugTool and isRunning() to PerfTools 2016-05-12 19:27:05 +01:00
hao.huang
92bebcad5f Add permalink (#6713)
Add permalink to docs, so we can access with 'prev' and 'next'
2016-05-12 08:57:45 -07:00
djskinner
712b1f75bf Refer to correct example (#6760)
I *think* this should refer to the second example, where the instance to the ref is stored. In any case please can someone confirm for my own understanding?
2016-05-12 07:49:02 -07:00
Ben Alpert
ba9b985406 Rename host-y things to be "host" not "native" (#6754)
For clarity.

I left "native event" as-is because there's a lot of it, it's not particularly ambiguous, and SimulateNative/nativeTouchData are public API in ReactTestUtils.
2016-05-11 23:22:59 -07:00
Dan Abramov
de1bb7a71f Merge pull request #6753 from facebook/fix-6750
Fix a memory leak in ReactComponentTreeDevtool
2016-05-12 03:41:55 +01:00
Dan Abramov
3779a5d18c Fix a memory leak in ReactComponentTreeDevtool
`ReactDebugTool` used to only call `purgeUnmountedComponents()` while profiling, so information about unmounted instances kept accumulating when not profiling.

Additionally, unmounting in React Native and rendering to string did not correctly clean up the devtool.

Finally, the tests tested the wrong behavior and relied on explicit `purgeUnmountedComponent()` calls.

To fix this, we:

* Test specifically that unmounting is enough to clean up the tree devtool.
* Add missing `onBeginFlush` and `onEndFlush` calls to server and native rendering so `ReactDebugTool` knows when to copy the tree.

Fixes #6750
2016-05-12 03:19:55 +01:00
Dan Abramov
027d9a919b Merge pull request #6752 from facebook/fix-6742
Fix ReactPerf.printOperations() crash
2016-05-12 02:59:46 +01:00
Dan Abramov
9cebc26638 Fix a failing test and count IDs from one 2016-05-12 02:45:09 +01:00
Dan Abramov
f0594d2792 Remove the protective clause that is now unnecessary
Instead, we fixed the callsites to stop emitting events for empty components.
2016-05-12 00:50:18 +01:00
Dan Abramov
d80723b237 Check for missing debugID in ReactDebugTool
TopLevelWrapper and empty components have ID of 0.
These are implementation details and we don't want to leak them to devtools.
2016-05-12 00:45:07 +01:00
Dan Abramov
1559111bf9 Switching between null and a native should not be counted as a waste 2016-05-12 00:05:32 +01:00
Dan Abramov
0cd1d3b5a2 Allow empty components in the native operation logs
Fixes #6742
2016-05-11 23:31:50 +01:00
Marshall Bowers
6b1232aa86 Add basic issue and PR templates (#6597)
Issue template adapted from the Angular template, and PR template
adapted from the PR guidelines in CONTRIBUTING.md.
2016-05-11 15:30:25 -07:00
Dan Abramov
c8a7988bf9 Add a failing test case for #6742
getOperations() blows up when replacing null with a native because the null component has debugID of 0 that isn’t registered in the component tree.
2016-05-11 23:27:48 +01:00
Jarrod Mosen
01b060d7dc Fix grammar on homepage (#6746)
* Fix grammar in README

* Change DOM abstraction grammar on homepage
2016-05-11 15:03:05 -07:00
yiminghe
b11540ccb2 consistent owner for stateless component (#6534) 2016-05-10 22:21:16 -07:00
Sebastian Markbåge
cf157886e9 React Fiber Reconciler (#6690)
This is an outline for the new reconciler infrastructure.

I created a noop renderer to have something to get started from.

I split the reconciler folder into old and new, as well as shared.
I put shouldUpdateReactComponent in shared as an example of a
utility that can easily be shared between both. I plan on breaking
out more utilities like these.
2016-05-10 18:24:57 -07:00
Sebastian Markbåge
069f8099d6 Fix flow errors (#6719)
The new flow somehow found these on my machine but nowhere else
and not previously.
2016-05-10 11:56:32 -07:00
Ben Alpert
98cb2f8507 Revert "Don't wrap drag events in IE/Edge in dev builds" (#6741) 2016-05-10 10:58:35 -07:00
Dan Abramov
7bf96c08e6 Merge pull request #6377 from puradox/proptypes-symbol
Add new primitive PropType `Symbol`
2016-05-10 15:09:12 +01:00