Commit Graph

384 Commits

Author SHA1 Message Date
Pete Hunt 5676a486cf Allow nested ReactUpdates 2013-07-08 11:49:42 -07:00
Pete Hunt 1658feade8 Remove the check for console.warn
We already polyfill this at FB and we should recommend https://github.com/paulmillr/console-polyfill for open source.
2013-07-08 11:49:28 -07:00
Pete Hunt 5f1eceb1ee Merge pull request #176 from andreypopp/master
Add datetime to the list of known DOM attributes
2013-07-08 00:44:33 -07:00
Andrey Popp fc3491e0d0 dateTime attr: camelCase and MUST_USE_ATTRIBUTE 2013-07-08 11:23:43 +04:00
Andrey Popp 9f94244994 add datetime to the list of known attributes
as per http://www.whatwg.org/specs/web-apps/current-work/multipage/text-level-semantics.html#attr-time-datetime
2013-07-08 00:09:38 +04:00
Pete Hunt 6ebdd0cfd2 Merge pull request #173 from chenglou/patch-4
Emphasis on single child.
2013-07-06 23:20:20 -07:00
Cheng Lou 858377946f Emphasis on single child. 2013-07-06 16:10:34 -04:00
Ben Newman 826d603b05 Merge pull request #167 from benjamn/issue-166-fix-phantomjs-executability
Ensure that the phantomjs binary has appropriate UNIX mode
2013-07-05 16:18:05 -07:00
Ben Newman da4b761c45 Don't require tmp module unless we're going to use it. 2013-07-05 19:17:20 -04:00
Ben Newman 70a2f8046c Ensure that the phantomjs binary has appropriate UNIX mode.
The 755 mode corresponds to a UNIX mode string of -rwxr-xr-x.

Closes #166.
2013-07-05 19:06:49 -04:00
Christopher Chedeau 51bf95f6d1 Merge pull request #157 from vjeux/communit_4
Community Round-up #4
2013-07-03 18:32:36 -07:00
Vjeux 2246f530af Community Round-up #4 2013-07-04 03:25:35 +02:00
Paul O’Shannessy 4e04ef0769 Merge pull request #153 from lrowe/patch-2
Add `hidden` attribute to DOM properties.
2013-07-03 15:48:19 -07:00
Laurence Rowe b2bbdf8cbf Add hidden attribute to DOM properties. 2013-07-03 14:05:44 -07:00
petehunt 9178208ba8 update docs 2013-07-03 13:09:10 -07:00
Pete Hunt 7d3db0e5ed Add finally block for clearing ReactUpdates state
If any component throws during reconciliation any subsequent reconciliation will break badly because ReactUpdates will be in an inconsistent state.
Add a finally block to prevent this.
2013-07-03 11:38:50 -07:00
Tim Yung 2869e5b4df Inject ReactDOMInput
Changes `<input>` in React to use `ReactDOMInput` which supports `value` and `defaultValue` instead of the current, arguably broken `value` behavior.
2013-07-03 11:38:45 -07:00
Tim Yung 510146eb6d Faster Listener Deletion
Whenever a component is unmounted, we delete all listeners that might have been attached. This sucks because most applications, Facebook included, do not use every listener. There's a lot of wasted computation, especially if many components are mounted and unmounted.

This changes `deleteAllListeners` to more delete listeners more efficiently.
2013-07-03 11:38:34 -07:00
Tim Yung c692d9e844 Fix ChangeEventPlugin for IE8 and IE9
This fixes a bug with `ChangeEventPlugin` in IE8 and IE9. The extend of this bug includes:

 - On IE8, not firing `onChange` immediately after `value` of an input is changed.
 - On IE9, not firing `onChange` when backspacing.
