Commit Graph
2280 Commits
Author SHA1 Message Date
Ben Alpert 4ba0e95a96 Kill ReactMount.getNode/getID/purgeID with fire 2015-11-04 11:39:43 -08:00
Ben Alpert 796f8c353c put/deleteListener take an instance, not an ID
This removes SimpleEventPlugin's dependency on ReactMount.getID.
2015-11-04 11:39:43 -08:00
Ben Alpert d11ccd6956 Propagate events based on component tree, not IDs 2015-11-04 11:39:43 -08:00
Ben Alpert f470cb88f8 Events: Pass native instances up until propagation
Next step: take advantage of having the native instances in EventPropagators instead of converting right back to IDs.
2015-11-04 11:39:43 -08:00
Ben Alpert 6d20556c78 Add functions to find the instance given a node 2015-11-03 17:03:40 -08:00
Ben Alpert ce528457a4 ReactDOMComponentTree
New module! With this, we have a new module that uses the component tree to store DOM nodes. Most of the logic in this file relates to markup adoption -- if we were to drop that (along with server rendering) this file could just be a `return inst._nativeNode;`.

This works with useCreateElement only because we need to reference each node as it's created.

Events is now the only thing using ReactMount.getNode -- I'll introduce pointers back from the DOM nodes (and a `ReactDOMComponentTree.getInstanceFromNode`) and make that work.
2015-11-03 17:03:40 -08:00
Ben Alpert 5a7c273a1b Always do useCreateElement for updates
Initial render can still be a markup string.
2015-11-03 17:03:40 -08:00
Ben Alpert 276ef737fe Make ReactDOMComponent-test pass with useCreateElement 2015-11-03 17:03:40 -08:00
Ben Alpert 5becbe3f08 Remove obsolete tests with new tree-walking 2015-11-03 17:03:40 -08:00
Ben Alpert 19e2cf5ad5 Make ReactEmptyComponent-test not swallow logs 2015-11-03 17:03:40 -08:00
Ben Alpert 2858bca2e3 Merge pull request #5361 from ali/warn-on-missing-event-handlers
Warn on missing event handler properties
2015-11-02 20:23:20 -08:00
Ali Ukani 9ad4be0316 Warn on missing event handler properties
Fixes #3548. Warns on properties that are case-insensitive matches for
registered event names (e.g. "onclick" instead of "onClick").
2015-11-02 23:13:20 -05:00
Ben Alpert c802e9ede9 Test fixups after #4993 2015-11-02 18:26:52 -08:00
Ben Alpert d2888798f0 Merge pull request #4993 from jsdf/shallow-render-lifecycle
Run all component lifecycle methods when shallow rendering
2015-11-02 18:16:55 -08:00
conorhastings fbb8d2fe2d Show a friendly error when using TestUtils.Simulate with shallow rendering 2015-11-02 20:14:26 -05:00
Paul O’Shannessy 72a11421d2 Merge pull request #5367 from spicyj/haste-manifest
Add package.json for react-haste package
2015-11-02 11:15:28 -08:00
Ben Alpert d44c45f8a5 Add package.json for react-haste package
This will probably go away in a release or two.
2015-11-02 11:03:18 -08:00
chico 8a9039891b maskedContext should not be instantiated as null 2015-10-31 04:05:44 +03:00
Jim a2d26c82ea Merge pull request #5093 from jimfb/avoid-children-to-string-coercion
Should not coerce children prop on custom elements to a string.  Fixes #5088
2015-10-30 13:42:05 -07:00
Paul O’Shannessy 68eb1a6fb6 Add integrity to HTML property config 2015-10-30 13:35:51 -07:00
Jim 86fc94750a Should not coerce children prop on custom elements to a string. Fixes #5088 2015-10-30 13:33:21 -07:00
Alex Dajani aa6fcf902c Fixed unclear wording in comment
Perhaps not understanding what "key a set a fragment..." is supposed to mean.  Hopefully I'm not misreading this as a typo.
2015-10-29 23:20:18 -07:00
Sebastian Markbåge d914f15c0e Revert "Overwriting of mutated props in constructor" 2015-10-29 22:36:38 -07:00
Christoph Pojer 1384d43f53 Merge pull request #5321 from cpojer/update-tests
Update tests
2015-10-29 18:42:12 -07:00
Jim d15e2fcd8e Merge pull request #5320 from drdelambre/overwrite_props
Overwriting of mutated props in constructor
2015-10-29 18:15:52 -07:00
Alex Boatwright cc09ed940f classes in the tests when can 2015-10-29 18:11:28 -07:00
Paul O’Shannessy 12c214a992 Merge pull request #5328 from zpao/non-native-event-name-dispatch
Use a custom event type for our event dispatching in ReactErrorUtils
2015-10-29 17:54:18 -07:00
cpojer ac17bdaaba Remove generateFromMetadata and getMetadata usage. 2015-10-29 15:45:30 -07:00
Paul O’Shannessy 29523d0113 Use a custom event type for our event dispatching in ReactErrorUtils
It turns out that IE doesn't like when native events types are used. There may
have been more involved at play but this fixes the issue.
2015-10-29 15:39:14 -07:00
Paul O’Shannessy d95a2239a8 Use a getter for canDefineProperty check.
This ensures that we treat es5-sham as a broken implementation of defineProperty and we won't try to use it.
2015-10-29 15:17:50 -07:00
cpojer 2ecfc4f8fb Codemod old APIs away. 2015-10-29 12:40:52 -07:00
Alex Boatwright c341269ab2 simple fix to prevent overwriting of mutated props 2015-10-28 23:37:29 -07:00
Evan Vosberg f8b4affb87 Add non-standard property for supporting Safari mask-icon.
See also: https://developer.apple.com/library/prerelease/mac/releasenotes/General/WhatsNewInSafari/Articles/Safari_9.html#//apple_ref/doc/uid/TP40014305-CH9-SW20
2015-10-28 17:35:43 +01:00
Ben Alpert 7f205e9c1b Make sure top-level callback has correct context
Closes #5125 -- incorporates essentially the same fix with a much simpler test case. Thanks @yiminghe for reporting!
2015-10-27 13:11:45 -07:00
Ben Alpert 65b9ceb4f8 Merge pull request #5209 from antoaravinth/5189
Don't instrument listeners for ReactDefaultPerf
2015-10-27 11:59:02 -07:00
Ram Kaniyur ad654ceb66 Took keyOf outside the function. 2015-10-28 00:48:54 +11:00
Ram Kaniyur e26666fb1e Mangle __html in prop validation. 2015-10-28 00:18:00 +11:00
Ants 59db07c4f9 Fix for the issue #5189
Fix for lint issues

