Commit Graph
2577 Commits
Author SHA1 Message Date
Jim 5ac51c39a0 Merge pull request #6442 from trevorsmith/master
Correctly select options when nested inside an optgroup
2016-04-08 09:55:43 -07:00
mondaychen 4e81eb4403 "0" can be the only valid unitless number string 2016-04-08 11:55:31 -04:00
Ben Alpert 5cb4a620e7 Set value using attribute only on initial option render
Tested that you can now type in the middle of a controlled input in Chrome which previously jumped your cursor to the end.

Fixes #6445.
2016-04-07 19:04:30 -07:00
Paul O’Shannessy fc1cfb6225 Make React.__spread warn 2016-04-07 17:30:23 -07:00
Paul O’Shannessy f02d87bdb5 Revert "Merge pull request #6431 from sebmarkbage/killspread"
This reverts commit a37e4e94fc, reversing
changes made to 411951d5b8.
2016-04-07 16:16:37 -07:00
Trevor Smith f7181e089c Remove an unnecessary call to findDOMNode in the select optgroup test. 2016-04-07 16:43:35 -06:00
Trevor Smith 8577600a61 Add a null check when checking for the native parent of an option element. 2016-04-07 16:42:50 -06:00
Trevor Smith b102e25663 Correctly select options when nested inside an optgroup 2016-04-07 16:30:51 -06:00
Jim 2e8f28c29f Merge pull request #6364 from p-jackson/issue-5700
Don't wrap drag events in IE/Edge in dev builds
2016-04-07 14:11:12 -07:00
Jim 7b47e3e537 Merge pull request #6134 from richardscarrott/master
Warn if props obj passed into createElement / cloneElement inherits from anything other than Object
2016-04-07 14:09:18 -07:00
Jim 006058daa5 Merge pull request #6341 from borisyankov/master
Add more information to warning 'Input elements must be either controlled or uncontrolled'
2016-04-07 14:08:03 -07:00
Paul O’Shannessy caa78f7985 Bump version for v16 development 2016-04-07 11:27:28 -07:00
Sebastian Markbåge a37e4e94fc Merge pull request #6431 from sebmarkbage/killspread
Kill React.__spread
2016-04-06 18:42:45 -07:00
Paul O’Shannessy 95cd88d07a Ensure default injection is injected for test utils 2016-04-06 17:43:08 -07:00
Sebastian Markbage a142fd2578 Kill React.__spread
This was only for a JSTransform related experiment that is now
dead along with JSTransform.
2016-04-06 17:08:50 -07:00
Paul O’Shannessy e19353cdb5 Merge pull request #6429 from zpao/viceversa2words
Fix "vice versa" in warning message
2016-04-06 16:46:19 -07:00
Paul O’Shannessy a55579af0a Merge pull request #6426 from zpao/valuetest
Fix tests for value change
2016-04-06 16:24:09 -07:00
Paul O’Shannessy a10665cac0 Fix "vice versa" in warning message
The phrase is 2 words, not 1.
2016-04-06 15:51:06 -07:00
Paul O’Shannessy cf1a96611f Fix tests for value change 2016-04-06 13:43:59 -07:00
Paul O’Shannessy 42b1cba048 Make sure simulated events don't warn when providing extra event properties 2016-04-05 14:53:25 -07:00
Sebastian Markbage 2d069fc5e6 Fix typo
Resets currentTarget on the pooled event instead of adding an
expando.
2016-04-05 13:40:49 -07:00
Paul O’Shannessy d10b355b42 Merge pull request #6228 from everdimension/fix_option_value
set value property explicitly for "option" element even if value is empty
2016-04-05 13:27:13 -07:00
Paul O’Shannessy 1573baaee8 Use Object.assign directly and inject object-assign at compile 2016-04-04 09:53:25 -07:00
Dan Abramov ec1462834e Update ReactDOMProduction-test.js 2016-04-02 00:53:01 +01:00
Dan Abramov 575fb79162 Add ReactDebugInstanceMap
This PR is the first in a series of pull requests split from the new `ReactPerf` implementation in #6046.

Here, we introduce a new module called `ReactDebugInstanceMap`. It will be used in `__DEV__` and, when the `__PROFILE__` gate is added, in the `__PROFILE__` builds. It will *not* be used in the production builds.

This module acts as a mapping between “debug IDs” (a new concept) and the internal instances. Not to be confused with the existing `ReactInstanceMap` that maps internal instances to public instances.

What are the “debug IDs” and why do we need them? Both the new `ReactPerf` and other consumers of the devtool API, such as React DevTools, need access to some data from the internal instances, such as the instance type display name, current props and children, and so on. Right now we let such tools access internal instances directly but this hurts our ability to refactor their implementations and burdens React DevTools with undesired implementation details such as having to support React ART in a special way.[1]

The purpose of adding `ReactDebugInstanceMap` is to only expose “debug IDs” instead of the internal instances to any devtools. In a future RP, whenever there is an event such as mounting, updating, or unmounting a component, we will emit an event in `ReactDebugTool` with the debug ID of the instance. We will also add an introspection API that lets the consumer pass an ID and get the information about the current children, props, state, display name, and so on, without exposing the internal instances.

`ReactDebugInstanceMap` has a concept of “registering” an instance. We plan to add the hooks that register an instance as soon as it is created, and unregister it during unmounting. It will only be possible to read information about the instance while it is still registered. If we add support for reparenting, we should be able to move the (un)registration code to different places in the component lifecycle without changing this code. The currently registered instances are held in the `registeredInstancesByIDs` dictionary.