2013-07-03 11:38:31 -07:00
Pete Hunt 32423a83fc Injectable DOMProperty configs, and add back ID attribute
https://github.com/facebook/react/pull/141
2013-07-02 18:30:04 -07:00
Sebastian Markbage d50148591b Introduce a supported way to slice children
Introduces a counterpart to mapChildren. It excludes empty children just as
mapChildren for compatibility. With might introduce something like
sliceChildrenIncludingEmptyValues at some point.
2013-07-02 18:30:04 -07:00
Pete Hunt b6451be582 Update syntax.md
Some inconsistencies pointed out in FB comments
2013-07-02 18:27:15 -07:00
Paul O’Shannessy 5e296d7af8 Merge pull request #150 from benjamn/commoner-dir-watcher
Upgrade Commoner to --watch directories instead of individual files
2013-07-02 17:21:39 -07:00
Pete Hunt 3093a476b1 Merge pull request #115 from spicyj/async-state
Batch together calls to setState, setProps, etc
2013-07-02 17:16:07 -07:00
Paul O’Shannessy 00e56c5155 Merge pull request #151 from spicyj/bq
Add blockquote tag (already in JSX)
2013-07-02 17:14:34 -07:00
Pete Hunt 8b9891aa8a Remove autobinding warning
I think this warns on many legitimate use cases. We should get rid of it I think.
2013-07-02 16:53:39 -07:00
Ben Alpert f7901a2380 Add blockquote tag (already in JSX) 2013-07-02 16:19:41 -07:00
Ben Newman 5c4352b57b Upgrade Commoner to --watch directories instead of individual files.
This behavior is new in Commoner v0.8.3, following the incorporation of
@jeffreylin's `DirWatcher` implementation:
https://github.com/jeffreylin/jsx_transformer_fun/blob/master/dirWatcher.js

Watching directories instead of files reduces the total number of open
files, and copes better with editors that save files by deleting and then
immediately recreating them.

Closes #60.
Closes #71.
2013-07-02 17:47:52 -04:00
Paul O’Shannessy 9ca7c9631a Blog: Autobind by Default
Kicking off the series of posts previewing v0.4
2013-07-02 13:04:14 -07:00
Ben Alpert d9e99d4688 Batch together calls to setState, setProps, etc
The end of ReactUpdates-test.js is probably most illuminating for seeing how this works.
2013-07-02 00:04:50 -07:00
Pete Hunt 3fd56b4038 Merge pull request #147 from lrowe/patch-1
Add figure and figcaption elements to React.DOM (already supported by jsx)
2013-07-01 17:51:42 -07:00
Laurence Rowe 44659df598 Add figure and figcaption elements to React.DOM (already supported by jsx.) 2013-07-01 17:03:54 -07:00
Ben Alpert 0e9ee239a9 Merge branch 'master' into async-state 2013-07-01 16:08:57 -07:00
Paul O’Shannessy ce0704a491 Merge pull request #145 from benjamn/no-jsx-dependency-scanning-by-default
Bump Commoner version to disable dependency scanning by default
2013-07-01 13:57:12 -07:00
Paul O’Shannessy 0acc1d8c78 Merge pull request #144 from benjamn/fix-EMFILE-jsx-errors
Bump Commoner version to fix EMFILE errors
2013-07-01 13:54:09 -07:00
Ben Newman 18ef8962f1 Bump Commoner version to disable dependency scanning by default.
If you are using bin/jsx independently, you may need to pass
--follow-requires to it if you rely on its dependency scanning.

Dependency scanning is still a good idea, but it's difficult to make it
work perfectly for everyone the first time they try bin/jsx.

Closes #131.
2013-07-01 16:50:35 -04:00
Ben Newman e748be32da Bump Commoner version to fix EMFILE errors.
Finally found a more robust solution for the "too many open files"
problem: https://github.com/benjamn/commoner/commit/ad72ba42db.

Closes #137.
Closes #138.
2013-07-01 16:31:56 -04:00
Paul O’Shannessy 0ad14fc038 Merge pull request #143 from spicyj/ie8-fixes-2
Use proper names for scroll metric properties
2013-07-01 13:12:14 -07:00
CommitSyncScript dd61439061 Revert Flattening of Children
I still think the semantics of flattening children is valid but we'll
want to revert the flattening implementation while we solidify the
semantics and try another approach.

