Commit Graph

1897 Commits

Author SHA1 Message Date
yiminghe 47e9cfb975 fix change event type 2015-06-24 17:06:35 +08:00
JD Isaacks d944d3f941 Prevent creating invalid closing tags
fixes #2756
2015-06-23 17:58:52 -04:00
Ben Alpert c5fb3ff987 Merge pull request #4139 from spicyj/dom-refs
DOM components as refs
2015-06-22 16:58:01 -07:00
Ben Alpert d810079101 Remove constructAndRenderComponent
These were never part of the public API and shouldn't have been part of the React object. Now they're not.
2015-06-22 16:55:19 -07:00
Ben Alpert eefda9377c Add legacy methods to DOM components for compatibility 2015-06-22 16:51:21 -07:00
Ben Alpert ffd527f593 DOM components as refs
Still missing: .props/.getDOMNode warnings.
2015-06-22 16:51:21 -07:00
Ben Alpert 643651b8e5 Wrap all top-level components for consistency 2015-06-22 16:51:04 -07:00
Sebastian Markbåge 9d2c9b5864 Merge pull request #4196 from oluckyman/componentDidUnmount-warning
Show warning when componentDidUnmount is defined
2015-06-22 16:48:27 -07:00
oluckyman 2568933ca3 Update warn message and move it to the error-catching block 2015-06-22 23:52:37 +02:00
Jim 859b7957b7 Merge pull request #4190 from dantman/fix-%s-module
Don't try building a %s module.
2015-06-22 14:45:19 -07:00
Ben Alpert 7e0a544ae3 Merge pull request #4164 from spicyj/jest-wc
Fix exceptions when running `grunt test --debug`
2015-06-22 14:22:41 -07:00
oluckyman db40beafbe Show warning when componentDidUnmount is defined
Fixes #4194
2015-06-22 21:09:33 +02:00
Daniel Friesen 357ed8ebd7 Add a comment about why the string is split up. For future readers of this file. 2015-06-22 12:04:29 -07:00
Daniel Friesen c8d606196d Don't try building a %s module.
React's build tools are reading the `require("react")` and `react("%s")` inside the warning string and thinking they are actual requires.
2015-06-21 21:14:04 -07:00
Ben Alpert 64b5f043dd Merge pull request #4170 from johanneslumpe/patch-1
Guard against a null node
2015-06-20 16:42:23 -07:00
Jim ede27d2e86 Merge pull request #4172 from jimfb/freeze-props
Freeze ReactElement.props in dev mode
2015-06-19 14:13:17 -07:00
Johannes Lumpe b16f9d42b1 Guard against a null node
This could fix #2619
2015-06-19 11:21:22 +03:00
Sebastian Markbage c1330dcfcd Unit tests for unmounted setState and isMounted 2015-06-18 22:55:52 -07:00
Jim 95373ce769 Freeze ReactElement.props in dev mode 2015-06-18 14:49:06 -07:00
Sebastian Markbage 8659223939 Lint fixes 2015-06-18 14:12:21 -07:00
Sebastian Markbage dddebd1344 Use hack to support isMounted without stateful module
This hack allow us to get rid of the stateful module ReactLifeCycle since
we can infer the value of isMounted even without it. This gets rid of
the try/catch which is deopting all mountComponent calls.

As a next step we could deprecate isMounted completely and avoid stateful
APIs. Since it can be easily simulated if you truly need it.
2015-06-18 14:10:12 -07:00
Sebastian Markbage 140af9b985 Allow callbacks to be enqueued during componentWillMount
Since I fixed the server-side rendering it is now possible to trigger these
callbacks on the client alone. They will still be queued up on the server
but they are never executed.
2015-06-18 13:35:39 -07:00
Sebastian Markbage e737acb472 Let updates be enqueued during render
This allows updates to be enqueued during render. setState in
componentWillMount will still be collected as part of the first pass so
if nothing else get added as pending, they won't trigger a second rerender.

This allow us to get rid of one more stateful special case.
2015-06-18 13:35:39 -07:00
Sebastian Markbage 40b7c19a89 Use a custom batching strategy for server rendering
This simply ignores any enqueued actions. This means that we don't have to have special logic for componentWillMount. It is just that those updates are never enqueued.
2015-06-18 13:34:30 -07:00
Sebastian Markbage 3af73834d9 Remove currentlyUnmountingComponent
This was used for any invariant that was subsequently removed. It turns
out that this is completely unnecessary now. Any setState calls will
enqueue and update and the component added to the update queue. However,
since the pending fields are reset after componentWillUnmount, any update
will still be ignored.
2015-06-18 12:36:50 -07:00
Sebastian Markbage 7443f63ae9 Remove an unnecessary warning
It was impossible to get here because if you enqueue something

