Commit Graph
8392 Commits
Author SHA1 Message Date
Brian VaughnandGitHub ceb88fefcd Move takeSnapshot from UIManager to ReactNative renderer(s) (#9292)
* Move takeSnapshot from UIManager to ReactNative renderer(s)

* Prettier
2017-03-30 13:10:15 -07:00
Brandon DailandGitHub 26ef377122 Update JSFiddle for issue template (#9289) 2017-03-30 11:43:16 -05:00
Brandon DailandDan Abramov 78a00340cc Remove IE8-specific setInnerHTML behavior (#9288)
Since IE8 is not supported anymore, lets save those bytes!
2017-03-30 17:24:58 +01:00
Nathan HunzakerandBrandon Dail 137cc38cff Add DOM fixture for unmasking passwords (#9269)
IE11 and Edge have a password unmask field that React prevents the
display of for controlled inputs. This commit adds DOM fixture
coverage for this test case.
2017-03-30 10:16:36 -05:00
Damian NicholsonandDan Abramov 2f1ee05f17 Added semicolons to addons imports examples. (#9287) 2017-03-30 15:55:27 +01:00
Ben AlpertandGitHub 89fe0548c6 Allow returning null as host context (#9278)
If your renderer doesn't use host context, you might prefer to return null. This used to give an error:

> Invariant Violation: Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.

I use a sentinel value instead now.

The code in ReactFiberHostContext is a little complicated now. We could probably also just remove the invariants.
2017-03-30 13:18:39 +01:00
Nathan HunzakerandDan Abramov 3d86d9df6b Remove captured scroll feature check (#9283)
* Remove captured scroll feature check

IE8 was the only browser that did not support captured scroll. We no
longer have that constraint.

* Remove WINDOW_HANDLE const
2017-03-30 11:01:29 +01:00
Brandon DailandGitHub f5645c8a88 Remove IE8-specific ChangeEventPlugin logic (#9281) 2017-03-29 17:37:56 -05:00
Brandon DailandGitHub 7a95e7d79f Add DOM fixtures for disabled button click events (#9271) 2017-03-29 11:17:54 -05:00
Dominic GannawayandGitHub 2b79ff2cb6 Merge pull request #9276 from trueadm/getDeclarationErrorAddendum_DEV
[Fiber] Adds DEV condition around getDeclarationErrorAddendum
2017-03-29 13:55:04 +01:00
Dominic Gannaway 2ea104b03f added DEV condition around getDeclarationErrorAddendum contents 2017-03-29 13:49:30 +01:00
Sasha AickinandBen Alpert ac38423bb2 Added jest-cli to the package.json for the Fiber record-tests script. (#9270) 2017-03-28 22:55:22 +01:00
Brian VaughnandGitHub a4fcc48517 Adding fix to EventPropagators that was accidentally omitted from PR #9219 (#9274) 2017-03-28 11:24:13 -07:00
Brian VaughnandGitHub 7344a44f5e Added missing @flow annotation to ReactNativeFeatureFlags file (#9267) 2017-03-27 14:59:37 -07:00
Andrew Clark d3b66962d3 Merge branch 'giamir-add_toggle_to_fiber_triangle_demo' 2017-03-27 12:48:39 -07:00
Andrew Clark 33f940b8fd Use radio buttons for toggle 2017-03-27 12:48:05 -07:00
Andrew Clark b0584de541 Merge branch 'add_toggle_to_fiber_triangle_demo' of https://github.com/giamir/react into giamir-add_toggle_to_fiber_triangle_demo 2017-03-27 11:46:59 -07:00
Nathan HunzakerandBrandon Dail fc6e9ed46b Fix Chrome number input backspace and invalid input issue (#7359)
* Only re-assign defaultValue if it is different

* Do not set value if it is the same

* Properly cover defaultValue

* Use coercion to be smart about value assignment

* Add explanation of loose type checks in value assignment.

* Add test coverage for setAttribute update.

* Only apply loose value check to text inputs

* Fix case where empty switches to zero

* Handle zero case in controlled input

* Correct mistake with default value assignment after rebase

* Do not assign bad input to number input

* Only trigger number input value attribute updates on blur

* Remove reference to LinkedValueUtils

* Record new fiber tests

* Add tests for blurred number input behavior

* Replace onBlur wrapper with rule in ChangeEventPlugin

* Sift down to only number inputs

* Re-record fiber tests

* Add test case for updating attribute on uncontrolled inputs. Make related correction

* Handle uncontrolled inputs, integrate fiber

* Reorder boolean to mitigate DOM checks

* Only assign value if it is different

* Add number input browser test fixtures

During the course of the number input fix, we uncovered many edge
cases. This commit adds browser test fixtures for each of those instances.

* Address edge case preventing number precision lower than 1 place

0.0 coerces to 0, however they are not the same value when doing
string comparision. This prevented controlled number inputs from
inputing the characters `0.00`.

Also adds test cases.

* Accommodate lack of IE9 number input support

IE9 does not support number inputs. Number inputs in IE9 fallback to
traditional text inputs. This means that accessing `input.value` will
report the raw text, rather than parsing a numeric value.

This commit makes the ReactDOMInput wrapper check to see if the `type`
prop has been configured to `"number"`. In those cases, it will
perform a comparison based upon `parseFloat` instead of the raw input
value.

* Remove footnotes about IE exponent issues

With the recent IE9 fix, IE properly inserts `e` when it produces an
invalid number.

* Address exception in IE9/10 ChangeEventPlugin blur event

On blur, inputs have their values assigned. This is so that number
inputs do not conduct unexpected behavior in
Chrome/Safari. Unfortunately, there are cases where the target
instance might be undefined in IE9/10, raising an exception.

* Migrate over ReactDOMInput.js number input fixes to Fiber

Also re-record tests

* Update number fixtures to use latest components

* Add number input test case for dashes and negative numbers

* Replace trailing dash test case with replace with dash

Also run prettier
2017-03-27 11:39:18 -05:00
Sasha AickinandBen Alpert 94f3cd179a Adding new SSR tests for context, refs, and reviving markup. (#9257) 2017-03-26 13:32:23 -07:00
Giamir Buoncristiani f6f9c59e15 Add a button to switch from Fiber with time-slicing to Fiber without it 2017-03-26 17:24:26 +01:00
najisawasandBrandon Dail 4618be9d36 Fixed typo on implementation notes page (#9258)
Added paren to "mountComponent()" for consistency
2017-03-25 20:57:28 -05:00
Brian Vaughn 88c03ac822 Ran yarn and fixed line-length lint issue 2017-03-24 19:59:05 -07:00
Brian Vaughn 77263c816c Updating packages for 16.0.0-alpha.6 release 2017-03-24 15:44:09 -07:00
Brian VaughnandGitHub c997a568e7 ReactElementValidator uses temporary ReactNative View propTypes getter (#9256) 2017-03-24 15:37:21 -07:00
Sasha AickinandBen Alpert 66a734d846 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 97839e9c6f Remove rethrowCaughtError injection (#9252) 2017-03-24 18:19:12 +00:00
Johan TinglöfandBrandon Dail ab5e616ed0 Updated Router import for example (#9233)
Updated import in order to be a correct working example as in accordance with the docs
2017-03-24 09:37:32 -05:00
Dan Abramov df36f0e2e3 Fix up invariant import to be from fbjs/lib/ 2017-03-23 19:45:10 +00:00
Dan AbramovandGitHub d5f5c7afc8 Fix ReactErrorUtils injection (#9247) 2017-03-23 19:13:07 +00:00
Dan AbramovandGitHub ed179238a7 Add dynamic injection to ReactErrorUtils (#9246) 2017-03-23 18:45:38 +00:00
Brian VaughnandGitHub 4a9f01d58a Updated ReactNative findNodeHandle() to handle number case (#9238) 2017-03-23 08:16:52 -07:00
Dan Abramov aaa7267c8a Fix up Flow syntax 2017-03-22 18:41:42 +00:00
Dan AbramovandGitHub b69f73ff4b Add injection for error dialog (#9235) 2017-03-22 18:21:12 +00:00
Bernard LinandBrandon Dail 563d58cd64 Conferences (#9234)
* standard format for React Rally

* move React Conf 2017 to past conferences
2017-03-22 10:40:13 -05:00
Brian Vaughn 38f196fde4 Bumped React version to 16.0.0-alpha.5 2017-03-21 13:04:08 -07:00
Valentin SherginandBen Alpert 9030084b9b 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 1b33052147 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 e2b1603aef 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 86e91aaa00 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
CodinCatandDan Abramov ce2f40219b Use single quotes, remove extra whitespace (#9215) 2017-03-19 18:34:53 +00:00
Sasha AickinandDan Abramov abaecbf658 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 e4830ee6d3 Merge pull request #9145 from acdlite/explicitnullcheckfiberupdatequeue
Use explicit null checks in ReactFiberUpdateQueue
2017-03-17 10:44:11 -07:00
Brian VaughnandGitHub f83a5be5d9 Upgraded Flow dev dependency to 41 for 'implements' support (#9196) 2017-03-16 17:12:50 -07:00
Sebastian MarkbågeandGitHub ec3720429a Record fiber tests (#9195) 2017-03-16 16:29:05 -07:00
Sebastian MarkbågeandGitHub 2041c357b1 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 ClarkandGitHub 6401d18f26 Merge pull request #9187 from acdlite/prettierci
Failing to run prettier should block CI
2017-03-16 11:55:41 -07:00
Andrew Clark d64e887127 Run yarn prettier to format code
CI should now pass
2017-03-16 11:53:44 -07:00
Andrew Clark 0c796fee5b (test) Commit changes without running prettier to see if CI fails 2017-03-16 11:53:44 -07:00
Andrew Clark 105f09be56 Exit with failing code if prettier throws to ensure CI is blocked 2017-03-16 11:53:44 -07:00
Andrew Clark 4f878b00e7 Add prettier instructions to PR template and contribution guide 2017-03-16 11:53:44 -07:00