Commit Graph

67 Commits

Author SHA1 Message Date
Sebastian Markbage 3ea3274ca4 Clone on mount
This is the first step towards descriptors. This will start cloning the
component when it's mounted instead of mounting the first instance.

This avoids an issue where a reference to the first instance can hang around
in props. Since a mounted component gets mutated, the descriptor changes.

We don't need to clone the props object itself. Mutating the shallow props
object of a child that's passed into you is already flawed. Those cases need to
use cloneWithProps. A props object is considered shallow frozen after it leaves
the render it was created in.
2014-03-10 15:28:54 -07:00
Ben Alpert 21e06196cd Fix removing DOM property with mapped name 2014-03-06 17:50:01 -08:00
Ben Alpert ec8b0d7fbf Add srcSet attribute
Chrome beta supports this now: http://blog.chromium.org/2014/02/chrome-34-responsive-images-and_9316.html.
2014-03-03 17:12:00 -08:00
Pete Hunt a8fc3b940d Move UI-thread-only browser modules to browser/ui/
This also deletes an unused module.
2014-03-03 15:07:11 -08:00
Cheng Lou 99dab49f92 Refactor rendering to string without checksum & React ID
Finalize API for rendering to static markup.
Instead of passing a boolean option to `renderComponentToString`, just use another method.
2014-03-03 15:06:27 -08:00
Sebastian Markbage eee04b19e1 Add monitor module for logging instrumentation
This adds an instrumentation hook for logging so that we can monitor invalid API
usage before we're ready to issue a warning.

I took the opportunity to update some console.warns to use the warning module
instead. The remaining console.warns
will be replaced by the warning module after we've cleaned up the callsites.
2014-03-03 15:05:53 -08:00
Cheng Lou f734083a17 Better name for server-side rendering without React ID & checksum
"staticMarkup" sounds way better than "noChecksumNoID".
Also avoids some double negations.
2014-03-03 15:05:35 -08:00
Jan Kassens e39c19423a temporarily disable warning 2014-03-03 15:05:10 -08:00
Cheng Lou 6203e53d16 Fix IE8 disabled input throwing on focus
When IE8 focuses a disabled item, it throws
This makes sure the we're not focusing the item during selection restoration/autofocus when the element's disabled.
2014-03-03 15:04:34 -08:00
Paul O’Shannessy ae72e6ef91 Merge pull request #1082 from spicyj/class-false
Ensure className={false} turns into string 'false'
2014-02-27 16:41:41 -08:00
Ben Alpert 854d1f7c1b Add update() to React.addons 2014-02-24 14:05:29 -08:00
Pete Hunt b79a3cbd21 Break more browser deps in core
This is part of what Sebastian suggested. We require it into every component that explicitly needs it and inject it as a default mixin for composite components in
the browser environment. This change frees us up to inject everything in ReactComponent.
2014-02-20 16:55:17 -08:00
Jason Bonta 0790040aac update docblock
...for typechecking.
2014-02-20 16:55:01 -08:00
Cheng Lou 7eb33ef176 simplify mountImageIntoNode's way of putting markup in innerHTML
Instead of removing the node from the document before changing its innerHTML, just do it directly.
The comment seems to be outdated for years. http://jsperf.com/detach-while-setting-innerhtml
2014-02-20 16:54:43 -08:00
Cheng Lou 5545887a48 Allow rendering markup string without checksum and React ID
This fixes https://github.com/facebook/react/pull/994.
Also fixes https://github.com/facebook/react/issues/1079.
Server-rendering without ID/checksum now works. Also won't call didMount.
2014-02-20 16:54:20 -08:00
Paul O’Shannessy 95edc396df version bump to 0.10.0-alpha 2014-02-19 22:53:29 -08:00
Ben Alpert 1de77f1fbe Ensure className={false} turns into string 'false'
Fixes inconsistency shown by http://jsfiddle.net/zpao/qeXLm/.
2014-02-19 13:47:35 -08:00
Cheng Lou e13977c0c2 Merge pull request #939 from spicyj/simulate-synthetic
Simulate synthetic events using ReactTestUtils
2014-02-19 10:58:54 -08:00
Ben Alpert 36e97bac21 Simulate synthetic events using ReactTestUtils
Most of the time this is what you want to do, so I've renamed what was Simulate to be SimulateNative.

Now Simulate.change does what you expect, so this fixes #517 and fixes #519.
2014-02-19 00:04:16 -08:00
Pete Hunt 93e7778d5f Merge pull request #1112 from petehunt/testutils-addons
Add ReactTestUtils to addons
2014-02-18 22:58:30 -08:00
petehunt 8122cadeb4 Add ReactTestUtils to addons 2014-02-18 22:54:24 -08:00
petehunt cadd6cbb6c add ReactCSSTransitionGroup to addons and document it 2014-02-18 22:47:53 -08:00
Paul O’Shannessy f81d16960c Merge pull request #1128 from spicyj/media-attrs
Add media element attributes
2014-02-18 18:04:43 -08:00
Paul O’Shannessy 8a47813baa Update copyrights for 2014.
grep -rl 'Copyright 2013 Facebook' static_upstream | xargs perl -pi -w -e s/Copyright 2013 Facebook/Copyright 2013-2014 Facebook/g;'