Also ensure that they're only used in DEV because we will be reading
state that is DEV only here.
2015-06-18 12:36:45 -07:00
Sebastian Markbage c4cafcecd9 Move current owner to isomorphic
This should only be used for tracking string refs. For that purpose, we
need a single central stateful module that is coupled to createElement.
Which is why it needs to live in isomorphic.

Eventually this will go away completely.
2015-06-18 09:05:35 -07:00
Ben Alpert d76e3e1632 Fix exceptions when running grunt test --debug 2015-06-17 20:57:04 -07:00
Ben Alpert 016021207c Merge pull request #4154 from spicyj/gh-3478
Improve error message when mounting non-string/function elements
2015-06-17 16:26:02 -07:00
Paul O’Shannessy a841b4f5fb Merge pull request #2981 from hzoo/jsdoc-fixes 2015-06-17 16:06:37 -07:00
Ben Alpert 642323e5a8 Improve error message when mounting non-string/function elements 2015-06-17 12:04:05 -07:00
Paul O’Shannessy 10ada3b5f5 Merge pull request #4157 from zpao/svg-image
Support SVG image, other related cleanup
2015-06-17 11:44:29 -07:00
Paul O’Shannessy ace49f304b Merge pull request #4100 from zpao/deprecate-react-calls
Deprecate non-isomorphic react methods in npm module
2015-06-17 11:15:46 -07:00
Paul O’Shannessy bdbbe40b1e Merge pull request #4140 from zpao/mv-errorutils
Move ReactErrorUtils out of vendor
2015-06-17 10:51:02 -07:00
Paul O’Shannessy efdd75685d Support SVG image 2015-06-17 10:47:53 -07:00
Paul O’Shannessy 572a1d895c Update getMarkupWrap with list of SVG supported in ReactDOM 2015-06-17 10:40:11 -07:00
Paul O’Shannessy 265fdc3eed Rewrite SVG initialization in getMarkupWrap 2015-06-17 10:37:13 -07:00
Ben Alpert c265504fe2 Merge pull request #4152 from spicyj/rce
Disallow passing a DOM component to reactComponentExpect
2015-06-16 23:33:09 -07:00
Ben Alpert cf6b3ff0e2 Disallow passing a DOM component to reactComponentExpect
We won't be able to support this after DOM-components-as-refs but we don't expect many people to be passing DOM components to this function anyway, and it should be fairly straightforward for people to clean up failing unit tests using this function.

(This module also isn't public API and never has been.)
2015-06-16 17:51:06 -07:00
Ben Alpert 4070c4ca20 Disallow passing a DOM component to findAllInRenderedTree
We won't be able to support this after DOM-components-as-refs but we don't expect many people to be passing DOM components to this function anyway, and it should be fairly straightforward for people to clean up failing unit tests using this function.
2015-06-16 16:37:37 -07:00
Ben Alpert c9b0c26966 Invert logic in findAllInRenderedTreeInternal
With DOM components we won't be able to go from public instance to internal instance reliably, so do the traversal on internal instances.
2015-06-16 14:38:03 -07:00
Paul O’Shannessy e571b32061 Wrap calls to deprecated functions with a warning. 2015-06-16 13:23:40 -07:00
Sebastian Markbåge 2d29691019 Merge pull request #4105 from sebmarkbage/moveismounted
Move isMounted logic into the ReactUpdateQueue
2015-06-16 10:36:04 -07:00
Paul O’Shannessy 93be1939b5 Move ReactErrorUtils out of vendor
Some other small changes now that it's linted.
2015-06-16 01:16:17 -07:00
Ben Alpert 78da37da50 Merge pull request #4137 from spicyj/setpropsinternal
Remove _setPropsInternal
2015-06-15 23:33:14 -07:00
Ben Alpert ee367a8a02 Remove _setPropsInternal
Nothing uses this.
2015-06-15 23:28:27 -07:00
Ben Alpert d67f23fb0e Merge pull request #4115 from spicyj/dom-hash
Reduce hash lookups for DOM properties
2015-06-15 14:15:55 -07:00
Prathamesh Sonpatki 7b0764b1d2 Fix typos in ReactServerRenderingTransaction.js
- There were some more occurrences of typos fixed in
   https://github.com/facebook/react/pull/4123.
2015-06-15 12:42:45 +05:30
Carter Chung c01352232b Corrected spelling
ReactReconcileTransaction.js
2015-06-13 18:21:17 -07:00
Ben Alpert 434a64a08a Merge pull request #4114 from spicyj/void-warn
Add owner to void element children warning
2015-06-12 21:41:24 -07:00