Commit Graph

635 Commits

Author SHA1 Message Date
Sebastian Markbåge
a05cef4a40 Merge pull request #852 from spicyj/no-store-mount-image
Don't store mount image on component instance
2014-01-17 15:44:57 -08:00
Paul O’Shannessy
ef4bda326e Merge pull request #822 from chenglou/setstate
better error for bad setState arguments and mergeHelpers
2014-01-17 13:05:06 -08:00
Jeff Morrison
89819de4f2 Kill last remaining use of $ in React
It's only used here, so let's just inline this and get rid of the additional module.
Also it will make people like this guy happy: https://github.com/facebook/react/issues/900

(of course he might be even more happy if he wasn't using MS TFS....but that's a much bigger diff, and not one I can write...)
2014-01-15 16:46:11 -08:00
Alex Zelenskiy
b5f905523b Adding 'scope' to list of standard html attributes in react
scope is used for screen readers, so it would be nice to have. Documentation here: http://www.w3.org/TR/WCAG20-TECHS/H63
2014-01-15 16:44:28 -08:00
Isaac Salier-Hellendag
4bdea53d6e Add topContextMenu to the event dependencies for SelectEventPlugin 2014-01-15 16:43:41 -08:00
Christopher Chedeau
9ade3c26d3 Introduce PropTypes.shape
This diff introduces PropType.shape which lets you type an object. PropType.object was already defined and since it isn't a function I couldn't really overload the meaning to also accept a type list. Instead of doing hackery, I decided to name it `shape`.

An example where this could be used is style:

```
  propTypes: {
    style: PropTypes.shape({
      color: PropStyle.string,
      fontSize: PropTypes.number
    })
  }
```
2014-01-15 16:42:04 -08:00
Cheng Lou
0906d282ec throw when using component/component class as mixin
throw invariant error to help people new to mixins, so that they don't get misled into trying to mixin components into another component
2014-01-15 16:41:45 -08:00
Pete Hunt
615dedc3e2 Merge pull request #881 from spicyj/checkbox-not-checked
"checkbox" not "checked"
2014-01-15 11:04:36 -08:00
Ben Alpert
091534c376 Wrap _performComponentUpdate call in try/finally
Fixes #208. If you attempt a state update with a bad state then the render will fail (and the DOM won't change) but if you switch back to a valid state later then it'll rerender properly.
2014-01-14 20:30:07 -08:00
Ben Alpert
d96c6914c7 Make findComponentRoot faster with more nodeCache
This is an alternative, less-invasive, fix for #891.

Test Plan:
On http://jsbin.com/OqOJidIQ/2/edit, got timings like

[75, 56, 30, 36, 27, 27, 28, 32, 27, 27, 28, 31]

instead of the old

[75, 729, 46, 32, 28, 34, 26, 27, 27, 30, 26, 26].

I also added a counter to getID and saw it was called 3014 times instead of the old 636264. (3014 is the number of nodes (3000) plus 3 calls that happen for the initial render and 1 for each of the 11 renders after that.)
2014-01-14 18:32:40 -08:00
cpojer
c885abbf21 Allow null return values for functions to-be-merged. 2014-01-14 13:05:31 -08:00
Pete Hunt
d9b959884b Merge pull request #878 from spicyj/mount-unmounted
Improve "Can only mount when umounted" message
2014-01-13 14:38:07 -08:00
Ben Alpert
5857eb884c "checkbox" not "checked"
I can only assume this was a typo.
2014-01-13 14:28:56 -08:00
Ben Alpert
2f027fce2d Improve "Can only mount when umounted" message 2014-01-13 13:26:24 -08:00
Isaac Salier-Hellendag
ad70848e80 Use fallback data for composition events if necessary 2014-01-13 13:15:17 -08:00
Pete Hunt
c6f91ee6e8 Merge pull request #864 from spicyj/transition-key-set-faster
Rewrite mergeKeySets to be O(n) instead of O(n^3)
2014-01-13 12:50:42 -08:00
Ben Alpert
1825f30353 Always call callback in component context
This brings these other call sites in line with line 67 of ReactUpdates.js:

callbacks[j].call(component);
2014-01-13 08:59:48 -08:00
Cheng Lou
3d47177596 fix propTypes.any.weak test
accidentally copied over `.string.weak` and didn't change it
2014-01-12 20:47:16 -08:00
Paul O’Shannessy
59cba3e9f7 Add missing semicolon I missed in #865 2014-01-11 23:29:35 -08:00
Paul O’Shannessy
6ebb1cb3ee Merge pull request #865 from jergason/link-to-docs-on-keys-warning
link to docs in unique key prop warning
2014-01-11 23:21:46 -08:00
Jamison Dance
972acb4581 link to docs in unique key prop warning 2014-01-11 22:17:06 -07:00
Paul O'Shannessy
2c335b0e57 Quieter devtools upsell
Check that we're not in a iframe before upselling.
2014-01-10 21:11:33 -08:00
Cheng Lou
d14ce00dc3 add React.PropTypes.any
add the ability for React propTypes to accept an `any` type: `someProp: React.PropTypes.any`.
This is more useful when combined with `.isRequired`, to enforce that _something_ is passed:
`someProp: React.PropTypes.any.isRequired`
2014-01-10 21:11:11 -08:00
Pete Hunt
d8a8f6a881 Upsell dev tools
People probably don't know these exist. Add some information about React
dev mode as well as a link to the developer tools when using Chrome.
2014-01-10 21:10:54 -08:00
Tim Yung
bcacd17f8b Better LinkedValueMixin Warning
Input elements of type `checkbox`, `hidden`, or `radio` can have a `value` without `onChange`. Also, if the input is `disabled`, who cares that it doesn't have an `onChange`?
2014-01-10 21:10:01 -08:00
Tim Yung
f71dbab31a Fix Undefined ownerDocument Fatal in IE8
This fixes a JS fatal in IE8 when `topLevelTarget.ownerDocument` is sometimes undefined.
2014-01-10 21:07:23 -08:00
Tim Yung
73d9d286ee Fix EnterLeaveEventPlugin Test in jsdom
This is a follow-up to #803.

In jsdom (used for internal testing), `<iframe>` does not properly create a default document. This makes the `EnterLeaveEventPlugin` tests work for jsdom, too.

Open source does not need this because it uses PhantomJS.
2014-01-10 21:04:39 -08:00
Paul O’Shannessy
49d6d2169d Remove trailing whitespace 2014-01-10 21:04:39 -08:00
Ben Alpert
1efb14bcf6 Rewrite mergeKeySets to be O(n) instead of O(n^3) 2014-01-10 15:31:15 -08:00
Timothy Yung
338ce603f9 Merge pull request #797 from spicyj/should-update
Fix cases where owner warning is shown
2014-01-09 18:50:21 -08:00
cpojer
95cb79a93e Remove CallbackRegistry 2014-01-09 16:58:48 -08:00
cpojer
b713c2c696 Add PropTypes.component to demand a single React component. 2014-01-09 16:58:47 -08:00
Ben Alpert
f5a48f1ff4 Fix cases where owner warning is shown
In b0431a5 I added the check in the wrong place which could cause the warning to be shown because of key changes rather than owner changes like the warning suggests.
2014-01-09 16:48:58 -08:00
Timothy Yung
f47238be41 Merge pull request #803 from spicyj/gh-788
Use proper window object for iframe in enter/leave
2014-01-09 16:35:07 -08:00
Timothy Yung
851f08bdc2 Merge pull request #780 from syranide/newhasevent
Further cleanup of isEventSupported
2014-01-09 16:34:57 -08:00
Timothy Yung
68bac7fbf0 Merge pull request #778 from syranide/flipwheel
Fix WheelEvent incorrectly flipping sign of deltaY
2014-01-09 16:34:47 -08:00
Timothy Yung
dea6063dc9 Merge pull request #771 from spicyj/gh-694
Don't get selection if no active element
2014-01-09 16:34:27 -08:00
Paul O’Shannessy
1f5c8d21d8 Merge pull request #786 from spicyj/gh-781
Fix potential memory leak when unmounting
2014-01-09 13:08:07 -08:00
Timothy Yung
2c93cd0267 Merge pull request #640 from spicyj/immutable-props-2
Don't mutate passed-in props, take 2
2014-01-09 12:52:58 -08:00
Ben Alpert
4d3a9c87d1 Don't store mount image on component instance 2014-01-08 22:53:59 -08:00
Cheng Lou
3c40fb2e01 better error message for mergeHelpers and setState 2014-01-08 21:56:48 -08:00
Ben Alpert
2716f38861 Spy on purgeID instead of unmountIDFromEnvironment 2014-01-08 21:48:48 -08:00
Ben Alpert
e2f094614f Fix potential memory leak when unmounting
Fixes #781.
2014-01-08 21:43:52 -08:00
Paul O’Shannessy
0c3628cd8d Merge pull request #757 from spicyj/ng
Don't tack on EventPluginHub globally
2014-01-08 15:23:47 -08:00
Ben Alpert
1db788b62c Don't tack on EventPluginHub globally 2014-01-08 15:20:05 -08:00
Paul O'Shannessy
23ab30ff87 Revert textContent
Reverts 309a88bcf6 because this is causing
issues internally. I'll try to get a repro soon.
2014-01-07 21:10:03 -08:00
Pete Hunt
b1597ab2d7 Warn for common forms misuse 2014-01-07 21:08:13 -08:00
Ben Alpert
a2ecee5353 Use proper window object for iframe in enter/leave
Fixes #788.
2014-01-07 08:36:42 -08:00
Ben Alpert
657602135c Don't mutate passed-in props, take 2 2014-01-06 21:42:04 -08:00
Ben Newman
4f57515f91 Fix some odd spacing inconsistencies in ReactRenderDocument-test. 2014-01-06 21:13:25 -08:00