There is also a reverse lookup dictionary called `allInstancesToIDs` which maps instances back to their IDs. It is implemented as a `WeakMap` so the keys are stable and we’re not holding onto the unregistered instances. If we’re not happy with `WeakMap`, one possible alternative would be to add a new field called `_debugID` to all the internal instances, but we don’t want to do this in production. Using `WeakMap` seems like a simpler solution here (and stable IDs are a nice bonus). This, however, means that the `__DEV__` (and the future `__PROFILE__`) builds will only work in browsers that support our usage of `WeakMap`.

[1]: https://github.com/facebook/react-devtools/blob/577ec9b8d994fd26d76feb20a1993a96558b7745/backend/getData.js
2016-03-31 17:58:55 +01:00
Jim eb85b7b2c9 Merge pull request #6381 from cbrwizard/clipboard_event_unit_tests
SyntheticClipboardEvent unit tests
2016-03-31 07:37:31 -07:00
Dan Abramov b6bc4bd996 Spy at warnings consistently inside test cases
We move any spies on `console.error()` from `beforeEach()` to the individual `it()` tests. This means that if a new test is introduced in these suites, it does not ignore warnings by default, but fails on any unexpected warning, which is Jest's default behavior.

We also change a few old instances of direct `console.error = jest.genMockFn()` assignment to use `spyOn()` for consistency with the rest of the tests.
2016-03-30 22:01:20 +01:00
cbrwizard e6e38d0f9c SyntheticClipboardEvent unit tests
Adds unit tests for a SyntheticClipboardEvent.
2016-03-30 23:09:23 +03:00
cbrwizard d743a8dd55 SyntheticKeyboardEvent unit tests
Adds unit tests for SyntheticKeyboardEvent.
2016-03-29 22:28:11 +03:00
Richard 17683e0410 Warn if props obj passed into createElement / cloneElement inherits from anything other than Object 2016-03-29 20:21:39 +01:00
Philip Jackson 4687a03f54 Don't wrap drag events in IE/Edge in dev builds
Dev builds wrap synthetic events inside other events for a better debug
experience. However IE/Edge won't allow access to the
DataTransfer.dropEffect property if it's wrapped in this way.
The first time a drag event is fired, test if we're in an environment
that behaves this way and disable React's improved development
experience if we are.
2016-03-28 00:29:46 +13:00
Boris Yankov 1018e50a1a Add more information to 'Input elements must be either controlled or uncontrolled' warning 2016-03-25 16:36:48 +02:00
Jim dcd092560d Merge pull request #6305 from maherbeg/maher-error-find-dom-node
Test to verify findDOMNode does not throw in willMount
2016-03-24 18:59:55 -07:00
Maher Beg 70de7e4a38 Test to verify findDOMNode does not throw in willMount
Adds a test to prevent a regression of throwing an error when
calling `findDOMNode(this)` in a component's `componentWillMount`
function. This previously used to throw an invariant violation but
now does not any more.
2016-03-24 18:06:27 -07:00
Paul O’Shannessy 6a8ebfc418 Merge pull request #6331 from zpao/isonpmorphic
Make Browserify-specific modules to remove DOM dependencies from npm package
2016-03-24 16:01:51 -07:00
Paul O’Shannessy d17091ddeb Make Browserify-specific modules to remove DOM dependencies from npm package 2016-03-24 15:28:52 -07:00
Jim 414f057bc2 Merge pull request #6296 from jontewks/add-warnings
Add warnings for onFocusIn and onFocusOut props
2016-03-24 08:37:45 -07:00
Dan Abramov 0f1240e877 Fix ReactPerf.printOperations() test to work with createElement = false 2016-03-23 22:24:32 +00:00
Paul O’Shannessy bfb9444300 Merge pull request #6242 from edvinerikson/add-origin-to-css-warnings
added component name to css property warnings
2016-03-23 12:12:51 -07:00
Dan Abramov 1e8156143a Merge pull request #6310 from gaearon/setstate-warning
Add more specific error messages for bad callback in setState, replaceState, and ReactDOM.render
2016-03-23 14:50:36 +00:00
Jon Tewksbury a7fae7e4c7 Add warnings for onFocusIn and onFocusOut props 2016-03-21 17:22:37 -07:00
Jim c528732504 Merge pull request #6307 from cbrwizard/getEventCharCode_unit_tests
getEventCharCode unit tests
2016-03-21 16:17:06 -07:00
Dan Abramov af4fe68b14 Change message format to be more consistent with other errors 2016-03-21 23:13:47 +00:00
Dan Abramov d4657b8331 Add bad callback invariants to ReactDOM.render() calls 2016-03-21 22:33:15 +00:00
Dan Abramov ebe5128489 Use specific method names in error messages 2016-03-21 21:40:17 +00:00
Dan Abramov 552f00b536 Make setState() callback error message more descriptive
Fixes #6306
2016-03-21 21:24:19 +00:00
Victor Homyakov 0393488f39 Free memory allocated by testElement after usage
IE11 reports `testElement` as detached DOM node consuming memory. It is captured in closure of `setInnerHTML` function and could be safely cleared after feature test.
2016-03-21 14:07:26 +03:00
cbrwizard 7bdf4dba75 getEventCharCode unit tests
Adds unit tests to getEventCharCode.
2016-03-21 12:56:45 +03:00
Dan Abramov cfec10bd51 Remove unused export from DOMChildrenOperations 2016-03-19 21:05:05 +00:00
Dan Abramov b6547734c6 Strip complex values from ReactPerf.printDOM() output
Fixes #6288
2016-03-17 21:23:43 +00:00