Commit Graph
8142 Commits
Author SHA1 Message Date
Sebastian MarkbågeandGitHub 51d7fa6606 Move DOM dependent tests out of the shared folder (#8954)
We have a bunch of tests that are meant to test generic React behavior.
However, we've written the tests against the DOM renderer. This moves
tests that depend on ReactDOM or ReactTestUtils out of the shared repo.

This will let us sync the shared repo directly to environments that don't
support running these tests. Such as React Native.
2017-02-08 10:20:02 -08:00
Dan AbramovandGitHub 91f6cd7ee1 Re-add the warning if PropType function is called manually (#8903)
* Revert "Revert "Warn if PropType function is called manually (#7132)""

This reverts commit be71f76ed8b7dbad25e3519455605252d3daf683.

In other words, now we again have the warning if you attempt to call PropTypes manually.
It was removed in #8066 but we shouldn't have done this since we still want to avoid people accidentally calling them in production (and even more so since now it would throw).

Fixes #8080.

* Pass secret in ReactControlledValuePropTypes

* Record tests
2017-02-08 16:29:19 +00:00
Dhyey ThakoreandKevin Lacker 5f56402914 update react perf docs (#8060) and (#6174) (#8236)
* update react perf docs issue 8060 and 6174

* Grammar

Small stuff
2017-02-07 14:00:08 -08:00
Dan AbramovandGitHub ea898d9fd6 Fix lint (#8945) 2017-02-07 14:42:09 +00:00
Andrew ClarkandGitHub a8f8d8fd10 Merge pull request #8919 from acdlite/fibermounttests
[Fiber] Mount/unmount warnings and invariants
2017-02-06 18:00:50 -08:00
Andrew Clark 59c5ad881e Split into multiple invariants
That way the messages are extracted by the error code transform.
2017-02-06 17:59:53 -08:00
Andrew ClarkandGitHub a55a873555 Merge pull request #8937 from acdlite/inlineinternalerrormessage
Inline internal error message
2017-02-06 17:44:26 -08:00
Andrew ClarkandGitHub e1969e0fc8 Merge pull request #8936 from acdlite/removemapsaschildren
Remove experimental support for maps as children
2017-02-06 17:14:30 -08:00
Andrew Clark 02d3530a3c Continue warning if a Map is rendered as a child
The entries of a map are a two-element array of [key, value], which
React will treat as fragments with children. This is unlikely to ever
be the intended behavior, so we warn.
2017-02-06 17:07:19 -08:00
Andrew Clark 65d0567f72 Remove experimental support for maps as children 2017-02-06 15:51:19 -08:00
Andrew Clark 661f04746e Inline internal error message
So that it is stripped out by the error code transform
2017-02-06 15:43:47 -08:00
Andrew ClarkandGitHub 5b9a6d075c Merge pull request #8926 from acdlite/fiberuseinvariant
[Fiber] Replace `throw new Error` with invariant module
2017-02-06 14:49:14 -08:00
Andrew Clark d6dae88516 Add additional message to internal invariants
The message tells users that the error is likely due to a bug in React,
and that they should file an issue.
2017-02-06 14:43:57 -08:00
Andrew Clark eb93217455 Get rid of DEV only invariant 2017-02-06 14:43:22 -08:00
Andrew Clark 9f8bf130de Replace throw new Error with invariant module 2017-02-06 14:43:14 -08:00
Andrew Clark 223930a0cf Run test script 2017-02-06 14:22:27 -08:00
Andrew Clark 911a1e9705 Rendering into an empty React-rendered element should not warn
Only warn if the container has a React-rendered child.
2017-02-06 14:22:16 -08:00
Sebastian MarkbågeandGitHub eb279a3b28 Only expose FiberRoot at the top level instead of a Fiber (#8934)
It is strange to get a handle on the Fiber since it is one of possibly two
root Fibers. The correct way to get the current Fiber is through the
root.current.

I exposed the Fiber originally because I thought we might use it for
Portals but we went with a different approach. So we don't need this.
2017-02-06 13:19:33 -08:00
Andrew ClarkandGitHub a898877b7f Merge pull request #8927 from mitenka/patch-5
Update higher-order-components.md
2017-02-06 11:42:31 -08:00
Jon BretmanandDan Abramov b46facb174 Bump fbjs to 0.8.9 (#8910) 2017-02-06 19:02:17 +00:00
Dan AbramovandGitHub 142d2bf7f4 Inject DevTools integration for RN Fiber (#8930) 2017-02-06 17:36:59 +00:00
KBandDan Abramov c2d1dd8bc8 [docs] Add note about refs on stateless components (#8916)
* Add note about refs on stateless components

* Move info about refs in the stateless components to the main section

* Simplification of the part about refs and functional components

* Tweaks

* Move sections around

* Oops

* Rearrange more sections
2017-02-06 16:49:36 +00:00
António Nuno MonteiroandDan Abramov da8744d908 Change the order between function declaration and object assignment (#8895)
This fixes #8894
2017-02-06 16:02:13 +00:00
Dmitry Zhuravlev-NevskyandGitHub 8befa1f7c0 Update higher-order-components.md 2017-02-04 03:35:06 +03:00
Ben AlpertandGitHub ad087236d2 Ensure first error is thrown if HostRoot catches two errors in commit phase (#8923)
Previously, we were overwriting capturedErrors with the second error and throwing that one.
2017-02-03 11:12:28 -08:00
Diego MuraccioleandDan Abramov f50fd551c4 Add onToggle event to details tag (#8831)
* Add onToggle event to details tag

Fixes #8761

* Map onToggle event on ReactDOMFiberComponent

* Tweak doc

* Trap events on setInitialProperties for details tag
2017-02-03 10:25:09 +00:00
Andrew ClarkandGitHub 8ceeacec2e Merge pull request #8921 from facebook/revert-8907-fiberproderrorcode
Revert "Loosen assertion so it matches any production error"
2017-02-02 15:24:04 -08:00
Andrew Clark 6234f5dd6d Revert change to test
See: https://github.com/facebook/react/pull/8907#issuecomment-277111278
2017-02-02 15:22:28 -08:00
Andrew ClarkandGitHub 1ff8a4e55e Merge pull request #8907 from acdlite/fiberproderrorcode
Loosen assertion so it matches any production error
2017-02-02 14:42:23 -08:00
Andrew Clark bb0cb00daf Warn if unmounting a tree that was rendered by a different copy of React 2017-02-02 14:30:12 -08:00
Dan AbramovandGitHub 265a4b3b91 Move component base classes into a single file (#8918) 2017-02-02 20:24:39 +00:00
Andrew Clark 651a8e8587 Warn when rendering into React-rendered child that isn't a root 2017-02-02 12:18:18 -08:00
Andrew Clark 4a0e190c8a Warn when mounting into document.body 2017-02-02 12:18:18 -08:00
Andrew Clark c91d46fde3 Add extra invalid element info to invariant message 2017-02-02 12:18:18 -08:00
Andrew Clark 0dfa1987c2 Fix messages so that they use the same template as Stack
The production error code system depends on the exact template string
that is passed to `invariant`. This changes the Fiber templates to
match the Stack ones.
2017-02-02 12:05:00 -08:00
Andrew Clark c248600fc4 Loosen assertion so it matches any production error
The exact error code isn't important.
2017-02-02 11:17:56 -08:00
Pontus AbrahamssonandDan Abramov a98d305bea Update conferences.md (#8915)
* Update conferences.md

* Move confs around
2017-02-02 13:37:27 +00:00
Omid HezavehandDan Abramov 9476dfc91e Explain arbitrariness of ref name in callback (#8913)
* Explain arbitrariness of ref name in callback 

The sample code was confusing because it's not clear that "textInput" in this.textInput is an arbitrary name for the ref.

* Tweak wording
2017-02-02 13:33:12 +00:00
Dan AbramovandGitHub 5fd07d03b3 Fix indentation in tutorial (#8914) 2017-02-02 13:24:26 +00:00
EduardandKevin Lacker 9b52bb2ca6 Update tutorial.md (#8896)
* Update tutorial.md

The status <div> used in Board can be deleted as well from render.

* Little tweaks
2017-02-01 18:12:00 -08:00
Tiago FernandezandKevin Lacker 8c042a2439 Link to CodePen editor rather than final result (#8849)
People want to see the final JS/CSS/HTML, and the final result is already displayed by CodePen.
2017-02-01 18:02:44 -08:00
Jeffrey WanandKevin Lacker 20776d818a Update tutorial.md (#8792)
* Update tutorial.md

* Fix quoting to be consistent
2017-02-01 17:42:19 -08:00
John LonganeckerandKevin Lacker e5ec539897 Lifting State Up more legible (#8691) 2017-02-01 17:31:01 -08:00
Andrew ClarkandGitHub ba1481cd27 Merge pull request #8905 from acdlite/fiberfinddomnodeunmount
[Fiber] findDOMNode during componentWillUnmount
2017-01-31 16:05:05 -08:00
Andrew ClarkandGitHub c8fd4fcc23 Merge pull request #8908 from acdlite/fiberemptycomponent
[Fiber] Fix formatting of invalid element invariant
2017-01-31 16:03:54 -08:00
Andrew Clark 175c33edb6 Fix formatting of invalid element invariant
Message is slightly different for functional and class components.
2017-01-31 15:29:53 -08:00
Andrew ClarkandGitHub 6195235407 Merge pull request #8893 from gaearon/fix-dom-prod-test
Add process.cwd to the test process shim
2017-01-31 15:04:39 -08:00
Andrew ClarkandGitHub f15f047491 Merge pull request #8906 from acdlite/warningnewline
Add missing newline to warning
2017-01-31 14:42:21 -08:00
Andrew Clark f7dc8606e0 Add newline to warning 2017-01-31 14:41:14 -08:00
Andrew Clark 2975a34a1f Don't swap the trees until after the first pass of the commit phase,
where componentWillUnmount is called, but before the second pass,
where componentDidMount/Update is called.
2017-01-31 14:39:52 -08:00