Commit Graph
713 Commits
Author SHA1 Message Date
Paul O’Shannessy 49747347fb Merge pull request #1048 from spicyj/form-onreset
Add onReset event for forms
2014-02-11 14:42:15 -08:00
Paul O’Shannessy 8cf5882447 Merge pull request #1021 from spicyj/close-finally
Set isInTransaction to false even if close throws
2014-02-11 09:27:09 -08:00
Sebastian Markbage fc2805fe03 Add warnings when accessing properties/methods on unmounted components
This creates a membrane around the React component prototype. It warns if you
try to access properties on the component before it's unmounted. Before it's
mounted, it should be considered a descriptor and not an actual instance.

The workaround, for unknown types, is to access the constructor using
component.type which has static methods on it.
2014-02-11 09:13:03 -08:00
Paul O’Shannessy 66b290c32f Merge pull request #1042 from adelevie/master
Small grammar fix in ReactComponent.js
2014-02-10 16:18:55 -08:00
Pete Hunt c544b01cad Delete useless shit in ReactMount
lol
2014-02-10 14:31:15 -08:00
Pete Hunt 5f1d4d7c14 ReactInjection
Consolidate everything we can inject in core into one place. Does not expose publicly -- this is an internal moving of shit around.
2014-02-10 14:30:59 -08:00
Paul O’Shannessy c1c2dd9a89 Add noValidate and corresponding formNoValidate
Fixes #988
2014-02-10 12:01:28 -08:00
Paul O’Shannessy acfef143ae Merge pull request #1045 from spicyj/srcdoc
Add HTML5 srcdoc property for iframes
2014-02-10 12:00:43 -08:00
Ben Alpert 30fd3a30b0 Add onReset event for forms
Test Plan:
Tested in Chrome and IE8.
2014-02-10 11:12:26 -08:00
Ben Alpert 40547125f8 Add HTML5 srcdoc property for iframes 2014-02-09 21:03:37 -08:00
Alan deLevie 1194a040f9 remove comma in comment 2014-02-08 19:26:36 -05:00
Alan deLevie 42e65ddb3e Small comment grammar fix in ReactComponent.js 2014-02-08 19:25:49 -05:00
Paul O'Shannessy 26fb009e0c fix comment 2014-02-07 13:51:39 -08:00
Cheng Lou 9ae002503c Ensure a pooled class releases back into the pool an instance of that class
Also added tests for PooledClass.

