Commit Graph

808 Commits

Author SHA1 Message Date
Paul O’Shannessy 087c2afed1 Make sure DOM components work in JSDOM 2013-10-15 11:38:26 -07:00
Paul O’Shannessy b0645bd5d3 Be consistent with object naming in tests
This also fixes line length issues our linter was complaining about.
2013-10-15 11:38:26 -07:00
SanderSpies 5a13dd090d Standardize prop -> DOM attribute process
Allow more than strings and numbers to be used as attributes for DOM
nodes. This removes the special casing for `0` and `false` that was
being used in ReactDOMInput and ReactDOMTextarea.

Now we will just `toString` any object we try to insert into a DOM.

Closes #422, #372, #302
2013-10-15 11:38:25 -07:00
Paul O'Shannessy b0455f4670 Ensure attribute values are strings
`jsdom` behavers differently than browsers here and we should ensure
that we are consistent. Browsers should be (and are) converting to
a string first, while `jsdom` doesn't.
2013-10-15 10:39:51 -07:00
Tim Yung 287f5b578c Add bitwise lint escape to DefaultDOMPropertyConfig 2013-10-15 10:38:31 -07:00
Martin Konicek 5332422239 [docs] Fix a broken link to JSX syntax in README. 2013-10-14 17:10:26 -07:00
Ben Alpert 7909c3e71b Forcibly wrap SVG nodes with <svg> on creation
Forcing wrapping seems necessary here: I compared a <circle> created within a <div> with a <circle> created inside an <svg> and they appear to have exactly the same properties with the exception of .parentNode (and .parentElement), yet the former refuses to show up when appended to an <svg> element. As such, I can't find any useful way to write a unit test (testing getMarkupWrap's output doesn't seem particularly useful to me).

Fixes #311.