This reverts flattening so that this.props.children can once again be
either a single child, flat array or nested array.

mapChildren calls flattenChildren before doing anything else. This is
not the most efficient approach but I wanted to keep this inital diff
simple. It also ignores empty values for backwards compatibility.

We may want to try another approach where empty values are included
in the map.

Validation of keys is still done inside ReactComponent. Ideally I'd
like to extract that into a separate module but to avoid cyclic
dependencies, I'm keeping it in ReactComponent for now.
2013-07-01 13:01:52 -07:00
CommitSyncScript 40bebf0c86 Fix ReactDOMInput and ReactDOMTextarea Race Condition
This fixes a race condition if the `onClick` tries to update the input or textarea (e.g. by calling `setState`):

  <input
    onClick={function(event) {
      this.setState({somethingElse: true}); // Triggers an update.
      // event.target.value is now equal to the old value, fail...
      this.props.onChange(event);
    })
  />
2013-07-01 13:00:41 -07:00
Ben Alpert 2aa5631e2e Use proper names for scroll metric properties 2013-07-01 11:54:13 -07:00
Paul O’Shannessy f39a0f8e40 Merge branch 'no-content' of git://github.com/spicyj/react into spicyj-no-content
Conflicts:
	src/core/ReactNativeComponent.js
2013-06-28 16:42:59 -07:00
CommitSyncScript ca19ffb083 use .apply instead of .call in ReactCompositeComponent
This was a bit ridiculous.. let's just use arguments as it's supposed to
be used.
2013-06-28 16:36:54 -07:00
CommitSyncScript 15272f30f4 Don't keep the HTML escaped ID internally, only in HTML generation
A dynamic value can be provided as a key to a child. Either as part of an object
or key property. This becomes part of the component's ID.

We have to be careful to escape this key before inserting it into the DOM since
it could become a vulnerability. We fixed this by escaping just the keys.

However, the current implementation breaks when you used escaped keys. The
internal value is escaped and the value used by getAttributeNode and
getElementById are both unescaped.

This fixes that by keeping the unescaped value internally but escaping it right
before the HTML is generated (like any other attribute).

This is important since business logic IDs (that should be used as keys)
contains characters that need to be escaped.
2013-06-28 16:35:45 -07:00
CommitSyncScript 55176116a2 Implement ReactDOMTextarea
This changes `ReactDOMTextarea` to accept `defaultValue` and `value`. It will warn people about using children (but allow it and treat it as `defaultValue`, which is the current behavior).
2013-06-28 16:35:04 -07:00
CommitSyncScript 738de8cfa8 Improve findComponentRoot Error Message
Instead of simply logging the React ID of the `ancestorNode` when `findComponentRoot` fails, use a `try ... finally` to `console.error` the `ancestorNode`. This allows modern web inspectors to actually log a reference to the node (which may not have a React ID).

This means when people run into the problem, they will not have to execute:

  require('ReactID').getNode(<copy+paste>);

NOTE: Admittedly, this will not log anything in IE8. That's fine, since IE8 has shitty console logging anyway.
2013-06-28 16:34:27 -07:00
Paul O’Shannessy bd150ec658 Clean up unused variables for lint 2013-06-28 16:34:19 -07:00
Paul O’Shannessy ee21a604f3 Delete files that accidentally got merged in
ಠ_ಠ
2013-06-28 14:54:07 -07:00
yungsters 43358157cf Merge branch 'textarea-update-value' of git://github.com/spicyj/react
Conflicts:
	src/core/ReactDefaultInjection.js
2013-06-28 14:30:47 -07:00
Paul O’Shannessy 0b65d7555e Merge pull request #136 from jeffmo/empty_expressions
Add support for empty XJS expressions
2013-06-28 14:16:23 -07:00