2933 Commits

Author SHA1 Message Date
Andrew Clark 0a7c4b3858 15.5.3 2017-04-07 21:08:39 -07:00
Andrew Clark 32c04c038f 15.5.2 2017-04-07 21:08:22 -07:00
Andrew Clark e2db791e75 15.5.1 2017-04-07 21:08:21 -07:00
Andrew Clark ec97ebbe7f Fix erroneous PropTypes access warning 2017-04-07 14:26:37 -07:00
Andrew Clark e19c70013e 15.5.0 2017-04-07 14:21:27 -07:00
Andrew Clark 15b507c5c4 Add .createRenderer method to ReactShallowRenderer 2017-04-07 13:46:20 -07:00
Andrew Clark ce74e00e5a Fix ReactWithAddons umd build 2017-04-06 16:03:49 -07:00
Brian Vaughn 1d22ff7fa1 Replaced ReactTestReconcileTransaction with ReactReconcileTransaction in shallowRenderer 2017-04-06 14:55:11 -07:00
Andrew Clark 49868d8615 Fix references to React.createClass and React.PropTypes 2017-04-06 14:21:49 -07:00
Andrew Clark 12a96b9482 Fix references to React.createClass and React.PropTypes 2017-04-06 13:17:34 -07:00
Brian Vaughn 4f5aa2e40d Replaced console.error() in test utils with warning() 2017-04-06 11:36:58 -07:00
Brian Vaughn 714e5ea65e Moved shallow renderer injections into render() method to avoid conflict with react-dom 2017-04-06 11:29:41 -07:00
Andrew Clark 72531d330d TransitionGroup should use prop-types package 2017-04-06 11:07:46 -07:00
Andrew Clark 1f487eb933 15.5.0-rc.1 2017-04-05 11:39:12 -07:00
Andrew Clark 40b37c64c8 Uncommenting this warning even though tests haven't been updated yet
I'll fix the tests later.
2017-04-05 11:21:08 -07:00
Andrew Clark 043845ce75 Extract ReactPropTypes to separate module 2017-04-04 14:29:11 -07:00
Brian Vaughn 3a7eef2bcf Test utils deprecations and updates:
1. Moved react-addons-test-utils to react-dom/test-utils and added deprecation message.
2. Moved shallow renderer (previous accessible via TestUtils.createRenderer) to react-test-renderer/shallow and added deprecation message.
3. Updated READMEs for react-addons-test-utils and react-test-renderer
2017-04-04 13:47:05 -07:00
Brian Vaughn ca2e8861e5 Replaced react-create-class references with create-react-class 2017-03-31 14:59:50 -07:00
Nathan Hunzaker fe4a5b4004 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-28 11:35:23 -07:00
Jirat Ki ef38390666 Add component stack to invalid element type warning (#8495)
* Show Source Error Addemden if __source available

* Add Parent Stack on invalid element type

* refactor to use normalizeCodeLocInfo

* Remove ( ) from addendum
2017-03-28 11:16:04 -07:00
Gaëtan Renaudeau 17434d7263 Fix test renderer unmount (#8512)
* [react-test-renderer] unmount the inner instances

Fixes https://github.com/facebook/react/issues/8459

* add a test for https://github.com/facebook/react/issues/8459

* add new test in tests-passing.txt
2017-03-28 11:05:25 -07:00
Maksim Shastsel ac53db35e7 Delete @nosideeffect annotation (#8882) 2017-03-28 11:02:38 -07:00
António Nuno Monteiro 9d21b524ff Change the order between function declaration and object assignment (#8895)
This fixes #8894
2017-03-28 11:02:11 -07:00
Andrew Clark 322076a8c2 Future-proof react-create-class
- Backport change to enqueueReplaceState. Use new API instead of
enqueueCallback, which is gone in 16.
- Implement isMounted using lifecycles, so we have the option of
removing this later.
2017-03-27 16:23:45 -07:00
Andrew Clark d9a4fa4f51 Replace createClass with external react-create-class dependency
Warns when using React.createClass for the first time.

Usages of createClass in tests have been converted to plain JavaScript
classes. Tests that rely on replaceState or isMounted use
updater.enqueueReplaceState and updater.isMounted.
2017-03-21 14:57:50 -07:00
William Cunningham 50afe2ef5a Move getNextDebugID() to React package.
The module, and its internal state, was duplicated in several packages,
leading to duplicate ids when multiple renderers were used.
2017-03-17 15:35:20 -07:00
Jack Cross 688490dfe9 Add CircleCI support to 15-stable (#8778)
* devDependencies: add core-js and es6-symbol polyfill for tests

* Update Flow and fix issues (#8006)

* Add npm v4.0.0 support (#8082)

* Add support for node v7 (#8135)

* 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

* Update all Jest packages to 17.x (#8327)

* Update all Jest packages to 17.x, cache babel-jest transforms

* Remove the caching

Looking at the other builds it doesn't seem to actually be that necessary.  The bottleneck is executors, not build time.

* Remove unnecessary package, fix fiber test runner

* Regenerate yarn lockfile

* Update Flow to 0.37.0 (#8608)

Nothing really changes.

* Update to Jest 18 (#8621)

* mockImpl -> mockImplementation

D4329549

* Fixed linting errors

* circle.yml and circleci scripts

* Update Flow and fix issues (#8006)

* Fixed flow errors

* Updated shrinkwrap

* Removed unnecessary change

* Added jest --runInBand flag

* Removed ReactDOMFiber changes
2017-01-23 18:20:50 +01:00
Dan Abramov 03464f06d2 15.4.2 2017-01-06 19:52:54 +00:00
Dan Abramov 4294a7c908 Fix AMD and Brunch issues (#8686)
* Add manual build fixtures

* Inject ReactDOM into ReactWithAddons from ReactWithAddons

We used to read ReactDOM as a global inside ReactAddonsDOMDependenciesUMDShim.
This didn't work in AMD environments such as RequireJS and SystemJS.

Instead, I changed it so that ReactDOM gets injected into ReactWithAddons by ReactDOM itself.
This way we don't have to try to require it (which wouldn't work because AMD doesn't handle circular dependencies well).

This means you have to load ReactDOM first before using ReactDOM-dependent addons, but this was already the case before.

This commit makes all build fixtures pass.

* Memoize ReactDOM to avoid going into require on every access

* Add Brunch fixture

* Inline requires to work around Brunch bug

See #8556 and https://github.com/brunch/brunch/issues/1591#issuecomment-270742503 for context.
This appears to be a Brunch bug but we can keep a temporary fix until the next major.

(cherry picked from commit ca2c71c0c5)
2017-01-06 17:24:23 +00:00
Ben Alpert d2039d7fac Improve error messages for invalid element types (#8612)
(cherry picked from commit eca5b1d48e)
2017-01-06 17:04:29 +00:00
dfrownfelter d93cedad7f Delete fiveArgumentPooler (#8597)
(cherry picked from commit b106ca0c8e)
2017-01-06 16:59:06 +00:00
Brian Vaughn b2ce4125f6 Merge pull request #8594 from bvaughn/dont-warn-about-getInitialState-on-class-if-state-set
Don't warn about class components using getInitialState if state is set
(cherry picked from commit 3c6d4bacdd)
2017-01-06 16:58:50 +00:00
Eoin Hennessy c9a8c128bb Refactor precacheChildNodes slightly (#8018)
This ‘fixes’ a bizarre IE9 script engine issue. #7803
(cherry picked from commit 6ce8f1f93c)
2017-01-06 16:58:22 +00:00
Brandon Dail 4dd625a93f Correctly render placeholder for textarea in IE11 (#8020)
* Check if textContent should be set for textarea

shouldSetNodeTextContent returns whether a node.textContent should be
updated. Currently it only covers one case, which is to avoid setting
the textContent if the text is empty and a placeholder exists.

* Only set node.value if it's equal to initialValue

In IE11 textContent is populated when the placeholder attribute is set.
Without this check, we end up setting node.value equal to the
placeholder text, causing the textarea to actually render with the text
inside.

This check makes sure that textContent is equal to our expected
initialValue, which should be the case when using defaultValue.

* Remove placeholder/textarea check, use contentToUse instead

(cherry picked from commit e644faa610)
2017-01-06 16:58:22 +00:00
Diego Muracciole 278409db05 Injected Host Component classes are not being considered by the reconciler (#8050)
* Consider Host Component classes when creating a new internal instance

* Remove unused tagToComponentClass & injectComponentClasses from ReactHostComponent

(cherry picked from commit 461a74115c)
2017-01-06 16:58:21 +00:00
Nathan Hunzaker ed760d1567 Fix uncontrolled input decimal point "chopping" on number inputs, and validation warnings on email inputs (#7750)
* Only assign defaultValue if it has changed.

* Improve comment about reason for defaultValue conditional assignment

(cherry picked from commit 0d20dcf910)
2017-01-06 16:58:21 +00:00
Ben Alpert 2075139ce5 15.4.1 2016-11-22 17:47:12 -08:00
Ben Alpert 027d8808b7 Stopgap fix for element disabling (#8387)
Fix for #8308. This is a bad hack -- EventPluginHub.getListener isn't even DOM-specific -- but this works for now and lets us release 15.4.1.
(cherry picked from commit c7129ce1f0)
2016-11-22 17:34:20 -08:00
Dan Abramov 9941c48914 Restructure code to work around a Rollup bug (#8384) 2016-11-22 17:16:13 -08:00
tomocchino 1c1f68e8dc 15.4.0 2016-11-16 14:16:57 +00:00
tomocchino 88296d994d Merge branch '15-dev' into 15-stable 2016-11-16 14:08:52 +00:00
Brandon Dail 7df71a2525 Use _hostContainerInfo to track test renderer options (#8261)
* Use _hostContainerInfo to track test renderer options

The transaction is not available when unmounting or updating the
instance, so we track it using _hostContainerInfo

* Throw if hostContainerInfo is not populated in getPublicInstance

* Linting fixes

* Remove transaction from ref lifecycle code path

We don't need to pass the transaction around anymore since we store the
test options on _hostContainerInfo instead

* Remove unused argument

(cherry picked from commit e43aaab254)
2016-11-16 12:08:28 +00:00
Josh Perez 28e51005dc Shares debugID information across modules (#8097)
Prior to this, React was using a nextDebugID variable that was locally
scoped to both `instantiateReactComponent` and `ReactShallowRenderer`.
This caused problems when the debugIDs would collide, the `itemMap` in
`ReactComponentTreeHook` would be overwritten and tests would fail
with the message "Expected onBeforeMountComponent() parent and
onSetChildren() to be consistent".

This change shares the debugID with both modules thus preventing any
collisions in the future.
(cherry picked from commit 6eebed0535)
2016-11-16 12:07:24 +00:00
Ben Alpert fbe19e90b9 Fix captured/bubbled in ReactNativeTreeTraversal (#8019)
Follow-up to #7741. Added a test for RN event bubbling that fails before the fix.
(cherry picked from commit a8beab3341)
2016-11-16 12:06:55 +00:00
Toru Kobayashi a53e45ada0 Fix an argument name of TestUtils.renderIntoDocument (#8104) 2016-10-27 01:09:47 +01:00
Sebastian Markbage 457730dded 15.4.0-rc.4 2016-10-14 14:56:30 -07:00
Sebastian Markbåge d81d9e260f Fix whitespace in headers (#7980)
The script that strips providesModule is very sensitive.

Test plan:

Searched for providesModule in build. No more.

reactComponentExpect used to have problems too but doesn't seem
to anymore. Don't know why.
2016-10-14 14:52:04 -07:00
Dan Abramov c577b82875 15.4.0-rc.3 2016-10-14 19:56:21 +01:00
Paul O’Shannessy c8c879f1c5 15.4.0-rc.2 2016-10-05 15:45:23 -07:00
Paul O’Shannessy 4717d2480c 15.4.0-rc.1 2016-10-04 15:33:38 -07:00