Commit Graph
7559 Commits
Author SHA1 Message Date
Dan AbramovandGitHub ee9da911a1 Merge pull request #8339 from nolanlawson/patch-1
Update 2016-11-16-react-v15.4.0.md
2016-11-18 12:27:16 +00:00
Dan AbramovandGitHub 43ca98d87e Merge pull request #8332 from gaearon/prod-dev
[Docs] Expand Installation and clarify why use bundlers
2016-11-18 12:26:22 +00:00
Dan AbramovandGitHub 846236458c Nits 2016-11-18 12:26:06 +00:00
Dan AbramovandGitHub 0bb536a221 Nit 2016-11-18 12:25:23 +00:00
Nolan LawsonandGitHub 00b2c8f335 Update 2016-11-16-react-v15.4.0.md
Edge and IE11 both show user marks and measures in the Dev Tools, so it's technically not accurate to say that only Chrome has this feature.
2016-11-17 15:53:41 -08:00
Tom OcchinoandGitHub 96722b8263 Upgrade ESLint and dependencies, fix new lint errors, switch Travis to Yarn (#8309)
* Update ESLint to 3.10.2

Also pull in fbjs for extending properly, per @zpao. This also disables consistent-return, which has about 80 failing cases in React currently. If we'd like to turn this back on, we should do it separately and fix all the call sites properly (rather than just adding 'return undefined;' everywhere, which adds no value.

Fixes to all existing lint errors plus an update for yarn.lock to follow.

* Update yarn.lock after the eslint update.

* Fix all new eslint failures

Unfortunately I had to add three eslint-disable-next-line instances. All have explanations inline.

* Switch Travis to use yarn instead of npm
2016-11-17 22:16:44 +00:00
Dan AbramovandGitHub bd40f3ab85 Merge pull request #8335 from lacker/newlink
add link to useful doc
2016-11-17 19:09:04 +00:00
Ben AlpertandGitHub 16d940fa7d Make numerical refs work in Fiber (#8334) 2016-11-17 18:56:33 +00:00
Kevin Lacker 00e292d563 add link to useful doc 2016-11-17 10:49:02 -08:00
Dan Abramov 72af0cc753 Update installation instructions on the blog 2016-11-17 16:05:49 +00:00
Dan Abramov 33a292f203 Explain Installation in more detail 2016-11-17 15:55:56 +00:00
Dan AbramovandGitHub 7225a5c0fb Merge pull request #8317 from marcysutton/master
docs(forms): add missing labels to forms doc
2016-11-17 14:25:03 +00:00
Dan Abramov 8f5a4f59da Tweak examples 2016-11-17 14:23:20 +00:00
Kevin LackerandGitHub f914375753 include the version number in the header (#8315) 2016-11-16 16:26:21 -08:00
Marcy SuttonandGitHub 0bc703eae5 fix(a11y): add missing labels to forms doc
Showing how to create a form without labeling inputs is an accessibility anti-pattern. This change adds labels to the examples to address that. Codepen may still need to be updated depending on how that example is created.
2016-11-16 14:32:42 -08:00
Dave VoylesandKevin Lacker 246b931007 Clarity on constructor of Board object for tutorial.md (#8224)
* Update tutorial.md

Is it possible to be more clear here?
 This implies that we are removing the constructor from GAME, and not board (which is what I believe the author is trying to say).
It took me several reads to understand. 

With this edit, it is now clear that the adjustment is being made to -Board- and not to -Game-

* also remove "for Board earlier"
2016-11-16 13:24:45 -08:00
TannerandKevin Lacker df53fef16f Remove spread operator (#8273)
* Remove spread operator

I believe what was meant here was to express that you would create the new player object with all the previous properties of the existing player object in addition to now updating the score value. That being said, this is a simple example, and the player object clearly has no other values. Objects are not (by default) iterable using this operator, so this little piece does more harm than good. I believe the new example to be much clearer.

* Using Object.assign()

* Tweak wording
2016-11-16 11:59:16 -08:00
Sebastian MarkbĂĄgeandGitHub ebd588117c Merge pull request #8232 from sebmarkbage/treetraversal
Add support for Fibers in ReactDOMComponentTree and ReactTreeTraversal
2016-11-16 16:59:32 +01:00
Sebastian Markbage 1038737a81 Extract event listener from memoizedProps on Fiber instances
This makes some basic events work with Fiber.

This is however not a complete solution since we may be reading the wrong
Fiber.
2016-11-16 15:56:13 +00:00
Sebastian Markbage 9799ed5065 Add Fibers to ReactTreeTraversal
This traverses parent based on the type of internal instance it is passed.
If it is a Fiber it may have to traverse multiple steps until it finds a
HostComponent.

This will allow us to use the event system with Fiber.
2016-11-16 15:43:55 +00:00
Sebastian Markbage 52724ad77b Add Fibers to ReactDOMComponentTree
This adds precaching to ReactDOMFiber. I.e. adding a handle from the DOM
node to the internal Fiber. This means that we need to expose an internal
handle to the reconciler.

We use duck typing to figure out if it is a Fiber or Stack instance.

The new failing tests are failing because this is now able to actually
fire events onto Fibers and then the result of those events are
incorrect where as they were ignored before.
2016-11-16 15:42:39 +00:00
tomocchino 7bf98b47c4 Update website for 15.4.0
(cherry picked from commit 5ce8853ccb2e4677eb6a9d183e8086fd0d6367d4)
2016-11-16 14:51:47 +00:00
tomocchino 5abd6bf40c Update Changelog & Readme for 15.4.0
(cherry picked from commit 443683525fd8c0721f21a8f23021d4eac73b5929)
2016-11-16 14:51:38 +00:00
Dan AbramovandGitHub 5c83c7545f Merge pull request #8293 from gaearon/154-post
Add 15.4.0 blog post
2016-11-16 14:45:26 +00:00
Dan Abramov 83af045074 Add 15.4.0 blog post 2016-11-16 14:36:20 +00:00
Tom OcchinoandGitHub 9b627fbbf3 Fix a line-length warning (#8298)
Test Plan: npm run lint / yarn run lint
2016-11-16 10:33:16 +00:00
Sebastian MarkbĂĄgeandGitHub 4a7558f748 Reapply Check for event listener in props instead of bank (#8292)
* Reapply Check for event listener in props instead of bank (#8192)

This reverts the previous revert.

* Don't throw on falsy event listeners

Some code relies on passing null. This restores the earlier behavior.
2016-11-15 18:16:27 +01:00
Dan AbramovandGitHub e8654a107d Merge pull request #8272 from gaearon/fiber-context
[Fiber] Initial implementation of context
2016-11-15 17:14:12 +00:00
Dan Abramov 8824e661b5 Use empty object if context does not exist
This matches Stack behavior.
Had to rewrite a test that used Simulate because Fiber doesn't support events yet.
Also changed tests for componentDidUpdate() since Fiber intentionally doesn't pass prevContext argument.
2016-11-15 16:35:00 +00:00
Dan Abramov 3e86f1d5ce Add explicit tests for intermediate components 2016-11-15 16:08:15 +00:00
Dan Abramov a43239313f Update passing tests 2016-11-15 14:49:54 +00:00
Dan Abramov 30599d0032 Memoize merged child context when possible
We can avoid recreating the merged context object if the context provider work was reused. This is essential to avoid allocations for deep setState() calls.
2016-11-15 14:41:59 +00:00
Dan Abramov a4a5087c80 Add test cases for context below and above setState 2016-11-15 13:23:29 +00:00
Andrew ClarkandGitHub 8f77be69fc Removes UpdateQueueNode.callbackWasCalled (#8290)
Tracking this isn't necessary.
2016-11-15 09:52:05 +00:00
Brandon DailandGitHub d4761d8d4a Merge pull request #8277 from qiuyuntao/master
docs: delete unnecessary brackets
2016-11-14 17:37:02 -06:00
Brandon DailandGitHub efd57cdd69 Update reference-react-dom.md (#8285)
Add missing closing bracket
2016-11-14 17:35:32 -06:00
Dan AbramovandGitHub b9a8cdac7a Catch first error from setState callbacks (#8287)
* Catch first error from setState updaters

* Minor style tweaks
2016-11-14 18:27:38 +00:00
Dan Abramov 53b1d1edcf Disable memoized props bailout when context might have changed 2016-11-14 18:24:32 +00:00
Dan Abramov cbf133aa98 Move context handling back into Begin and Complete phases
As per discussion, this is better because then this code only runs for the class type of work. We will still need to fix bailouts for deep setState calls.
2016-11-14 16:22:10 +00:00
Dan Abramov 2edd220a5f Move context management into scheduler
It is error-prone to push and pop context in begin or complete phases because of all the bailouts. Scheduler has enough knowledge to see if pushing is necessary because it knows when we go inside or outside the tree.
2016-11-14 13:32:09 +00:00
Dan Abramov 73eaec6ad2 Add a failing test for context when reusing work
We mistakingly forget to push the context if the parent is being reused but the child is not.
2016-11-14 13:32:09 +00:00
Dan Abramov c638c01b29 Add a test for recursive context 2016-11-14 13:32:09 +00:00
Dan Abramov 845ae65448 Fix bad ops.length assignment in tests 2016-11-14 13:32:09 +00:00
Dan Abramov 722fa1fced Update passing tests 2016-11-14 13:32:09 +00:00
Dan Abramov 49f8ae2d45 Minor style tweaks 2016-11-14 13:29:42 +00:00
Dan Abramov 8d49ccb92f Implement basic support for context 2016-11-14 13:29:42 +00:00
Dan Abramov fcfcd1e473 Update passing tests 2016-11-14 13:22:47 +00:00
Ben AlpertandDan Abramov 3f82b23d76 Change warnings to use expectDev 2016-11-14 13:22:41 +00:00
Dan Abramov 9b20089e72 Minor style tweaks 2016-11-14 12:56:11 +00:00
Dan Abramov a912747174 Catch first error from setState updaters 2016-11-14 12:55:59 +00:00