Noticed that some places use `ReactReconcileTransaction.release(transaction)`, when `transaction` might be of another class, say `ReactServerRenderingTransaction` (still a Github PR). This catches that.
2014-02-07 13:51:14 -08:00
cpojer 71c10b9f45 Add PropTypes.ArrayOf and clean up ReactPropTypes.js 2014-02-06 11:28:51 -08:00
Pete Hunt 73b4f954f2 DOMIDOperations -> BackendIDOperations 2014-02-05 19:47:54 -08:00
Paul O’Shannessy e0262d50f9 Skip assignment, just call updateOptions directly 2014-02-05 16:41:57 -08:00
Ben Alpert c7dd8d4217 Refactor updateOptions to take value 2014-02-05 11:46:34 -08:00
Ben Alpert 9c5c1ed902 Make uncontrolled select not set value on update 2014-02-05 11:39:44 -08:00
Paul O’Shannessy 2031946946 Re-add strict warning to Danger test
Lost in the great reorg
2014-02-05 11:01:29 -08:00
Paul O’Shannessy a528beeda9 Put ReactWithAddons in browser/ 2014-02-04 19:49:58 -08:00
Pete Hunt 1a39c3143c The great reorg of February 2014 2014-02-04 19:49:58 -08:00
cpojer a21979404c Add canUseEventListeners to ExecutionEnvironment. 2014-02-04 15:09:41 -08:00
Pete Hunt 9730759322 Fix cloneWithProps() to allow overriding props
This is a clear bug.
2014-02-04 14:37:53 -08:00
Pete Hunt 945f788a41 React.Children helpers
Adds React.Children and map(), forEach() and only().
2014-02-04 14:37:44 -08:00
Paul O’Shannessy 8d1d29286a Merge pull request #1013 from bripkens/lint
Fix use strict warnings
2014-02-04 12:39:41 -08:00
Ben Alpert 17f602f924 Set isInTransaction to false even if close throws
If a transaction wrapper's closer throws (such as flushBatchedUpdates in ReactDefaultBatchingStrategy) then we still want to properly deinitialize the transaction by setting isInTransaction to false. Without this, we can't reuse the transaction object (in this case, all future batched updates would fail because nested transactions aren't allowed).
2014-02-04 12:03:29 -08:00
Pete Hunt 7aaa3a4ed1 Merge pull request #922 from spicyj/submit-submit
Fix double-binding to submit event
2014-02-04 10:25:34 -08:00
Pete Hunt 3642b6ea62 Merge pull request #982 from bripkens/async-tostring
fix(ServerRendering): execution should be async
2014-02-04 10:24:22 -08:00
Andreas Svensson f9bb6e46f1 Remove unnecessary catch-clauses for try-finally 2014-02-04 18:07:34 +01:00
Ben Ripkens e14555caed Use lowercase "string" so that the documentation complies with typecheckers 2014-02-04 09:05:52 +01:00
Ben Ripkens 220687abda Add new lines above use strict and keep directives at the top 2014-02-04 07:47:35 +01:00
Paul O’Shannessy 19ff353fdd Merge pull request #975 from spicyj/transaction-no-catch
Refactor Transaction to not rethrow errors
2014-02-03 21:43:27 -08:00
Paul O’Shannessy 4992423547 Merge pull request #1005 from jjt/boolattr
Fix boolean attributes as per HTML5 spec
2014-02-03 18:17:46 -08:00
Cheng Lou 5dabba999b add missing 'use strict' to getTestDocument 2014-02-03 12:52:46 -08:00
Cheng Lou 57bf7d21f3 fix transaction comment from componentDidRender to componentDidUpdate 2014-02-03 12:52:36 -08:00
Ben Newman ce95c3d042 [React] Don't attach to document in ReactTestUtils.renderIntoDocument. 2014-02-03 12:51:34 -08:00
Ben Ripkens 92fdc1562d Use strict in tests 2014-02-03 20:29:33 +01:00
Ben Ripkens 4e9352f8f8 Fix use strict warnings 2014-02-03 13:11:51 +01:00
Ben Ripkens cd2aecc377 fix(ServerRendering): execution should be sync
The documentation states that React.renderComponentToString
'uses a callback API to keep the API async', but the
implementation is actually synchronous. In order to maintain
this contract the callback should always be called
asynchronously or be change to a synchronous API.

As per the discussion of pull request 982, the API should
be changed to a synchronous one.
2014-02-03 11:39:09 +01:00
jjt f7949c1c23 Fix boolean attributes as per HTML5 spec 2014-01-31 17:24:48 -08:00
Paul O’Shannessy fce6d114fe Merge pull request #973 from syranide/hidethekill
Fix references to the old ReactID syntax
2014-01-31 15:33:57 -08:00
Josh Duck 5d7563f706 Fix warning for numeric properties
Number('.1') === 0.1, and react uses dot-prefixed keys
for children. Whoops. Nuke the non-numeric requirement, and just
check a regex. This seems performant enough in micro-benchmarks:
http://jsperf.com/numericlike
2014-01-30 16:54:01 -08:00
Pete Hunt 4cbc4b58f6 Support children and ref for cloneWithProps()
We're not handling these correctly.
2014-01-30 16:53:47 -08:00
Josh Duck 00f2a053f0 Warn for numeric object properties
Numeric keys will be ordered sequentially in Chrome/Firefox.

Warn the user if such keys are set on a child.
2014-01-29 14:08:23 -08:00
Ben Newman 65490a09e6 Use querySelectorAll instead of getElementsByName in ReactDOMInput.
We've been able to use `querySelectorAll` in all the browsers that we
support for some time now, but we haven't been able to test code that uses
it in the older version of `jsdom` that we were using, until recently.

Besides the general goal of modernizing our code, the impetus for this
specific change is that I'm trying to support testing without having to
render nodes into an actual document. The `.getElementsByName` method is
only defined on `document` and only works if the nodes you care about are
contained by the document.

On the other hand, `querySelectorAll` works on any DOM node, and allows a
more precise selection of just the `<input type="radio">` elements that
have the appropriate name.

IE8's implementation of `querySelectorAll` supports attribute-based
selectors, which is all we need here.
2014-01-29 14:08:21 -08:00
Pete Hunt 132e8b3c43 Merge pull request #880 from jbaiter/reactlink_checkbox
Support two-way binding for checkboxes in LinkedValueMixin via 'checkedLink' property
2014-01-29 12:44:30 -08:00
Ben Alpert d300df51e1 Refactor Transaction to not rethrow errors
Rethrowing errors makes debugging harder. This makes it so that an exception in a render method can be caught using the purple stop sign (or the blue one, of course) in Chrome.
2014-01-26 15:51:37 -08:00
Andreas Svensson 989eb2e7d9 Fix references to the old ReactID syntax 2014-01-26 21:26:58 +01:00
Pete Hunt 526be1570e Fix memory leak with renderComponentToString()
This is leaking memory. Move event registration to mount time.
2014-01-24 18:23:51 -08:00