Added the test cases for the issue 5189

Removing empty space

Removing the Eventplugin instrumentation code

Removing unwanted white space
2015-10-27 16:33:22 +05:30
Ben Alpert e603644255 Merge pull request #5291 from spicyj/afu-cycle
Fix cycle in AutoFocusUtils
2015-10-26 15:03:15 -07:00
Ben Alpert f558b95584 Fix cycle in AutoFocusUtils
In 5c5d2ec182 I accidentally introduced a dependency cycle:

AutoFocusUtils -> findDOMNode -> ReactDOMComponent -> AutoFocusUtils

This breaks some tools internally. We're not actually using findDOMNode in AutoFocusUtils any more so we can just delete it.
2015-10-26 14:52:23 -07:00
Ben Alpert 22a240fd39 Avoid lastProps[key] lookup in initial render
This makes both Firefox and IE 15-20% faster in initial render (!!). On my PE benchmark, createElement is now on par with HTML in Firefox and faster in IE11 (before, it was slower).
2015-10-24 12:19:30 -07:00
Ben Alpert 6269ef62cf Two more fixes for document.createElement mode
Is this all of them? I hope so.

- Set text content after creating hierarchy, like the text is a child. I should've done this originally but I guessed it wouldn't matter. I was wrong (~20% perf difference in IE11).
- IE throws when setting an enum-like property to an invalid value. I tried setting every property to the string 'a' and changed the ones that threw to be MUST_USE_ATTRIBUTE. I think these are all correct -- encType is the most suspicious one based on the existing comments but I tested in IE8 and it works fine as an attribute.
2015-10-23 22:46:02 -07:00
Ben Alpert 4106251316 Merge pull request #5261 from spicyj/dom-null-undef
Bug fixes for createElement mode
2015-10-23 15:56:21 -07:00
Ben Alpert b447b40958 Use attributes to set .type
According to the internet, this should work and it appears to work fine on all the browsers I tested.
2015-10-23 12:08:10 -07:00
Ben Alpert 7221e1b2e9 Don't set DOM props when switching between unset/undefined/null 2015-10-23 11:52:29 -07:00
Ben Alpert 263ca4792e Perf: Insert nodes top-down in IE and Edge 2015-10-23 10:59:27 -07:00
Paul O’Shannessy 4d41cf740a Merge pull request #5250 from conorhastings/track-default-property
add default attribute for use with track element
2015-10-22 20:20:44 -07:00
conorhastings bb3a326ecd add default attribute for use with track element 2015-10-22 22:47:17 -04:00
Ben Alpert b106e96864 Fix lint for eslint 1.7 2015-10-21 14:48:47 -07:00
yiminghe 85fc28624c fix wrong method name 2015-10-22 00:29:22 +08:00