Commit Graph
15395 Commits
Author SHA1 Message Date
CommitSyncScript 54d3134da2 Add ReactProps.func
This adds ReactProps.func so people don't need to write the
slightly-more-cryptic ReactProps.instanceOf(Function). We should have
had this all along.
2013-06-06 14:29:44 -07:00
CommitSyncScript 259392035d mapChildren
mapChilden() is similar to Array.map() and objMap() but handles deep
nested structures and follows similar rules to flattenChildren()
2013-06-06 14:29:44 -07:00
CommitSyncScript 4b81de93d3 use key="foo" for all components
flattenChildren was only using key when child.mountInContainerNode
exists, which is defined on ReactCompositeComponent, and not
ReactNativeComponent.

This uses the isValidComponent() fn to see if we should use this key.
2013-06-06 14:29:44 -07:00
CommitSyncScript 93fc188afb style prop improvements
Some improvements to how style={{x:y}} is handled in React:
* ignores null styles, rather than setting them.

Codez:

    var highlighted = false;
    <div style={{color: highlighted ? 'red' : null}} />

Before:

    <div style="color:;"></div>

After:

    <div></div>

Respects that 0 has no units.
2013-06-06 14:29:44 -07:00
CommitSyncScript 007b75f78a Flatten Children A Single Level
This expects static children as additional arguments to the constructor
and flattens any array arguments one level deep.

Component(props, child1, child2, arrayOfChildren, child3) ->
.props.children = [child1, child2, ...arrayOfChildren, child3]

This can avoid an additional heap allocation for the unflat array.

It allows you to pass nested arrays and objects like you used to. Those
aren't immediately flattened. That makes this a fairly safe change.

Passing a dynamic array without key properties will yield a warning
(once). Might consider throwing later.

Once we change the transpiler to use the new syntax, you'll end up with
a single flat array in normal usage.

This doesn't actually update the JSX transform.
2013-06-06 14:29:43 -07:00
Vjeux 0435216eb6 Using markdown instead of html 2013-06-06 08:40:24 +02:00
Vjeux 7061d2b25b Integrate twitter in the support page 2013-06-06 08:38:09 +02:00
Paul O’Shannessy 31cdb4c8a7 Merge pull request #58 from spicyj/unmount-nothrow
Make unmountAndReleaseReactRootNode not throw
2013-06-05 15:00:00 -07:00
Paul O’Shannessy 1e76d84569 Merge pull request #32 from spicyj/input
Add new onInput event
2013-06-05 14:57:25 -07:00
petehunt 3204135a46 Update 2013-06-05-why-react.md 2013-06-05 12:51:17 -06:00
Paul O’Shannessy a64faf7bf7 Fix broken link in Why React post 2013-06-05 10:02:11 -07:00
petehunt 4a79a718a3 Rename and fix typo 2013-06-05 08:46:51 -07:00
petehunt e293f998a1 Update 2013-06-04-why-react.md 2013-06-04 18:03:32 -06:00
Paul O’Shannessy dbfaa81ee0 Update links in readme to 0.3.2 2013-06-04 16:58:01 -06:00
Ben Alpert 6012e94e50 Make unmountAndReleaseReactRootNode not throw
When there isn't any React node in the DOM, unmountAndReleaseReactRootNode
threw an exception because component was undefined. Instead, return whether we
were able to unmount the component.
2013-06-04 14:36:16 -07:00
petehunt 0f67f7a782 Merge pull request #56 from petehunt/blogpost
Bring in the last few edits
2013-06-04 13:55:01 -07:00
petehunt 4201ddaf4e Bring in the last few edits 2013-06-04 13:09:20 -07:00
petehunt 14f1f8f53a edits from the committee 2013-06-04 14:00:18 -06:00
petehunt 61b5bd81d8 update date 2013-06-04 01:54:15 -07:00
Ben Alpert 35306fa7f5 Revert "Simulate input event" for now
This reverts commit 580e8f0dbb.
2013-06-04 01:29:12 -07:00
petehunt b441dcd6f0 Merge pull request #55 from spicyj/docs-fix-2
"nuts and bolts" isn't hyphenated
2013-06-04 00:57:09 -07:00
Ben Alpert 17d368910f "nuts and bolts" isn't hyphenated 2013-06-04 00:54:49 -07:00
petehunt 321e7e1175 Merge pull request #53 from yungsters/master
Revise "Why React" content.
2013-06-03 21:12:50 -07:00
yungsters bef3dd6760 Another pass over "Why React". 2013-06-03 15:54:26 -07:00
yungsters 3ded55f9f7 Revise "Why React" content. 2013-06-03 15:00:08 -07:00
Paul O’Shannessy 962cebf7c5 Merge pull request #43 from vjeux/jsfiddle
Add JSFiddle to the getting started section
2013-06-03 14:26:31 -07:00
Paul O’Shannessy 4081678f2e Merge pull request #49 from paulshen/jekyllrss
[docs] Add RSS feed.xml for blog posts
2013-06-03 14:12:54 -07:00
petehunt b202569c83 Merge pull request #52 from zpao/blog-tweaks
Improve blog setup
2013-06-03 13:59:29 -07:00
Paul O’Shannessy 55a8339781 Improve blog setup
* All posts under blog/
* Index @ blog/index.html
* Only show excerpt on index with "continue reading" link
* Date, name formatting improvements (better for humans)