Not going to check in a script to do this since it will just change every year.
Closes #1006
2014-02-18 17:06:43 -08:00
Paul O’Shannessy 792d8aca86 Merge pull request #1116 from spicyj/gh-1115
Add download and hrefLang attributes
2014-02-18 13:42:24 -08:00
Ben Alpert 112a20ce73 Add media element attributes
Fixes #1124.

I didn't add `volume` because it requires more complicated logic to control properly and I didn't add `paused` because to set it we need to call play() or pause() -- perhaps a mutation method is appropriate.
2014-02-18 12:30:14 -08:00
Ben Alpert d8fd1af4a0 Pool ancestors list so event system is reentrant 2014-02-17 16:37:15 -08:00
Ben Alpert ae7e44ec84 Add download and hrefLang attributes
Fixes #1115.
2014-02-17 15:13:14 -08:00
Ben Alpert 2f0bb69708 Prevent error thrown when removing event target
Fixes #1105.
2014-02-17 10:33:34 -08:00
Paul O’Shannessy 9125f68194 0.9.0-rc1 2014-02-16 17:38:52 -08:00
Ben Alpert 1167aeb453 Expose cloneWithProps on addons
closes #1066
2014-02-16 14:08:05 -08:00
Paul O’Shannessy 6780b47526 Add CSSTransitionGroup to addons
Stealing part of #1059.
2014-02-16 14:04:29 -08:00
Ben Newman 47ae865428 Make ReactWebWorker-test.js less flaky.
Two improvements: make sure we set `done = true` when an error message is
received, so that the test output contains the error message instead of
eventually timing out and displaying nothing useful; and increase the
timeout for this particular test from 5000ms (the default) to 20000ms.
2014-02-16 12:57:14 -05:00
Jason Bonta 9ba014fbf1 Merge pull request #1081 from spicyj/textcontent
Avoid innerText for better newline behavior
2014-02-15 02:22:54 -06:00
Cheng Lou 123ed1f442 Fix IE8 bug during unitless CSS props creation
IE8 goes into an infinite loop if we add props to the obj we're iterating through.
2014-02-14 12:41:44 -08:00
Ben Alpert b98f1adf1a Avoid innerText for better newline behavior
Fixes #1080.
2014-02-13 21:31:32 -08:00
Jason Bonta 47645854f9 un-revert textContent, support multi-line strings in modern browsers
reverts 23ab30ff87 because the issue it fixed doesn't seem to be a problem
anymore. textContent should be better for more things anyway, as the
original 309a88bcf6 indicates. It should be faster because innerText
requires layout.

This also allows us to use strings with newlines in our rendered output
and have confidence that they will render the same on subsequent
re-renders. This is especially useful for es6-style backtick multi-line
strings. This will be more consistent as textContent is supported almost
everwhere so we won't have differing behavior between webkit and
firefox.

see https://github.com/facebook/react/issues/1080
2014-02-13 18:21:35 -08:00
Cheng Lou 5c953a7bdd Remove aural CSS numerial styles from CSSProperties
Those styles are not implemented in known browsers.
2014-02-13 18:21:03 -08:00
Pete Hunt 6573a726ba Merge pull request #1075 from spicyj/defperf
Measure root component render in ReactDefaultPerf
2014-02-13 10:49:19 -08:00
Pete Hunt a5c518f69a Merge pull request #855 from syranide/onerror
Add onError to ReactDOMImg to complement onLoad
2014-02-13 10:48:57 -08:00
Pete Hunt f02c3c07d3 Merge pull request #1067 from spicyj/sandbox-seamless
Add seamless and sandbox properties for iframe
2014-02-13 10:48:37 -08:00
Pete Hunt b04df6335a Merge pull request #1069 from spicyj/gh-1028
Assert that event listeners are real functions
2014-02-13 10:48:20 -08:00
Andreas Svensson cda1d8c779 Add onError to ReactDOMImg to complement onLoad 2014-02-13 10:43:03 +01:00
Ben Alpert cd87848b7d Don't warn about onChange for button inputs 2014-02-13 01:16:37 -08:00
Ben Alpert 55be7a71c5 Measure root component render in ReactDefaultPerf
Fixes #1074.
2014-02-13 00:59:02 -08:00
Ben Alpert b0757c5182 Assert that event listeners are real functions
Fixes #1028.
2014-02-12 23:21:46 -08:00
Ben Alpert d0502cf3c1 Add seamless and sandbox properties for iframe
Fixes #1057.
2014-02-12 21:06:43 -08:00
Jason Bonta 5abcce5343 add lineClamp, vendor prefixes to CSSProperty.isUnitlessNumber 2014-02-12 16:35:09 -08:00
Pete Hunt 439bca78ed [perf] New ReactDefaultPerf
Simplified version of https://github.com/facebook/react/pull/962. More goodies coming soon since the inclusive time isn't very helpful right now.
2014-02-12 12:30:02 -08:00
Pete Hunt a6749a686f [perf] Change how ReactDefaultPerf is injected
ReactDefaultPerf should inject itself when require()'d. This continues to support the ?react_perf use case for logging on initial page load.
2014-02-12 12:29:00 -08:00