Commit Graph

450 Commits

Author SHA1 Message Date
karczk ef2b1f26ef Unnecessary type comparisons have been changed to value comparison 2016-02-02 19:35:58 +01:00
Dave 1beae0c4ff test: get rid of 'should be 1' comment
This should not be 1, since boolean properties always get set.
2016-02-01 12:53:25 -08:00
Jim 188e8cde2f Merge pull request #5884 from jimfb/component-extends-react-component
Enable null return values in plain functions
2016-01-29 15:05:08 -08:00
Jim 9d5825cf4b Merge pull request #3372 from jonhester/void-elements
ReactDOMComponent should throw error when provided children for void elements
2016-01-29 13:27:35 -08:00
Jim 67e1291ef7 Merge pull request #1510 from syranide/propattr
Use removeAttribute to forcefully remove properties from the DOM
2016-01-29 12:48:25 -08:00
jim 757756f682 Enable null return values in plain functions 2016-01-20 14:11:41 -08:00
Ben Alpert e420edda36 Merge pull request #5886 from goatslacker/cant-dangerouslysetinnerhtml-for-option
Only add children in ReactDOMOption when there are children
2016-01-19 15:12:09 -08:00
Josh Perez 3da6e2889b Only add children when there are children 2016-01-19 14:48:47 -08:00
Paul O’Shannessy 31d3bfa763 Merge pull request #5811 from jontewks/warn-nan-style
Warn when a style object has NaN for a value
2016-01-18 17:06:19 -08:00
Jon Tewksbury 7a6000c093 Add warning for NaN in style object 2016-01-16 11:10:50 -08:00
Paul O’Shannessy 422b4e105c Merge pull request #5840 from koba04/release-event-target-on-destructor
Release syntheticEvent.target on the destructor
2016-01-15 16:38:42 -08:00
Toru Kobayashi be0551d01e Release syntheticEvent.target on the destructor 2016-01-14 15:09:56 +09:00
Jim 689efd1abf Merge pull request #5833 from jimfb/remove-getDOMNode
Removed getDOMNode from react classes.
2016-01-13 15:40:12 -08:00
Ben Alpert fdd7fabd12 Merge pull request #5728 from spicyj/input-gc
Remove now-unused instancesByReactID in DOMInput
2016-01-12 10:00:43 -08:00
Toru Kobayashi 6f976dfbbe Fixup jsdoc for SyntheticEvent 2016-01-13 00:52:59 +09:00
jim e8af100849 Removed getDOMNode from react classes. 2016-01-11 23:32:22 -08:00
Paul O’Shannessy 26f53de4a6 Fixup style for long lines 2016-01-11 17:27:37 -08:00
Michael McDermott f2b62e9d90 Warn when both value and defaultValue or both check and defaultChecked props are specified on input, textarea, or select elements 2016-01-11 18:09:37 -05:00
Andreas Svensson 77a137adf9 Use removeAttribute to forcefully remove properties from the DOM, drop MUST_USE_ATTRIBUTE and manage all regular properties as attributes instead 2016-01-09 11:55:56 +01:00
Paul O’Shannessy 708e1b3f03 Sort attrs in HTMLDOMPropertyConfig 2016-01-08 17:23:25 -08:00
Miles Johnson f4c5b2c00b Updated ReactCompositeComponent to trigger componentWillReceiveProps when either props or context change. Fixes issue #5756 2016-01-06 15:49:47 -08:00
jim 4e3d38ed27 Removed note explaining why the logic is there, since the justification is now different. 2016-01-05 15:30:00 -08:00
Ben Alpert eb00290673 Remove now-unused prepareToManageChildren
This was a temporary hook needed for the DOM implementation. We no longer need it because we now necessarily load every node into cache (via calling getNativeNode on it) before manipulating any of its siblings.
2016-01-05 15:08:42 -08:00
Ben Alpert 27926572f6 Move nodes around by reference instead of by index
This makes things easier if we ever want to use more than one DOM node for a component. Notably, this is more convenient if we want to remove the wrappers around text components (since text nodes can be split and joined however a browser feels like) or if we want to support returning more than one element from render (#2127).

I left the old indexes so that implementations aren't forced to use the node/image if they prefer indices, because I'm not sure yet whether the changes corresponding to my rewrite of DOMChildrenOperations are easy or hard yet in React Native. (The tests pass with and without the DOMChildrenOperations changes here.)
2016-01-05 15:08:42 -08:00
Ben Alpert 0ebc7b60e1 Revert "Merge pull request #5689 from jimfb/cleanup-5151"
This reverts commit 067547c1d1, reversing
changes made to 102cd29189.
2016-01-05 15:08:15 -08:00
Jim 067547c1d1 Merge pull request #5689 from jimfb/cleanup-5151
Get rid of getNativeNode()
2016-01-05 14:42:05 -08:00
Rick Beerendonk bef45b0b1a Year-agnostic copyright message, like React Native uses, to prevent the need for yearly changes. 2015-12-29 20:20:32 +01:00
Dan Abramov 98a7100930 Use JSX in the new tests 2015-12-25 13:50:10 +00:00
Dan Abramov f27e3aa750 Move the specific else if clause up 2015-12-25 13:48:13 +00:00
Dan Abramov 251d6c30b5 Move SVG attribute deprecation warnings into a devtool
In #5590 a new system was introduced for tracking dev-time warnings.
This commit uses it for reporting SVG attribute deprecation warnings.
2015-12-24 17:50:46 +00:00
Dan Abramov 232a47ad04 Pass SVG attributes through
All attributes defined on SVG elements will now be passed directly regardless of the whitelist. The casing specified by user will be preserved, and setAttribute() will be used.

In the future we will remove support for the camel case aliases to the hyphenated attributes. For example, we currently map `strokeWidth` to `stroke-width` but this is now deprecated behind a warning. When we remove support for this we can remove some of the code paths introduced in this commit.

The purpose of this change is to stop maintaining a separate SVG property config. The config still exists for two purposes:

* Allow a migration path for deprecated camelcased versions of hyphenated SVG attributes
* Track special namespaced attributes (they still require a whitelist)

However it is no longer a blocker for using new non-namespaced SVG attributes, and users don't have to ask us to add them to the whitelist.

Fixes #1657
2015-12-24 17:18:33 +00:00
Jim 82fe64a456 Merge pull request #5590 from jimfb/use-devtool-for-unknown-property-warning
Use devtool for unknown property warning
2015-12-23 19:02:58 -08:00
Ben Alpert 432578ef03 Add another test for #5729 2015-12-23 16:25:35 -08:00
Ben Alpert 07c0bc6166 Set input .type before .value always
In IE11 (and below), if you run

```
var input = document.createElement('input');
input.value = 'wat';
input.type = 'radio';
console.log(input.value);
```

you get the string "on" logged. Because that makes sense.

So we set the type first.
2015-12-23 15:44:33 -08:00
Ben Alpert d9dabac48d Remove now-unused instancesByReactID in DOMInput 2015-12-23 15:14:13 -08:00
Ben Alpert bae0f19543 Merge pull request #5308 from spicyj/rep
Import ResponderEventPlugin changes from RN
2015-12-22 15:53:11 -08:00
Ben Alpert bb11639e25 Import ResponderEventPlugin changes from RN 2015-12-22 15:45:51 -08:00
Ben Alpert 5563771ace Merge pull request #5694 from spicyj/div-html-nesting
Make sure div > html nesting is considered invalid
2015-12-18 12:53:27 -08:00
Ben Alpert 40d5692980 Make sure div > html nesting is considered invalid
See #5128.
2015-12-18 12:49:54 -08:00
Paul O’Shannessy 7a1d87bd33 A couple small style fixups that were missed in recent PRs 2015-12-18 11:27:49 -08:00
jim 8eabf84204 Get rid of getNativeNode() 2015-12-17 19:04:27 -08:00
jim 26f3785a8c Use duck typing instead of allocating event objects 2015-12-16 19:32:55 -08:00
Ben Alpert 963b3cacab Merge pull request #5346 from prometheansacrifice/warn-immutable-props
Warns when mutated props are passed.
2015-12-16 16:09:33 -08:00
Jim c9c3c339b7 Merge pull request #5216 from nLight/number-in-data-attrs-2329
Allow numbers after `data-` in custom attributes fixes #2329
2015-12-16 15:37:41 -08:00
Jim 3afced6a75 Error boundaries. 2015-12-16 12:15:26 -08:00
Jim 30ef056731 Moved unknown-prop warning into a devtool 2015-12-14 16:29:04 -08:00
Jim a55ab282fa Initial outline for new devtools api 2015-12-14 16:29:02 -08:00
Ben Alpert 33217f0fb9 Merge pull request #4888 from spicyj/ssr-no-queue
Don't build up mount-ready queue for server side rendering
2015-12-14 14:46:04 -08:00
Freddy Rangel db37deb17c Autocorrect and autocapitalize should not be property
Fixes facebook/react#5436
2015-12-13 23:37:29 -08:00
Justas Brazauskas 0886273438 Fix few typos in React docs and comments 2015-12-13 16:39:07 +02:00