Commit Graph
3744 Commits
Author SHA1 Message Date
Brian Vaughn cb585229bc Ran yarn and fixed line-length lint issue 2017-03-24 19:59:05 -07:00
Brian Vaughn 1a29b4e2a3 Updating packages for 16.0.0-alpha.6 release 2017-03-24 15:44:09 -07:00
Brian VaughnandGitHub 1acf949240 ReactElementValidator uses temporary ReactNative View propTypes getter (#9256) 2017-03-24 15:37:21 -07:00
Sasha AickinandBen Alpert 25deff6203 Add more SSR unit tests for elements and children. (#9221)
* Adding more SSR unit tests for elements and children.

* Some of my SSR tests were testing for react-text and react-empty elements that no longer exist in Fiber. Fixed the tests so that they expect correct markup in Fiber.

* Tweaked some test names after @gaearon review comment https://github.com/facebook/react/pull/9221#discussion_r107045673 . Also realized that one of the tests was essentially a direct copy of another, so deleted it.

* Responding to code review https://github.com/facebook/react/pull/9221#pullrequestreview-28996315 . Thanks @spicyj!
2017-03-24 13:31:15 -07:00
Dan AbramovandGitHub 0a41890eaa Remove rethrowCaughtError injection (#9252) 2017-03-24 18:19:12 +00:00
Dan Abramov f082e35b36 Fix up invariant import to be from fbjs/lib/ 2017-03-23 19:45:10 +00:00
Dan AbramovandGitHub d6a2c669d2 Fix ReactErrorUtils injection (#9247) 2017-03-23 19:13:07 +00:00
Dan AbramovandGitHub 1c9dcd53d5 Add dynamic injection to ReactErrorUtils (#9246) 2017-03-23 18:45:38 +00:00
Brian VaughnandGitHub c8897f8382 Updated ReactNative findNodeHandle() to handle number case (#9238) 2017-03-23 08:16:52 -07:00
Dan Abramov b0b9f37960 Fix up Flow syntax 2017-03-22 18:41:42 +00:00
Dan AbramovandGitHub 8de9c6c12c Add injection for error dialog (#9235) 2017-03-22 18:21:12 +00:00
Brian Vaughn 8ce5fe97b5 Bumped React version to 16.0.0-alpha.5 2017-03-21 13:04:08 -07:00
Valentin SherginandBen Alpert 97ab3f5ef8 Removed optimization for events without target in ReactNativeEventEmitter (#9219)
* Removed optimization for events without target in ReactNativeEventEmitter

This PR fixes the problem originally introduced in https://github.com/facebook/react/pull/6590
The problem is that `ResponderEventPlugin` (and `ResponderTouchHistoryStore`) relies on that fact that touch events are balanced.
So if one `startish` event happened, should be coming `endish` event. Otherwise there is no way to maintain internal `trackedTouchCount` counter. So, if we drop some events, we break this logic.

Moreover, that optimization clearly contradict with this statement from `ResponderEventPlugin`:
```
We must be resilient to `targetInst` being `null` on `touchMove` or
`touchEnd`. On certain platforms, this means that a native scroll has
assumed control and the original touch targets are destroyed.
```

This issue causes several major problems in React Native, and one of them (finally!) is easy to reproduce: https://github.com/facebook/react-native/issues/12976 .

The test also illustrates this problem.

* Prettier
2017-03-20 17:07:28 -07:00
Brian VaughnandGitHub 7f665da0ee ReactNative upstream sync (#9197)
* Addresses a circular dependency between NativeMethodsMixin and ReactNativeFiber:

* Created new ReactNativeFiberHostComponent with similar interface but without unnecessary call to findNodeHandle.
* Created new Flow interface for mixins to ensure ReactNativeFiberHostComponent and NativeMethodsMixinUtils stay synced.
* Moved helper methods to NativeMethodsMixinUtils to be shared between the 2 wrappers.

This diff was submitted and reviewed internally along with some other ReactNative changes. This is the React-only portion.

* Removed unused Flow type import

* Copied a Flow fix from internal
2017-03-20 13:50:31 -07:00
Dan AbramovandGitHub e15a481773 Re-add tests unintentionally deleted in #9209 (#9225)
These tests are useful and don't test addons specifically.
I moved them to appropriate places in the codebase.
2017-03-20 19:38:54 +00:00
Dan AbramovandGitHub 34e4352cba Delete addons (#9209)
* Delete addons

* Remove ReactFragment dependency from tests

* Remove addons testing from fixtures

* Don't mention createFragment() in a warning

* Address feedback

* Remove unused variables

* Remove mention of deleted file

* Add a missing key to the test

* Fix lint
2017-03-20 16:15:01 +00:00
Sasha AickinandDan Abramov 78761c387f Add unit tests for props to attribute mapping in SSR. (#9106)
* Added a handful of SSR unit tests, ported from a previous pull request.

* Fixing linting errors

* Fixed a test helper function to properly report errors.

* Un-nested the new rendering tests. Updated the fiber test passing/not passing lists.

* Edited to comply with the react/jsx-space-before-closing eslint rule, which will soon be merged into master.

* Response to code review from @spicyj. Moved tests to separate file, reworked wording of test names, corrected use of canUseDom, and simplified tests against tagName. Thanks for the help, @spicyj!

* Converted the unit tests to use async-await style.

* Moved async-await babel transform for tests from .babelrc to preprocessor.js.

* Response to code review in PR #9089. Thanks, @spicyj!

* Fixing some bugs in the SSR unit tests.

* Missed deleting some repeated code in the last commit.

* Adding unit tests for property to attribute mapping in SSR.

* Removing some redundant unit tests.

* Oops. I forgot to re-run record-tests after c593dbc; fixing that here.

* Reformatting for prettier so that the build will pass.
2017-03-19 16:08:55 +00:00
Andrew ClarkandGitHub f606e0e7d3 Merge pull request #9145 from acdlite/explicitnullcheckfiberupdatequeue
Use explicit null checks in ReactFiberUpdateQueue
2017-03-17 10:44:11 -07:00
Sebastian MarkbågeandGitHub 9c7cf20dd5 Ignore event listener extraction on numeric text components (#9194)
In ReactDOM we don't dispatch events in the synthetic event system on to
text nodes. We back up one to the element before dispatching.

In React Native we don't do that. The iOS native side doesn't dispatch on
the text nodes but only the parent. The Android native side however does
dispatch on text nodes.

We already covered this for strings, but current element in Stack can be
a number if it is numeric text content.
2017-03-16 15:29:06 -07:00
Andrew Clark bc30ef9842 Work around loose typing for fiber.updateQueue
The updateQueue field is currently an any type. Check the fiber's tag so
that only UpdateQueues are passed to getPendingPriority.
2017-03-15 15:05:04 -07:00
Andrew Clark 21e0e3711b Use explicit null checks in ReactFiberUpdateQueue
Follow-up to #8978
2017-03-15 15:04:59 -07:00
Sebastian Markbage 7e078d6a92 Fix lint rules
The typeof one is a bit strange because the disable rule gets moved.
2017-03-14 14:12:35 -07:00
Sebastian Markbage ba1299acc2 Non idempotent steps in prettier 2017-03-13 17:06:03 -07:00
Sebastian Markbage 1843f87168 Run prettier 2017-03-13 17:05:18 -07:00
Sebastian Markbage 46bcd7fdf2 Add ignore to multichild test 2017-03-13 17:04:37 -07:00
Sebastian Markbage df6388ab52 Add prettier-ignore where we do matrix style formatting 2017-03-13 16:57:13 -07:00
Ben Alpert 0d7b4d6dba 16.0.0-alpha.4 2017-03-13 08:54:41 -07:00
Ben AlpertandGitHub 19c2649e02 Use fiber by default (#9155)
Affects our builds. But not in tests yet.
2017-03-10 17:06:02 -08:00
Dan AbramovandGitHub 8de68c56f9 [Fiber] Remove unnecessary second getComponentName() (#9153)
* Remove unnecessary second getComponentName()

We already have one. The other one is also less fragile and doesn't throw on null type.

* Make setState in render warning check simpler

This skips it earlier since in most cases phase won't be "render".
This is unobservable.
2017-03-10 19:29:20 +00:00
Dan AbramovandGitHub 6559b10b11 Use more widely supported emoji (#9139) 2017-03-09 00:55:36 +00:00
Dan AbramovandGitHub 73378c9293 [Fiber] Performance measurements (#9071)
* wip

* better

* better

* track commits

* better

* wip

* Fix

* Add some lifecycles

* wip

* Naming

* Moar emojis

* Remove stacks in favor of a flag

* Fix Flow

* Gate behind __DEV__

* Revert flag for testing

* Measure all lifecycles

* Push it to the limits

* Polish

* Indent

* Refactor and track cascading updates

* More prominent warnings

* Make mark names themselves readable

This is useful for RN Systrace which doesn't let us assign labels after the fact.

* Keep track of how many effects we call

* Fix typo

* Do less work to reduce the overhead

* Fix lint

* Remove closure

* Remove unintentional formatting changes

* Add tests

* Fix test regex and record tests

* Disable irrelevant tests needed for ReactPerf

* Fix typo

* Fix lint and flow

* Don't treat cWM or cWRP as cascading

* Whitespace

* Update tests

* Gate callComponentWillUnmountWithTimerInDev definition by DEV
2017-03-08 18:28:53 +00:00
Dominic GannawayandGitHub 4e9d7ac833 Merge pull request #9096 from trueadm/component-tree-hook-dev
[Fiber] Split dev methods within ReactComponentTreeHook
2017-03-07 14:09:22 +00:00
Dominic Gannaway a159e85c46 removed inline boolean checks for methods 2017-03-07 13:35:41 +00:00
Brandon DailandDan Abramov 6ca2140c73 Remove _resetEventPlugins, use jest.resetModuleRegistry (#9111)
* Move EventPluginRegistry._resetEventPlugins to DEV

This is not called during runtime at all and is only using in internal unit tests. Despite that, its currently being included in production builds. This change makes it so its only defined in DEV, which might even be too much (we can maybe inject it in our unit tests to avoid defining it at all in EventPluginRegistry)

* Remove _resetEventsPlugin, use resetModuleRegistry
2017-03-07 02:25:24 +00:00
Ben AlpertandGitHub d79c6ab995 Fiber DOM async feature flag (#9127)
D4662171
2017-03-06 16:21:43 -08:00
Vincent TaingandAndrew Clark bb149c8170 Fix redundant null type coercion (#9114) 2017-03-06 15:20:12 -08:00
Ben AlpertandGitHub 678cb70da2 Fix radio buttons using stale props in Fiber (#9126)
D4662269
2017-03-06 14:58:29 -08:00
Dominic Gannaway f992d54157 removed describe.only 2017-03-06 15:18:21 +00:00
Dominic Gannaway af4d249aa9 fixes tests so they correctly pass in fiber 2017-03-06 15:15:18 +00:00
Dominic Gannaway b67a29a8ab Merge remote-tracking branch 'upstream/master' into component-tree-hook-dev 2017-03-06 14:55:33 +00:00
Dominic Gannaway b572e3c907 moved non DEV methods to a new file called ReactFiberComponentTreeHook.js
This moves the non DEV methods to a new file called ReactFiberComponentTreeHook, updates existing references to DEV functions to remain inside DEV flags so they do not pull in ReactComponentTreeHook
2017-03-06 14:19:23 +00:00
jddxf f939c1bca4 Don't reset the return fiber after cloning the child fibers, as we already do that while cloning. 2017-03-06 17:08:56 +08:00
Brandon DailandGitHub 12ad77d006 Remove EventPluginRegistry.getPluginModuleForEvent (#9110) 2017-03-06 00:52:56 -06:00
Brandon DailandGitHub 0c1f515faf Remove sliceChildren (#9109) 2017-03-06 00:52:39 -06:00
Brandon DailandGitHub ceafdbf0a5 Remove ReactStateSetters (#9107) 2017-03-03 22:42:25 -06:00
Dan AbramovandGitHub d87c4d5e5c [Fiber] Don't schedule class fibers without relevant lifecycles for commit (#9105)
* Don't schedule class fibers without relevant lifecycles for commit

* Separate Update and Ref effects

* Simplify the exit condition

* Add missing annotation

* Write conditions differently to avoid an extra check

* Inline markUpdateIfNecessary()

* Inline markUpdateIfAlreadyInProgress()
2017-03-04 04:23:09 +00:00
Andrew ClarkandGitHub ccde21cd2b Merge pull request #9088 from acdlite/testerrorutilsshim
Test that ReactErrorUtils module can be shimmed
2017-03-03 14:09:10 -08:00
Andrew ClarkandGitHub e3f6c850c2 Merge pull request #9097 from acdlite/dontextractprodproptypeerror
Fix production propTypes test so it works with error code system
2017-03-03 11:06:04 -08:00
Sasha AickinandBen Alpert fcf41e7ca2 Add async/await to unit tests; modify server rendering tests to use async/await. (#9089) 2017-03-03 10:34:14 -08:00
Andrew Clark 673f514f81 Fix PropTypes production test so it works with error code system 2017-03-02 16:12:50 -08:00