It could probably still use some style tweaks but I feel better about
it.

Moving forward, we'll use the "excerpt" feature of Jekyll with the
default separator, which is just 2 newlines. So the first paragraph will
be special. Alternatively you can specify excerpt, but we'll want to fix
the layout so that gets added in.
2013-06-03 13:51:44 -07:00
petehunt a6707f158b Merge pull request #41 from divad12/homepage-examples-autobind
Consistently use autoBind on homepage examples
2013-06-03 12:53:26 -07:00
petehunt 96a5fe9e15 Merge pull request #51 from dschafer/patch-1
Highlight additional change in tutorial12.js
2013-06-03 12:51:12 -07:00
dschafer 24f523a351 Highlight additional change in tutorial12.js
tutorial12.js switches from using this.props to this.state. Let's highlight the change on line 10 as well to make that clear.
2013-06-03 13:48:14 -06:00
petehunt 065f8abfe3 Merge pull request #48 from petehunt/add-blog
Add "Why React"
2013-06-03 12:46:48 -07:00
petehunt 7b5602d00a @jeffreylin 2013-06-03 12:09:14 -07:00
Paul Shen 2bb7e15773 [docs] RSS: Pass title through xml_escape 2013-06-03 11:36:04 -07:00
Paul Shen cb9cc5de5c [docs] Use date_to_xmlschema in feed.xml 2013-06-03 11:34:42 -07:00
petehunt 0244123a52 Break lines 2013-06-03 11:19:51 -07:00
petehunt 1897bb3d2e @vjeux @benjamn 2013-06-03 11:16:38 -07:00
Paul Shen b353e8a807 [docs] Add RSS feed.xml for blog posts
uses `feed.xml` from https://github.com/snaptortoise/jekyll-rss-feeds
(slightly modified for `site.url` + `site.baseurl`)
2013-06-03 11:02:14 -07:00
petehunt b3e2aca13a Add why-react 2013-06-03 11:01:08 -07:00
Ben Newman e829f8f71f Merge pull request #1 from benjamn/run-tests-in-iframes
Run each test in its own <iframe>
2013-06-03 10:58:01 -07:00
Paul Shen 9425e58591 Merge pull request #42 from vjeux/blog
Blog article for JSFiddle Integration
2013-06-03 10:44:23 -07:00
Ben Newman 603c9ef6a8 Implement constructor-aware binding per @zpao's request.
When the function to be bound does not have a prototype, ignore the constructor case.
2013-06-03 13:20:13 -04:00
Ben Newman 906b8f3f95 Create testing <iframe>s dynamically, according to grunt config. 2013-06-03 13:20:13 -04:00
Ben Newman 6cfa71a3c2 Run each test in an <iframe>. 2013-06-03 13:20:13 -04:00
Ben Newman 42f8d155f8 Silence tests unsupported in PhantomJS.
These tests can still be run in the browser using `grunt test --debug`.
2013-06-03 13:20:13 -04:00
Ben Newman 009c0b9200 Expose test modules for requirement. 2013-06-03 13:20:13 -04:00
Ben Newman c740373b31 Fix some silly uses of Function.prototype.bind in jasmine-support.js. 2013-06-03 13:20:13 -04:00
Ben Newman 03f92bb155 Polyfill Function.prototype.bind during tests. 2013-06-03 13:20:13 -04:00
Ben Newman f8af93237a Use bin/jsx and browserify to build a jasmine bundle. 2013-06-03 13:20:13 -04:00