Test Plan:
With a component that adds a <circle> after mounting (such as http://jsfiddle.net/spicyj/hxFVe/), verify that the circle appears in both Chrome and IE9.
2013-10-14 13:44:36 -07:00
Paul O’Shannessy b45c82c256 Merge pull request #419 from piranha/svg-attrs
svg properties -> attributes

Fixes #190
2013-10-14 11:24:36 -07:00
Alexander Solovyov 3a5a82fd18 DefaultDOMPropertyConfig: sort properties alphabetically 2013-10-14 20:45:00 +03:00
Josh Duck 1238f5f23a Remove DOM mutation listeners
Mutation listeners are known to be slow. Rough benchmarks show text
changes are now 50% faster.
2013-10-11 17:33:47 -07:00
Owen Coutts ac9f5e9da4 Better click behavior for ff
Firefox created onClick events for right mouse clicks. This diff brings behavior on firefox inline with other browsers.
2013-10-11 15:42:22 -07:00
Josh Duck 58c392ae3b Check for null selection
getRangeAt(0) will throw on null selection. Add guard in
ReactDOMSelection and DocumentSelection.
2013-10-11 12:52:19 -07:00
Alexander Solovyov aa38ffc22d svg attributes properly cased when assigned by react 2013-10-11 15:48:17 +03:00
Alexander Solovyov 6d300527c8 svg: rx/ry for rounded corners 2013-10-11 13:42:10 +03:00
Alexander Solovyov a601c5cc81 svg properties -> attributes 2013-10-11 13:32:22 +03:00
Alexander Solovyov 4549fd7510 fix namesToPlugins for gcc advanced mode 2013-10-09 22:08:03 +03:00
Keito Uchiyama ef60eee57a Make transferPropsTo() message easier to debug
Summary:
Made the transferPropsTo() error introduced in
325322898c easier to use to debug.
2013-10-09 11:28:35 -07:00
Sebastian Markbage 7a9c13dee8 Set _renderedComponent before it's fully mounted
For debugging so that we can inspect the currently rendering tree. I think this
should be safe and makes sense since it tried to mount.
2013-10-09 11:28:22 -07:00
Tim Yung d652dd928a Add displayName for DOM Components 2013-10-09 11:28:12 -07:00
Jan Kassens c99d6a8013 Make the injection of ReactPerf work
The injection was only evaluated when ReactCompositeComponent was first loaded.
This made it impossible to inject a custom measure and the injection pointless.
2013-10-09 11:27:40 -07:00
Ben Newman f8c5752472 Merge pull request #374 from spicyj/workers
Test that React loads properly in a web worker.

Most of this code is open source-only, so I think it's safe to merge without figuring out how to translate it upstream first.
2013-10-09 08:50:41 -07:00
Paul O’Shannessy 44352a2861 Merge pull request #370 from zpao/addons
react-with-addons build
2013-10-08 16:54:31 -07:00
Paul O’Shannessy 7da874d835 Add TransitionGroup example 2013-10-08 16:49:11 -07:00
Paul O’Shannessy de9e94de5f Make sure react-with-addons ends up in react-source gem 2013-10-08 16:49:11 -07:00
Paul O’Shannessy a151133161 Make sure react-with-addons ends up in bower 2013-10-08 16:49:11 -07:00
Paul O’Shannessy 042a2723ff Make sure addons builds are sent to build server 2013-10-08 16:49:11 -07:00
Paul O’Shannessy 2e6092b217 react-with-addons build
This creates a new standalone build which should have everything the
default build has, plus a little extra. This is not a sustainable long
term solution (we shouldn't make people choose like this) but it fixes
the problem we have in the short term.

This also removes the terrible react-transitions build. This is better
anway.

Fixes #369
2013-10-08 16:49:11 -07:00
Ben Alpert f658c32df1 Tweak verbiage about required polyfills
I found it weird how the es5-shim comment came after the list of functions; now it's before.
2013-10-08 16:25:29 -07:00
Paul O’Shannessy b16874c5a8 Merge pull request #407 from Samangan/master
renamed ReactOnDOMReady module to ReactMountReady
2013-10-08 15:12:29 -07:00
Connor McSheffrey b9a657db2c fixed broken link on Community Round-up #9 blog post
closes #409
2013-10-08 11:09:33 -07:00
Josh Duck dbc613199b Fix SelectEventPlugin
There were 2 issues:

I was reusing event outside the original event handler (activeNativeEvent).
This is a bad idea. I've changed deferred dispatch to have an empty object
as the nativeEvent.

I didn't handle inputs without .selectionStart (e.g. file inputs). I extracted
a input type check from ChangeEventPlugin and reuse it here.
2013-10-08 10:28:43 -07:00
Paul O’Shannessy 920c4206f4 Sync getActiveElement module from FB. 2013-10-07 15:32:47 -07:00
Paul O’Shannessy fdb10c0679 React.__internals
We need access to internal modules in order to provide a single way for some
projects to work internally with @providesModule and externally.
2013-10-07 15:07:20 -07:00
Pete Hunt 325322898c Throw when calling transferPropsTo() on a component you don't own
This is dangerous because it means that data is flowing into the component from two components, only one of which is the actual "owner". While we may be able to figure out how to
support this someday, let's be strict and prevent it for now.
2013-10-07 15:07:04 -07:00
Sebastian Markbage 27669c09ca Move flattenChildren into MultiChild 2013-10-07 15:06:44 -07:00
Tim Yung 0c59c57d66 Speed Key Validation (by over 9000)
Use a valid identifier (and non-string) to reduce chance of de-optimizing in V8 and Nitro.
2013-10-07 15:05:56 -07:00
Christopher Chedeau 26d7c4275a Add warning when using componentShouldUpdate 2013-10-07 15:05:44 -07:00
Josh Duck 2b7a7599bb Add select event plugin
Polyfill 'onSelect' behavior for React.

Use non-standard 'selectionchange' event rather than 'select' event.
This allows us to fire the event when user moves the cursor via arrow
keys, and not just when they select multiple chars.

Add methods to ReactDOMSelection to make getting current selection
easier, so we can do a fast check for change without having to
calculate char offsets for selection start and end.
2013-10-07 15:02:57 -07:00
Sebastian Markbage ed9c0ca87c Expose bound function, context and arguments
Exposes the bound context, original method and bound arguments for any
auto-bound methods, for debugging purposes.
2013-10-07 15:02:47 -07:00
Sebastian Markbage 68abbacc39 Expose the rendered children before they're actually mounted
Exposing the _renderedChildren property before all the children are fully
mounted. This allows us to debug a partially mounted tree when the debugger
has a breakpoint in the one of the mounting children.

This only has a functional difference in the case where mounting throws. This
will end up not mounting the component anyway. Any remounting shouldn't be
affected by this change.
2013-10-07 15:02:27 -07:00
Samangan 84d8e1841a renamed ReactOnDOMReady module to ReactMountReady
fix

renamed ReactOnDOMReady module to ReactMountReady
2013-10-05 01:35:56 -05:00
Vjeux a9b3139ff8 Community round-up #9
http://fooo.fr:4000/react/blog/2013/10/03/community-roundup-9.html
2013-10-03 15:18:21 -07:00
Vjeux 582b720183 Add app id for comments moderation
This way we can be notified when any new comment appear in the docs/blog and add moderators
2013-10-03 22:32:20 +02:00
Ben Newman 0a02b55d95 Use nodeContains where appropriate. 2013-10-01 17:55:13 -07:00
Tim Yung 20af6a7ce8 Speed Owner Access (by over 9000)
Use a valid identifier (and non-string) to reduce chance of de-optimizing in V8 and Nitro.
2013-10-01 16:32:06 -07:00
Ben Newman 7c0f5c3237 Fix isEventSupported in recent versions of jsdom.
Setting the `eventName` attribute of an element to the empty string is not
enough to cause `typeof element[eventName] === 'function'` in jsdom. The
attribute value actually has to look like a function body.
2013-10-01 16:31:46 -07:00
Paul O'Shannessy f43449d333 ReactNativeComponent -> ReactDOMComponent
In an effort to break the DOMy parts of React away from the non-DOMy parts, I'm renaming this.
2013-10-01 16:31:32 -07:00
Ben Newman e66287f92e Copy the nodeContains module from static_upstream. 2013-10-01 19:18:09 -04:00
Paul O’Shannessy f20626f17a Merge pull request #378 from spicyj/html-reconciliation
Fix reconciling when switching to/from innerHTML
2013-10-01 13:38:08 -07:00
Andrew Zich ab00f8d15c Removed "ajaxify" from DefaultDOMPropertyConfig
The `"ajaxify"` attribute is Facebook-specific and does not belong in this repo.
2013-10-01 13:34:26 -07:00