Compare commits
134 Commits
0.13-stabl
...
0.12-stabl
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0fc0871c89 | ||
|
|
40336d8144 | ||
|
|
758436e0eb | ||
|
|
b7867b1363 | ||
|
|
67005be6e0 | ||
|
|
2183b55939 | ||
|
|
8b94509d75 | ||
|
|
dfc4016425 | ||
|
|
1d7ea352bf | ||
|
|
4d90b9bdf3 | ||
|
|
5174b31d3d | ||
|
|
58e38a2e8c | ||
|
|
4e3fe5c13f | ||
|
|
3f79ad1e4a | ||
|
|
de8b3eb9d4 | ||
|
|
276df014a1 | ||
|
|
36719c561e | ||
|
|
043ac1a5b3 | ||
|
|
ea71d21159 | ||
|
|
8f8e9713b1 | ||
|
|
f005189a8b | ||
|
|
788c118fcd | ||
|
|
5f72c6640e | ||
|
|
bf3d1ee84d | ||
|
|
4e11282ddc | ||
|
|
233980826c | ||
|
|
c5516cd27f | ||
|
|
69cc1ce6a3 | ||
|
|
e29766a811 | ||
|
|
20d84472e8 | ||
|
|
6969d3d325 | ||
|
|
bfc655f2c4 | ||
|
|
f7b0647f64 | ||
|
|
3f367e2688 | ||
|
|
2958c0fe62 | ||
|
|
13016af6cd | ||
|
|
962c31d8b1 | ||
|
|
55e8a3139a | ||
|
|
2c06df31c8 | ||
|
|
7254f167be | ||
|
|
33375f5805 | ||
|
|
80e4bc4dd5 | ||
|
|
c5bce48542 | ||
|
|
5b16016e0a | ||
|
|
ea4dd2068d | ||
|
|
48064fce51 | ||
|
|
f9d32be8b2 | ||
|
|
48443c26b9 | ||
|
|
1a22b72d1f | ||
|
|
76d6ed9b78 | ||
|
|
d0b20dd364 | ||
|
|
0384af0e73 | ||
|
|
8fa006c892 | ||
|
|
c31270108c | ||
|
|
b8adf96d4b | ||
|
|
9a7cfb95dc | ||
|
|
371548b90c | ||
|
|
3ffbb22ccb | ||
|
|
17d947a671 | ||
|
|
bb212f5a60 | ||
|
|
b4b4aab162 | ||
|
|
3ab3fabf5e | ||
|
|
b75c2aecfb | ||
|
|
35929909ae | ||
|
|
69a7e3969b | ||
|
|
6500fd26c5 | ||
|
|
132a022936 | ||
|
|
2e2bcbd861 | ||
|
|
9d2ab67164 | ||
|
|
e350d12e1c | ||
|
|
f9f5823f9d | ||
|
|
1e1f02a83a | ||
|
|
6c5cb72cdc | ||
|
|
ea14845c15 | ||
|
|
2f6a95d5a2 | ||
|
|
7468f092ae | ||
|
|
e6e60c4fa8 | ||
|
|
6526f89235 | ||
|
|
bbe2e886ab | ||
|
|
359eb75723 | ||
|
|
fb0fafb436 | ||
|
|
3e6363116c | ||
|
|
d339631295 | ||
|
|
5f88996977 | ||
|
|
b02db228ca | ||
|
|
e9067f9ecd | ||
|
|
c7ff4447e0 | ||
|
|
d9094a1418 | ||
|
|
d6440d6179 | ||
|
|
3e17992257 | ||
|
|
b82a3c51c5 | ||
|
|
84e461f5e3 | ||
|
|
e9f344c030 | ||
|
|
250060981d | ||
|
|
308112dbd2 | ||
|
|
0bd6bdaa64 | ||
|
|
bfaddf42ae | ||
|
|
5dd855c898 | ||
|
|
a4d2e97400 | ||
|
|
b112a27aa0 | ||
|
|
8eef2fcd3d | ||
|
|
725c545589 | ||
|
|
d70a1a5a6f | ||
|
|
f25ab5ceaa | ||
|
|
b1d0c74726 | ||
|
|
0e0803401b | ||
|
|
af5d168460 | ||
|
|
0f9739a4f2 | ||
|
|
3efc8c8aa9 | ||
|
|
ae13325143 | ||
|
|
7dd33967b6 | ||
|
|
8dc8b0fd44 | ||
|
|
4fb45410b3 | ||
|
|
bc8baef372 | ||
|
|
a067fc0fee | ||
|
|
e9dde65341 | ||
|
|
6a739ccba6 | ||
|
|
2119a29770 | ||
|
|
8f3416e6fd | ||
|
|
11527d7fe4 | ||
|
|
d7e3fb36ad | ||
|
|
361b00e652 | ||
|
|
9f584d607a | ||
|
|
55a58460d9 | ||
|
|
ed1ca69183 | ||
|
|
a47c6d3717 | ||
|
|
b6af3c8586 | ||
|
|
cf0a22578d | ||
|
|
9ee824e5de | ||
|
|
a354e65974 | ||
|
|
0c1191d2bc | ||
|
|
434b4a275a | ||
|
|
d56bc2f219 | ||
|
|
3e925822a6 |
@@ -1,21 +0,0 @@
|
||||
# We can probably lint these later but not important at this point
|
||||
src/vendor
|
||||
# eslint uses JSX* node types to determine if using JSX. esprima-fb still uses
|
||||
# XJS* nodes. When we fix that (https://github.com/facebook/esprima/pull/85) we
|
||||
# can enable linting the tests and fix those errors.
|
||||
src/**/__tests__/**
|
||||
# This should be enabled but that folder has too much in it that doesn't belong
|
||||
src/test
|
||||
test/the-files-to-test.generated.js
|
||||
# This is synced with a different file internally, don't want to lint it yet
|
||||
vendor/fbtransform/syntax.js
|
||||
vendor/jasmine/
|
||||
vendor/jasmine-jsreporter/
|
||||
# But not in docs/_js/examples/*
|
||||
docs/_js/*.js
|
||||
docs/js/
|
||||
# gems
|
||||
docs/vendor/bundle/
|
||||
# This should be more like examples/**/thirdparty/** but
|
||||
# we should fix https://github.com/facebook/esprima/pull/85 first
|
||||
examples/
|
||||
51
.eslintrc
51
.eslintrc
@@ -1,51 +0,0 @@
|
||||
---
|
||||
parser: esprima-fb
|
||||
|
||||
env:
|
||||
browser: true
|
||||
node: true
|
||||
|
||||
globals:
|
||||
__DEV__: true
|
||||
|
||||
rules:
|
||||
# ERRORS
|
||||
space-before-blocks: 2
|
||||
indent: [2, 2, indentSwitchCase: true]
|
||||
brace-style: 2
|
||||
space-after-keywords: 2
|
||||
strict: 2
|
||||
# We actually have a transform to support this and we fix this for bundled
|
||||
# releases but not for the npm package, so enforce it strictly
|
||||
no-comma-dangle: 2
|
||||
# Make this a warning for now. We do this in a few places so we might need to
|
||||
# disable
|
||||
no-unused-expressions: 2
|
||||
block-scoped-var: 2
|
||||
eol-last: 2
|
||||
dot-notation: 2
|
||||
consistent-return: 2
|
||||
no-unused-vars: [2, args: none]
|
||||
quotes: [2, 'single']
|
||||
|
||||
# WARNINGS
|
||||
# This is the only one that's hard to track since we don't lint just changes.
|
||||
max-len: [1, 80]
|
||||
|
||||
# WISHLIST. One day...
|
||||
# We'll need a custom version of this that does a subset of the whole rule.
|
||||
# Otherwise this is just too noisy.
|
||||
# valid-jsdoc: 1
|
||||
|
||||
# DISABLED. These aren't compatible with our style
|
||||
# We use this for private/internal variables
|
||||
no-underscore-dangle: 0
|
||||
# We pass constructors around / access them from members
|
||||
new-cap: 0
|
||||
# We do this a lot.
|
||||
no-use-before-define: 0
|
||||
# We do this in a few places to align values
|
||||
key-spacing: 0
|
||||
|
||||
# DISABLED. These currently cause errors when running.
|
||||
no-multi-spaces: 0
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -9,13 +9,11 @@ __benchmarks__
|
||||
build/
|
||||
.module-cache
|
||||
*.gem
|
||||
docs/.bundle
|
||||
docs/code
|
||||
docs/_site
|
||||
docs/.sass-cache
|
||||
docs/js/*
|
||||
docs/downloads
|
||||
docs/vendor/bundle
|
||||
examples/shared/*.js
|
||||
test/the-files-to-test.generated.js
|
||||
*.log*
|
||||
|
||||
21
.jshintrc
Normal file
21
.jshintrc
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"node": true,
|
||||
|
||||
"boss": true,
|
||||
"curly": true,
|
||||
"devel": true,
|
||||
"eqnull": true,
|
||||
"expr": true,
|
||||
"funcscope": true,
|
||||
"globalstrict": true,
|
||||
"loopfunc": true,
|
||||
"newcap": false,
|
||||
"noempty": true,
|
||||
"nonstandard": true,
|
||||
"onecase": true,
|
||||
"sub": true,
|
||||
"regexdash": true,
|
||||
"trailing": true,
|
||||
"undef": true,
|
||||
"unused": "vars"
|
||||
}
|
||||
22
.mailmap
22
.mailmap
@@ -1,13 +1,8 @@
|
||||
Alex Mykyta <dancingwithcows@gmail.com>
|
||||
Andreas Svensson <andreas@syranide.com>
|
||||
Andres Suarez <zertosh@gmail.com>
|
||||
Ben Alpert <ben@benalpert.com> <balpert@fb.com>
|
||||
Ben Alpert <ben@benalpert.com> <spicyjalapeno@gmail.com>
|
||||
Ben Newman <bn@cs.stanford.edu> <benjamn@fb.com>
|
||||
Bill Fisher <fisherwebdev@gmail.com>
|
||||
Brandon Tilley <brandon@brandontilley.com>
|
||||
Cheng Lou <chenglou92@gmail.com> <chenglou@fb.com>
|
||||
Christian Oliff <christianoliff@yahoo.com>
|
||||
Christoph Pojer <christoph.pojer@gmail.com>
|
||||
Christoph Pojer <christoph.pojer@gmail.com> <cpojer@fb.com>
|
||||
Connor McSheffrey <c@conr.me> <connor.mcsheffrey@gmail.com>
|
||||
@@ -19,12 +14,10 @@ Evan Coonrod <evan@paloalto.com>
|
||||
Fabio M. Costa <fabiomcosta@gmail.com> <fabs@fb.com>
|
||||
Felix Kling <felix.kling@gmx.net> <fkling@fb.com>
|
||||
François-Xavier Bois <fxbois@gmail.com>
|
||||
Gabe Levi <gabelevi@gmail.com> <glevi@fb.com>
|
||||
Geert Pasteels <geert.pasteels@gmail.com>
|
||||
George A Sisco III <george.sisco@gmail.com>
|
||||
Harry Hull <harry.hull1@gmail.com>
|
||||
Hendrik Swanepoel <hendrik.swanepoel@gmail.com>
|
||||
Ian Obermiller <ian@obermillers.com> <iano@fb.com>
|
||||
Ingvar Stepanyan <me@rreverser.com> <rreverser@ubuntu.rreverser.a4.internal.cloudapp.net>
|
||||
Irae Carvalho <irae@irae.pro.br>
|
||||
Ivan Vergiliev <ivan.vergiliev@gmail.com>
|
||||
@@ -36,25 +29,18 @@ Jason Bonta <jbonta@gmail.com> <jasonbonta@fb.com>
|
||||
Jason Trill <jason@jasontrill.com>
|
||||
Jeff Morrison <jeff@anafx.com> <Jeff@anafx.com>
|
||||
Jeff Morrison <jeff@anafx.com> <jeffmo@fb.com>
|
||||
Jeff Morrison <jeff@anafx.com> <lbljeffmo@gmail.com>
|
||||
Jeffrey Lin <lin.jeffrey@gmail.com> <jeffreylin@fb.com>
|
||||
Jim Sproch <jsproch@fb.com>
|
||||
Jim Sproch <jsproch@fb.com> <jsfb@github>
|
||||
Jon Madison <jon@tfftech.com>
|
||||
Jonathan Hsu <jhiswin@gmail.com>
|
||||
Jordan Walke <jordojw@gmail.com>
|
||||
Jordan Walke <jordojw@gmail.com> <jordanjcw@fb.com>
|
||||
Josh Duck <josh@fb.com> <github@joshduck.com>
|
||||
Juan Serrano <germ13@users.noreply.github.com>
|
||||
Jun Wu <quark@lihdd.net>
|
||||
Keito Uchiyama <projects@keito.me> <keito@fb.com>
|
||||
Kunal Mehta <k.mehta@berkeley.edu> <kunalm@fb.com>
|
||||
Laurence Rowe <l@lrowe.co.uk> <laurence@lrowe.co.uk>
|
||||
Martin Andert <mandert@gmail.com>
|
||||
Mathieu M-Gosselin <mathieumg@gmail.com> <mathieumg@atx33.com>
|
||||
Matt Zabriskie <mzabriskie@gmail.com>
|
||||
Michal Srb <xixixao@seznam.cz> xixixao <xixixao@seznam.cz>
|
||||
Minwe LUO <minwe@yunshipei.com>
|
||||
Nick Gavalas <njg57@cornell.edu>
|
||||
Nick Thompson <ncthom91@gmail.com> <nickt@instagram.com>
|
||||
Paul O’Shannessy <paul@oshannessy.com> <poshannessy@fb.com>
|
||||
@@ -66,24 +52,16 @@ Pete Hunt <floydophone@gmail.com> <phunt@instagram.com>
|
||||
Petri Lievonen <plievone@cc.hut.fi>
|
||||
Petri Lievonen <plievone@cc.hut.fi> <petri.lievonen@tkk.fi>
|
||||
Pieter Vanderwerff <me@pieter.io> <pieter@heyday.co.nz>
|
||||
Pouja Nikray <poujanik@gmail.com>
|
||||
Ray <ray@tomo.im>
|
||||
Richard Feldman <richard.t.feldman@gmail.com> <richard@noredink.com>
|
||||
Richard Livesey <Livesey7@hotmail.co.uk>
|
||||
Rob Arnold <robarnold@cs.cmu.edu>
|
||||
Sander Spies <sandermail@gmail.com>
|
||||
Scott Feeney <scott@oceanbase.org> <smf@fb.com>
|
||||
Sebastian Markbåge <sebastian@calyptus.eu> <sema@fb.com>
|
||||
Sergey Rubanov <chi187@gmail.com>
|
||||
Steven Luscher <react@steveluscher.com> <github@steveluscher.com>
|
||||
Steven Luscher <react@steveluscher.com> <steveluscher@instagram.com>
|
||||
Steven Luscher <react@steveluscher.com> <steveluscher@users.noreply.github.com>
|
||||
Stoyan Stefanov <ssttoo@ymail.com>
|
||||
Thomas Aylott <oblivious@subtlegradient.com> <aylott@fb.com>
|
||||
Timothy Yung <yungsters@gmail.com> <yungsters@fb.com>
|
||||
Vjeux <vjeuxx@gmail.com>
|
||||
Vjeux <vjeuxx@gmail.com> <vjeux@fb.com>
|
||||
Volkan Unsal <spocksplanet@gmail.com>
|
||||
YouBao Nong <noyobo@gmail.com> <nongyoubao@alibaba-inc.com>
|
||||
Zach Bruggeman <mail@bruggie.com> <zbruggeman@me.com>
|
||||
张敏 <cookfront@gmail.com>
|
||||
|
||||
45
.travis.yml
45
.travis.yml
@@ -2,48 +2,22 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- '0.10'
|
||||
sudo: false
|
||||
cache:
|
||||
directories:
|
||||
- docs/vendor/bundle
|
||||
- node_modules
|
||||
before_install:
|
||||
- |
|
||||
if [ "$TEST_TYPE" != build_website ] && \
|
||||
! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.md$)|(^(docs|examples))/'
|
||||
then
|
||||
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
|
||||
PR_FIRST=$(curl -s https://github.com/${TRAVIS_REPO_SLUG}/pull/${TRAVIS_PULL_REQUEST}.patch | head -1 | grep -o -E '\b[0-9a-f]{40}\b' | tr -d '\n')
|
||||
TRAVIS_COMMIT_RANGE=$PR_FIRST^..$TRAVIS_COMMIT
|
||||
fi
|
||||
git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.md$)|(^(docs|examples))/' || {
|
||||
echo "Only docs were updated, stopping build process."
|
||||
exit
|
||||
fi
|
||||
}
|
||||
script:
|
||||
- |
|
||||
if [ "$TEST_TYPE" = build_website ]; then
|
||||
if [ "$TRAVIS_BRANCH" = "$REACT_WEBSITE_BRANCH" ] && [ "$TRAVIS_PULL_REQUEST" = false ]; then
|
||||
set -e
|
||||
|
||||
GH_PAGES_DIR="$TRAVIS_BUILD_DIR"/../react-gh-pages
|
||||
echo "machine github.com login reactjs-bot password $GITHUB_TOKEN" >~/.netrc
|
||||
git config --global user.name "Travis CI"
|
||||
git config --global user.email "travis@reactjs.org"
|
||||
|
||||
git clone --branch gh-pages --depth=50 \
|
||||
https://reactjs-bot@github.com/facebook/react.git \
|
||||
$GH_PAGES_DIR
|
||||
pushd docs
|
||||
bundle install --jobs=3 --retry=3 --path=vendor/bundle
|
||||
bundle exec rake release
|
||||
cd $GH_PAGES_DIR
|
||||
git status
|
||||
if ! git diff-index --quiet HEAD --; then
|
||||
git add -A .
|
||||
git commit -m "Rebuild website"
|
||||
git push origin gh-pages
|
||||
fi
|
||||
popd
|
||||
fi
|
||||
else
|
||||
grunt $TEST_TYPE
|
||||
fi
|
||||
grunt $TEST_TYPE
|
||||
after_script:
|
||||
- |
|
||||
if [ "$TEST_TYPE" = test ] && [ "$SERVER" ]; then
|
||||
@@ -66,20 +40,17 @@ after_script:
|
||||
env:
|
||||
matrix:
|
||||
- TEST_TYPE=test
|
||||
- TEST_TYPE=jest
|
||||
- TEST_TYPE=lint
|
||||
- TEST_TYPE=build_website
|
||||
- TEST_TYPE=test:webdriver:saucelabs:modern
|
||||
global:
|
||||
# SERVER
|
||||
- secure: qPvsJ46XzGrdIuPA70b55xQNGF8jcK7N1LN5CCQYYocXLa+fBrl+fTE77QvehOPhqwJXcj6kOxI+sY0KrVwV7gmq2XY2HZGWUSCxTN0SZlNIzqPA80Y7G/yOjA4PUt8LKgP+8tptyhTAY56qf+hgW8BoLiKOdztYF2p+3zXOLuA=
|
||||
# SECRET_TOKEN
|
||||
- secure: dkpPW+VnoqC/okhRdV90m36NcyBFhcwEKL3bNFExAwi0dXnFao8RoFlvnwiPlA23h2faROkMIetXlti6Aju08BgUFV+f9aL6vLyU7gUent4Nd3413zf2fwDtXIWIETg6uLnOpSykGKgCAT/hY3Q2oPLqOoY0OxfgnbqwxkxljrE=
|
||||
# GITHUB_TOKEN
|
||||
- secure: EHCyCSKMwKlLHNtcj9nmkRzmiiPE3aDGlPcnEyrDJeRI0SeN/iCXHXfFivR0vFq3vr+9naMBczAR2AEidtps5KbJrKqdZnjPFRbmfVtzWr/LlvVCub3u13Pub6TdKIVBTny1PuZ5X8GvdxMNVig89jGjvzhhWuQRaz3VhJnTra4=
|
||||
matrix:
|
||||
fast_finish: true
|
||||
allow_failures:
|
||||
- env: TEST_TYPE=lint
|
||||
- env: TEST_TYPE=test:coverage
|
||||
- env: TEST_TYPE=perf:full
|
||||
- env: TEST_TYPE=test:webdriver:saucelabs:modern
|
||||
|
||||
104
AUTHORS
104
AUTHORS
@@ -1,63 +1,39 @@
|
||||
Aaron Franks <aaron.franks@gmail.com>
|
||||
Adam Krebs <amk528@cs.nyu.edu>
|
||||
Adam Mark <adammark75@gmail.com>
|
||||
Adam Solove <asolove@gmail.com>
|
||||
Alan deLevie <adelevie@gmail.com>
|
||||
Alex Boyd <alex@opengroove.org>
|
||||
Alex Mykyta <dancingwithcows@gmail.com>
|
||||
Alex Zelenskiy <azelenskiy@fb.com>
|
||||
Alexander Solovyov <alexander@solovyov.net>
|
||||
Alexander Tseung <alextsg@gmail.com>
|
||||
Alexandre Gaudencio <shahor@shahor.fr>
|
||||
Alexey Raspopov <avenger7x13@gmail.com>
|
||||
Alexey Shamrin <shamrin@gmail.com>
|
||||
Andre Z Sanchez <andrezacsanchez@gmail.com>
|
||||
Andreas Svensson <andreas@syranide.com>
|
||||
Andres Suarez <zertosh@gmail.com>
|
||||
Andrew Cobby <cobbweb@users.noreply.github.com>
|
||||
Andrew Davey <andrew@equin.co.uk>
|
||||
Andrew Rasmussen <andras@fb.com>
|
||||
Andrew Zich <azich@fb.com>
|
||||
Andrey Popp <8mayday@gmail.com>
|
||||
Anthony van der Hoorn <anthony.vanderhoorn@gmail.com>
|
||||
Antti Ahti <antti.ahti@gmail.com>
|
||||
Areeb Malik <areeb.malik91@gmail.com>
|
||||
Aria Buckles <aria@khanacademy.org>
|
||||
Artem Nezvigin <artem@artnez.com>
|
||||
Ayman Osman <aymano.osman@gmail.com>
|
||||
Bartosz Kaszubowski <gosimek@gmail.com>
|
||||
Beau Smith <beau@beausmith.com>
|
||||
Ben Alpert <ben@benalpert.com>
|
||||
Ben Foxall <benfoxall@gmail.com>
|
||||
Ben Newman <bn@cs.stanford.edu>
|
||||
Ben Ripkens <bripkens.dev@gmail.com>
|
||||
Benjamin Keen <ben.keen@gmail.com>
|
||||
Benjamin Leiken <benleiken@gmail.com>
|
||||
Bill Fisher <fisherwebdev@gmail.com>
|
||||
Blaine Hatab <jbhatab@gmail.com>
|
||||
Bob Eagan <bob@synapsestudios.com>
|
||||
Bob Ralian <bob.ralian@gmail.com>
|
||||
Bojan Mihelac <bmihelac@mihelac.org>
|
||||
Brandon Bloom <brandon@brandonbloom.name>
|
||||
Brandon Tilley <brandon@brandontilley.com>
|
||||
Brian Cooke <bri@bricooke.com>
|
||||
Brian Holt <btholt@gmail.com>
|
||||
Brian Hsu <brianhsu@Brians-MacBook-Pro.local>
|
||||
Brian Kim <briankimpossible@gmail.com>
|
||||
Brian Kung <brian@callmekung.com>
|
||||
Brian Reavis <brian@thirdroute.com>
|
||||
Brian Rue <brian@rollbar.com>
|
||||
Bruno Škvorc <bruno@skvorc.me>
|
||||
Cam Song <neosoyn@gmail.com>
|
||||
Cam Spiers <camspiers@gmail.com>
|
||||
Cassus Adam Banko <banko.adam@gmail.com>
|
||||
Cat Chen <catchen@fb.com>
|
||||
Cedric Sohrauer <cedric.sohrauer@infopark.de>
|
||||
Charles Marsh <charlie@khanacademy.org>
|
||||
Cheng Lou <chenglou92@gmail.com>
|
||||
Chitharanjan Das <das.chitharanjan@gmail.com>
|
||||
Chris Sciolla <csciolla1@gmail.com>
|
||||
Christian <christianoliff@yahoo.com>
|
||||
Christian Alfoni <christianalfoni@gmail.com>
|
||||
Christian Roman <chroman16@gmail.com>
|
||||
Christoph Pojer <christoph.pojer@gmail.com>
|
||||
@@ -66,26 +42,19 @@ Clay Allsopp <clay.allsopp@gmail.com>
|
||||
Connor McSheffrey <c@conr.me>
|
||||
Cotton Hou <himcotton@gmail.com>
|
||||
Dan Abramov <dan.abramov@gmail.com>
|
||||
Dan Fox <iamdanfox@gmail.com>
|
||||
Dan Schafer <dschafer@fb.com>
|
||||
Daniel Carlsson <daniel.carlsson.1987@gmail.com>
|
||||
Daniel Gasienica <daniel@gasienica.ch>
|
||||
Daniel Lo Nigro <daniel@dan.cx>
|
||||
Daniel Mané <danmane@gmail.com>
|
||||
Daniel Miladinov <dmiladinov@wingspan.com>
|
||||
Daniel Schonfeld <daniel@schonfeld.org>
|
||||
Danny Ben-David <dannybd@fb.com>
|
||||
Daryl Lau <daryl@weak.io>
|
||||
David Hellsing <david@aino.se>
|
||||
David Hu <davidhu91@gmail.com>
|
||||
Denis Sokolov <denis@sokolov.cc>
|
||||
Dennis Johnson <djohnson@rallydev.com>
|
||||
Devon Blandin <dblandin@gmail.com>
|
||||
Dmitrii Abramov <dmitrii@rheia.us>
|
||||
Dmitry Mazuro <dmitry.mazuro@icloud.com>
|
||||
Dustan Kasten <dustan.kasten@gmail.com>
|
||||
Dustin Getz <dgetz@wingspan.com>
|
||||
Dylan Harrington <dylanharrington@gmail.com>
|
||||
Enguerran <engcolson@gmail.com>
|
||||
Eric Clemmons <eric@smarterspam.com>
|
||||
Eric Florenzano <floguy@gmail.com>
|
||||
@@ -99,8 +68,6 @@ Fernando Correia <fernando@servicero.com>
|
||||
François-Xavier Bois <fxbois@gmail.com>
|
||||
Fred Zhao <fredz@fb.com>
|
||||
G Scott Olson <gscottolson@gmail.com>
|
||||
G. Kay Lee <balancetraveller+github@gmail.com>
|
||||
Gabe Levi <gabelevi@gmail.com>
|
||||
Garren Smith <garren.smith@gmail.com>
|
||||
Geert Pasteels <geert.pasteels@gmail.com>
|
||||
Geert-Jan Brits <gbrits@gmail.com>
|
||||
@@ -112,20 +79,14 @@ Greg Roodt <groodt@gmail.com>
|
||||
Guangqiang Dong <gqdong@fb.com>
|
||||
Guido Bouman <m@guido.vc>
|
||||
Harry Hull <harry.hull1@gmail.com>
|
||||
Harry Marr <harry.marr@gmail.com>
|
||||
Harry Moreno <morenoh149@gmail.com>
|
||||
Harshad Sabne <harshadsabne@users.noreply.github.com>
|
||||
Hendrik Swanepoel <hendrik.swanepoel@gmail.com>
|
||||
Henry Zhu <hi@henryzoo.com>
|
||||
Hou Chia <kchia87@gmail.com>
|
||||
Hugo Jobling <me@thisishugo.com>
|
||||
Héliton Nordt <hnordt@hnordt.com>
|
||||
Ian Obermiller <ian@obermillers.com>
|
||||
Ian Obermiller <iano@fb.com>
|
||||
Ingvar Stepanyan <me@rreverser.com>
|
||||
Irae Carvalho <irae@irae.pro.br>
|
||||
Isaac Salier-Hellendag <isaac@fb.com>
|
||||
Ivan Kozik <ivan@ludios.org>
|
||||
Ivan Krechetov <ikr@ikr.su>
|
||||
Ivan Vergiliev <ivan.vergiliev@gmail.com>
|
||||
Jacob Gable <jacob.gable@gmail.com>
|
||||
Jacob Greenleaf <jake@imgur.com>
|
||||
@@ -140,30 +101,24 @@ Jan Hancic <jan.hancic@gmail.com>
|
||||
Jan Kassens <jan@kassens.net>
|
||||
Jared Forsyth <jared@jaredforsyth.com>
|
||||
Jason Bonta <jbonta@gmail.com>
|
||||
Jason Ly <jason.ly@gmail.com>
|
||||
Jason Trill <jason@jasontrill.com>
|
||||
Jean Lauliac <lauliacj@gmail.com>
|
||||
Jed Watson <jed.watson@me.com>
|
||||
Jeff Barczewski <jeff.barczewski@gmail.com>
|
||||
Jeff Carpenter <gcarpenterv@gmail.com>
|
||||
Jeff Chan <jefftchan@gmail.com>
|
||||
Jeff Kolesky <github@kolesky.com>
|
||||
Jeff Morrison <jeff@anafx.com>
|
||||
Jeff Welch <whatthejeff@gmail.com>
|
||||
Jeffrey Lin <lin.jeffrey@gmail.com>
|
||||
Jesse Skinner <jesse@thefutureoftheweb.com>
|
||||
Jignesh Kakadiya <jigneshhk1992@gmail.com>
|
||||
Jim OBrien <jimobrien930@gmail.com>
|
||||
Jim Sproch <jsproch@fb.com>
|
||||
Jimmy Jea <jimjea@gmail.com>
|
||||
Jing Chen <jingc@fb.com>
|
||||
Joel Auterson <joel.auterson@googlemail.com>
|
||||
Johannes Baiter <johannes.baiter@gmail.com>
|
||||
Johannes Emerich <johannes@emerich.de>
|
||||
John Heroy <johnheroy@users.noreply.github.com>
|
||||
John Watson <jwatson@fb.com>
|
||||
Jon Beebe <jon.beebe@daveramsey.com>
|
||||
Jon Madison <jon@tfftech.com>
|
||||
Jonas Enlund <jonas.enlund@gmail.com>
|
||||
Jonas Gebhardt <jonas@instagram.com>
|
||||
Jonathan Hsu <jhiswin@gmail.com>
|
||||
@@ -171,29 +126,20 @@ Jordan Walke <jordojw@gmail.com>
|
||||
Josh Bassett <josh.bassett@gmail.com>
|
||||
Josh Duck <josh@fb.com>
|
||||
Josh Yudaken <yud@instagram.com>
|
||||
Joshua Goldberg <jsgoldberg90@gmail.com>
|
||||
Joshua Ma <me@joshma.com>
|
||||
João Valente <filipevalente@gmail.com>
|
||||
Juan Serrano <germ13@users.noreply.github.com>
|
||||
Julen Ruiz Aizpuru <julenx@gmail.com>
|
||||
Julien Bordellier <git@julienbordellier.com>
|
||||
Jun Wu <quark@lihdd.net>
|
||||
Juraj Dudak <jdudak@fb.com>
|
||||
Justin Jaffray <justinjaffray@khanacademy.org>
|
||||
Justin Woo <moomoowoo@gmail.com>
|
||||
Karl Mikkelsen <karl@kingkarl.com>
|
||||
Karpich Dmitry <karpich@gollard.ru>
|
||||
Keito Uchiyama <projects@keito.me>
|
||||
Kevin Old <kevin@kevinold.com>
|
||||
Kirk Steven Hansen <hanski07@kirk-hansens-macbook.local>
|
||||
Kit Randel <kit@nocturne.net.nz>
|
||||
Kunal Mehta <k.mehta@berkeley.edu>
|
||||
Kurt Ruppel <me@kurtruppel.com>
|
||||
Kyle Mathews <mathews.kyle@gmail.com>
|
||||
Laurence Rowe <l@lrowe.co.uk>
|
||||
Lee Byron <lee@leebyron.com>
|
||||
Lei <tendant@gmail.com>
|
||||
Leon Fedotov <LeonFedotov@users.noreply.github.com>
|
||||
Levi McCallum <levi@levimccallum.com>
|
||||
Lily <qvang.j@gmail.com>
|
||||
Logan Allen <loganfynne@gmail.com>
|
||||
@@ -202,31 +148,21 @@ Marcin Kwiatkowski <marcin.kwiatkowski@hotmail.com>
|
||||
Marcin Szczepanski <marcins@gmail.com>
|
||||
Mariano Desanze <protronm@gmail.com>
|
||||
Mark Anderson <undernewmanagement@users.noreply.github.com>
|
||||
Mark Funk <mark@boomtownroi.com>
|
||||
Mark Hintz <markohintz@gmail.com>
|
||||
Mark IJbema <markijbema@gmail.com>
|
||||
Mark Richardson <echo@fb.com>
|
||||
Marlon Landaverde <milanlandaverde@gmail.com>
|
||||
Marshall Roch <mroch@fb.com>
|
||||
Martin Andert <mandert@gmail.com>
|
||||
Martin Jul <martin@mjul.com>
|
||||
Martin Konicek <mkonicek@fb.com>
|
||||
Mathieu M-Gosselin <mathieumg@gmail.com>
|
||||
Matias Singers <mail@matiassingers.com>
|
||||
Matt Harrison <mt.harrison86@gmail.com>
|
||||
Matt Huggins <matt.huggins@gmail.com>
|
||||
Matt Zabriskie <mzabriskie@gmail.com>
|
||||
Matthew Dapena-Tretter <m@tthewwithanm.com>
|
||||
Matthew Johnston <matthewjohnston4@users.noreply.github.com>
|
||||
Matti Nelimarkka <matti.nelimarkka@hiit.fi>
|
||||
Max F. Albrecht <1@178.is>
|
||||
Michael Chan <mijoch@gmail.com>
|
||||
Michael Randers-Pehrson <michael.rp@gmail.com>
|
||||
Michal Srb <xixixao@seznam.cz>
|
||||
Michelle Todd <himichelletodd@gmail.com>
|
||||
Mihai Parparita <mihai.parparita@gmail.com>
|
||||
Mike D Pilsbury <mike.pilsbury@gmail.com>
|
||||
Minwe LUO <minwe@yunshipei.com>
|
||||
Miorel Palii <miorel@fb.com>
|
||||
Mouad Debbar <mdebbar@fb.com>
|
||||
Nadeesha Cabral <nadeesha.cabral@gmail.com>
|
||||
@@ -237,70 +173,45 @@ Nicholas Bergson-Shilcock <me@nicholasbs.net>
|
||||
Nick Fitzgerald <fitzgen@gmail.com>
|
||||
Nick Gavalas <njg57@cornell.edu>
|
||||
Nick Merwin <nick@lemurheavy.com>
|
||||
Nick Raienko <enaqxx@gmail.com>
|
||||
Nick Thompson <ncthom91@gmail.com>
|
||||
Nick Williams <WickyNilliams@users.noreply.github.com>
|
||||
Niklas Boström <nbostrom@gmail.com>
|
||||
Oiva Eskola <oiva.eskola@gmail.com>
|
||||
Oleg <o.yanchinskiy@gmail.com>
|
||||
Oleksii Markhovskyi <olexiy.markhovsky@gmail.com>
|
||||
Oliver Zeigermann <oliver.zeigermann@gmail.com>
|
||||
Owen Coutts <owenc@fb.com>
|
||||
Pablo Lacerda de Miranda <pablolm@yahoo-inc.com>
|
||||
Pascal Hartig <passy@twitter.com>
|
||||
Patrick Laughlin <patrick@laughl.info>
|
||||
Paul O’Shannessy <paul@oshannessy.com>
|
||||
Paul Seiffert <paul.seiffert@gmail.com>
|
||||
Paul Shen <paul@mnml0.com>
|
||||
Pedro Nauck <pedronauck@gmail.com>
|
||||
Pete Hunt <floydophone@gmail.com>
|
||||
Peter Blazejewicz <peter.blazejewicz@gmail.com>
|
||||
Peter Cottle <pcottle@fb.com>
|
||||
Peter Jaros <peter.a.jaros@gmail.com>
|
||||
Petri Lehtinen <petri@digip.org>
|
||||
Petri Lievonen <plievone@cc.hut.fi>
|
||||
Pieter Vanderwerff <me@pieter.io>
|
||||
Pouja Nikray <poujanik@gmail.com>
|
||||
Preston Parry <ClimbsRocks@users.noreply.github.com>
|
||||
Rafael <rafael.garcia@clever.com>
|
||||
Rafal Dittwald <rafal.dittwald@gmail.com>
|
||||
Rajiv Tirumalareddy <rajivtreddy@gmail.com>
|
||||
Randall Randall <randall@randallsquared.com>
|
||||
Ray <ray@tomo.im>
|
||||
Raymond Ha <raymond@shraymonks.com>
|
||||
Richard D. Worth <rdworth@gmail.com>
|
||||
Richard Feldman <richard.t.feldman@gmail.com>
|
||||
Richard Kho <hello@richardkho.com>
|
||||
Richard Littauer <richard.littauer@gmail.com>
|
||||
Richard Livesey <Livesey7@hotmail.co.uk>
|
||||
Rick Beerendonk <rick@beerendonk.com>
|
||||
Riley Tomasek <riley.tomasek@gmail.com>
|
||||
Rob Arnold <robarnold@cs.cmu.edu>
|
||||
Robert Sedovsek <robert.sedovsek@gmail.com>
|
||||
Roman Vanesyan <roman.vanesyan@gmail.com>
|
||||
Ryan Seddon <seddon.ryan@gmail.com>
|
||||
Sahat Yalkabov <sakhat@gmail.com>
|
||||
Sam Saccone <samccone@gmail.com>
|
||||
Sam Selikoff <sam.selikoff@gmail.com>
|
||||
Sander Spies <sandermail@gmail.com>
|
||||
Scott Feeney <scott@oceanbase.org>
|
||||
Sean Kinsey <oyvind@fb.com>
|
||||
Sebastian Markbåge <sebastian@calyptus.eu>
|
||||
Sergey Generalov <sergey@genbit.ru>
|
||||
Sergey Rubanov <chi187@gmail.com>
|
||||
Shane O'Sullivan <shaneosullivan1@gmail.com>
|
||||
Shaun Trennery <shaun.trennery@gmail.com>
|
||||
Sheraz <undernewmanagement@users.noreply.github.com>
|
||||
ShihChi Huang <hhuang@netflix.com>
|
||||
Shripad K <assortmentofsorts@gmail.com>
|
||||
Simon Højberg <r.hackr@gmail.com>
|
||||
Simon Welsh <simon@simon.geek.nz>
|
||||
Sophia Westwood <sophia@quip.com>
|
||||
Spencer Handley <spencerhandley@gmail.com>
|
||||
Stefan Dombrowski <sdo451@gmail.com>
|
||||
Stephen Murphy <smurphy3@apple.com>
|
||||
Steve Baker <_steve_@outlook.com>
|
||||
Steven Luscher <react@steveluscher.com>
|
||||
Stoyan Stefanov <ssttoo@ymail.com>
|
||||
Sundeep Malladi <sundeep.malladi@gmail.com>
|
||||
Sunny Juneja <me@sunnyjuneja.com>
|
||||
@@ -311,33 +222,22 @@ Thomas Boyt <thomas.boyt@venmo.com>
|
||||
Thomas Shaddox <thomas@heyzap.com>
|
||||
Thomas Shafer <thomasjshafer@gmail.com>
|
||||
ThomasCrvsr <crevoisier.thomas@gmail.com>
|
||||
Tienchai Wirojsaksaree <tienchai@fb.com>
|
||||
Tim Schaub <tschaub@users.noreply.github.com>
|
||||
Timothy Yung <yungsters@gmail.com>
|
||||
Tom Haggie <thaggie@gmail.com>
|
||||
Tom Hauburger <thauburger@gmail.com>
|
||||
Tom MacWright <tom@macwright.org>
|
||||
Tom Occhino <tomocchino@gmail.com>
|
||||
Toru Kobayashi <koba0004@gmail.com>
|
||||
Ville Immonen <ville.immonen@iki.fi>
|
||||
Vincent Riemer <vincentriemer@gmail.com>
|
||||
Vincent Siao <vincent@asana.com>
|
||||
Vjeux <vjeuxx@gmail.com>
|
||||
Volkan Unsal <spocksplanet@gmail.com>
|
||||
Wayne Larsen <wayne@larsen.st>
|
||||
WickyNilliams <WickyNilliams@MBA>
|
||||
Wincent Colaiuta <win@wincent.com>
|
||||
Wout Mertens <Wout.Mertens@gmail.com>
|
||||
XuefengWu <benewu@gmail.com>
|
||||
YouBao Nong <noyobo@gmail.com>
|
||||
Yuriy Dybskiy <yuriy@dybskiy.com>
|
||||
Yuval Dekel <thedekel@fb.com>
|
||||
Zach Bruggeman <mail@bruggie.com>
|
||||
Zacharias <zachasme@users.noreply.github.com>
|
||||
brafdlog <brafdlog@gmail.com>
|
||||
chen <kikyous@163.com>
|
||||
cutbko <kutsenko.eugene@hotmail.com>
|
||||
davidxi <davidgraycn@gmail.com>
|
||||
imagentleman <imagentlemail@gmail.com>
|
||||
Árni Hermann Reynisson <arnihr@gmail.com>
|
||||
张敏 <cookfront@gmail.com>
|
||||
jon madison <jon@tfftech.com>
|
||||
|
||||
148
CHANGELOG.md
148
CHANGELOG.md
@@ -1,137 +1,3 @@
|
||||
## 0.13.3 (May 8, 2015)
|
||||
|
||||
### React Core
|
||||
|
||||
#### New Features
|
||||
|
||||
* Added `clipPath` element and attribute for SVG
|
||||
* Improved warnings for deprecated methods in plain JS classes
|
||||
|
||||
#### Bug Fixes
|
||||
|
||||
* Loosened `dangerouslySetInnerHTML` restrictions so `{__html: undefined}` will no longer throw
|
||||
* Fixed extraneous context warning with non-pure `getChildContext`
|
||||
* Ensure `replaceState(obj)` retains prototype of `obj`
|
||||
|
||||
### React with Add-ons
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Test Utils: Ensure that shallow rendering works when components define `contextTypes`
|
||||
|
||||
|
||||
## 0.13.2 (April 18, 2015)
|
||||
|
||||
### React Core
|
||||
|
||||
#### New Features
|
||||
|
||||
* Added `strokeDashoffset`, `flexPositive`, `flexNegative` to the list of unitless CSS properties
|
||||
* Added support for more DOM properties:
|
||||
* `scoped` - for `<style>` elements
|
||||
* `high`, `low`, `optimum` - for `<meter>` elements
|
||||
* `unselectable` - IE-specific property to prevent user selection
|
||||
|
||||
#### Bug Fixes
|
||||
|
||||
* Fixed a case where re-rendering after rendering null didn't properly pass context
|
||||
* Fixed a case where re-rendering after rendering with `style={null}` didn't properly update `style`
|
||||
* Update `uglify` dependency to prevent a bug in IE8
|
||||
* Improved warnings
|
||||
|
||||
### React with Add-Ons
|
||||
|
||||
#### Bug Fixes
|
||||
|
||||
* Immutabilty Helpers: Ensure it supports `hasOwnProperty` as an object key
|
||||
|
||||
### React Tools
|
||||
|
||||
* Improve documentation for new options
|
||||
|
||||
|
||||
## 0.13.1 (March 16, 2015)
|
||||
|
||||
### React Core
|
||||
|
||||
#### Bug Fixes
|
||||
|
||||
* Don't throw when rendering empty `<select>` elements
|
||||
* Ensure updating `style` works when transitioning from `null`
|
||||
|
||||
### React with Add-Ons
|
||||
|
||||
#### Bug Fixes
|
||||
|
||||
* TestUtils: Don't warn about `getDOMNode` for ES6 classes
|
||||
* TestUtils: Ensure wrapped full page components (`<html>`, `<head>`, `<body>`) are treated as DOM components
|
||||
* Perf: Stop double-counting DOM components
|
||||
|
||||
### React Tools
|
||||
|
||||
#### Bug Fixes
|
||||
|
||||
* Fix option parsing for `--non-strict-es6module`
|
||||
|
||||
|
||||
## 0.13.0 (March 10, 2015)
|
||||
|
||||
### React Core
|
||||
|
||||
#### Breaking Changes
|
||||
|
||||
* Deprecated patterns that warned in 0.12 no longer work: most prominently, calling component classes without using JSX or React.createElement and using non-component functions with JSX or createElement
|
||||
* Mutating `props` after an element is created is deprecated and will cause warnings in development mode; future versions of React will incorporate performance optimizations assuming that props aren't mutated
|
||||
* Static methods (defined in `statics`) are no longer autobound to the component class
|
||||
* `ref` resolution order has changed slightly such that a ref to a component is available immediately after its `componentDidMount` method is called; this change should be observable only if your component calls a parent component's callback within your `componentDidMount`, which is an anti-pattern and should be avoided regardless
|
||||
* Calls to `setState` in life-cycle methods are now always batched and therefore asynchronous. Previously the first call on the first mount was synchronous.
|
||||
* `setState` and `forceUpdate` on an unmounted component now warns instead of throwing. That avoids a possible race condition with Promises.
|
||||
* Access to most internal properties has been completely removed, including `this._pendingState` and `this._rootNodeID`.
|
||||
|
||||
#### New Features
|
||||
|
||||
* Support for using ES6 classes to build React components; see the [v0.13.0 beta 1 notes](https://facebook.github.io/react/blog/2015/01/27/react-v0.13.0-beta-1.html) for details.
|
||||
* Added new top-level API `React.findDOMNode(component)`, which should be used in place of `component.getDOMNode()`. The base class for ES6-based components will not have `getDOMNode`. This change will enable some more patterns moving forward.
|
||||
* Added a new top-level API `React.cloneElement(el, props)` for making copies of React elements – see the [v0.13 RC2 notes](/react/blog/2015/03/03/react-v0.13-rc2.html#react.cloneelement) for more details.
|
||||
* New `ref` style, allowing a callback to be used in place of a name: `<Photo ref={(c) => this._photo = c} />` allows you to reference the component with `this._photo` (as opposed to `ref="photo"` which gives `this.refs.photo`).
|
||||
* `this.setState()` can now take a function as the first argument for transactional state updates, such as `this.setState((state, props) => ({count: state.count + 1}));` – this means that you no longer need to use `this._pendingState`, which is now gone.
|
||||
* Support for iterators and immutable-js sequences as children.
|
||||
|
||||
#### Deprecations
|
||||
|
||||
* `ComponentClass.type` is deprecated. Just use `ComponentClass` (usually as `element.type === ComponentClass`).
|
||||
* Some methods that are available on `createClass`-based components are removed or deprecated from ES6 classes (`getDOMNode`, `replaceState`, `isMounted`, `setProps`, `replaceProps`).
|
||||
|
||||
### React with Add-Ons
|
||||
|
||||
#### New Features
|
||||
|
||||
* [`React.addons.createFragment` was added](/react/docs/create-fragment.html) for adding keys to entire sets of children.
|
||||
|
||||
#### Deprecations
|
||||
|
||||
* `React.addons.classSet` is now deprecated. This functionality can be replaced with several freely available modules. [classnames](https://www.npmjs.com/package/classnames) is one such module.
|
||||
* Calls to `React.addons.cloneWithProps` can be migrated to use `React.cloneElement` instead – make sure to merge `style` and `className` manually if desired.
|
||||
|
||||
### React Tools
|
||||
|
||||
#### Breaking Changes
|
||||
|
||||
* When transforming ES6 syntax, `class` methods are no longer enumerable by default, which requires `Object.defineProperty`; if you support browsers such as IE8, you can pass `--target es3` to mirror the old behavior
|
||||
|
||||
#### New Features
|
||||
|
||||
* `--target` option is available on the jsx command, allowing users to specify and ECMAScript version to target.
|
||||
* `es5` is the default.
|
||||
* `es3` restores the previous default behavior. An additional transform is added here to ensure the use of reserved words as properties is safe (eg `this.static` will become `this['static']` for IE8 compatibility).
|
||||
* The transform for the call spread operator has also been enabled.
|
||||
|
||||
### JSX
|
||||
|
||||
#### Breaking Changes
|
||||
* A change was made to how some JSX was parsed, specifically around the use of `>` or `}` when inside an element. Previously it would be treated as a string but now it will be treated as a parse error. The [`jsx_orphaned_brackets_transformer`](https://www.npmjs.com/package/jsx_orphaned_brackets_transformer) package on npm can be used to find and fix potential issues in your JSX code.
|
||||
|
||||
|
||||
## 0.12.2 (December 18, 2014)
|
||||
|
||||
### React Core
|
||||
@@ -326,7 +192,7 @@
|
||||
|
||||
#### New Features
|
||||
* Added warnings to help migrate towards descriptors
|
||||
* Made it possible to server render without React-related markup (`data-reactid`, `data-react-checksum`). This DOM will not be mountable by React. [Read the docs for `React.renderComponentToStaticMarkup`](https://facebook.github.io/react/docs/top-level-api.html#react.rendercomponenttostaticmarkup)
|
||||
* Made it possible to server render without React-related markup (`data-reactid`, `data-react-checksum`). This DOM will not be mountable by React. [Read the docs for `React.renderComponentToStaticMarkup`](http://facebook.github.io/react/docs/top-level-api.html#react.rendercomponenttostaticmarkup)
|
||||
* Added support for more attributes:
|
||||
* `srcSet` for `<img>` to specify images at different pixel ratios
|
||||
* `textAnchor` for SVG
|
||||
@@ -338,7 +204,7 @@
|
||||
|
||||
### Addons
|
||||
|
||||
* `update` function to deal with immutable data. [Read the docs](https://facebook.github.io/react/docs/update.html)
|
||||
* `update` function to deal with immutable data. [Read the docs](http://facebook.github.io/react/docs/update.html)
|
||||
|
||||
### react-tools
|
||||
* Added an option argument to `transform` function. The only option supported is `harmony`, which behaves the same as `jsx --harmony` on the command line. This uses the ES6 transforms from [jstransform](https://github.com/facebook/jstransform).
|
||||
@@ -500,7 +366,7 @@
|
||||
|
||||
### React with Addons (New!)
|
||||
|
||||
* Introduced a separate build with several "addons" which we think can help improve the React experience. We plan to deprecate this in the long-term, instead shipping each as standalone pieces. [Read more in the docs](https://facebook.github.io/react/docs/addons.html).
|
||||
* Introduced a separate build with several "addons" which we think can help improve the React experience. We plan to deprecate this in the long-term, instead shipping each as standalone pieces. [Read more in the docs](http://facebook.github.io/react/docs/addons.html).
|
||||
|
||||
### JSX
|
||||
|
||||
@@ -533,10 +399,10 @@
|
||||
* Switch from using `id` attribute to `data-reactid` to track DOM nodes. This allows you to integrate with other JS and CSS libraries more easily.
|
||||
* Support for more DOM elements and attributes (e.g., `<canvas>`)
|
||||
* Improved server-side rendering APIs. `React.renderComponentToString(<component>, callback)` allows you to use React on the server and generate markup which can be sent down to the browser.
|
||||
* `prop` improvements: validation and default values. [Read our blog post for details...](https://facebook.github.io/react/blog/2013/07/11/react-v0-4-prop-validation-and-default-values.html)
|
||||
* Support for the `key` prop, which allows for finer control over reconciliation. [Read the docs for details...](https://facebook.github.io/react/docs/multiple-components.html)
|
||||
* Removed `React.autoBind`. [Read our blog post for details...](https://facebook.github.io/react/blog/2013/07/02/react-v0-4-autobind-by-default.html)
|
||||
* Improvements to forms. We've written wrappers around `<input>`, `<textarea>`, `<option>`, and `<select>` in order to standardize many inconsistencies in browser implementations. This includes support for `defaultValue`, and improved implementation of the `onChange` event, and circuit completion. [Read the docs for details...](https://facebook.github.io/react/docs/forms.html)
|
||||
* `prop` improvements: validation and default values. [Read our blog post for details...](http://facebook.github.io/react/blog/2013/07/11/react-v0-4-prop-validation-and-default-values.html)
|
||||
* Support for the `key` prop, which allows for finer control over reconciliation. [Read the docs for details...](http://facebook.github.io/react/docs/multiple-components.html)
|
||||
* Removed `React.autoBind`. [Read our blog post for details...](http://facebook.github.io/react/blog/2013/07/02/react-v0-4-autobind-by-default.html)
|
||||
* Improvements to forms. We've written wrappers around `<input>`, `<textarea>`, `<option>`, and `<select>` in order to standardize many inconsistencies in browser implementations. This includes support for `defaultValue`, and improved implementation of the `onChange` event, and circuit completion. [Read the docs for details...](http://facebook.github.io/react/docs/forms.html)
|
||||
* We've implemented an improved synthetic event system that conforms to the W3C spec.
|
||||
* Updates to your component are batched now, which may result in a significantly faster re-render of components. `this.setState` now takes an optional callback as it's second parameter. If you were using `onClick={this.setState.bind(this, state)}` previously, you'll want to make sure you add a third parameter so that the event is not treated as the callback.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Contributing to React
|
||||
|
||||
React is one of Facebook's first open source projects that is both under very active development and is also being used to ship code to everybody on [facebook.com](https://www.facebook.com). We're still working out the kinks to make contributing to this project as easy and transparent as possible, but we're not quite there yet. Hopefully this document makes the process for contributing clear and preempts some questions you may have.
|
||||
React is one of Facebook's first open source projects that is both under very active development and is also being used to ship code to everybody on facebook.com. We're still working out the kinks to make contributing to this project as easy and transparent as possible, but we're not quite there yet. Hopefully this document makes the process for contributing clear and preempts some questions you may have.
|
||||
|
||||
## Our Development Process
|
||||
|
||||
@@ -27,7 +27,7 @@ The core team will be monitoring for pull requests. When we get one, we'll run s
|
||||
|
||||
In order to accept your pull request, we need you to submit a CLA. You only need to do this once, so if you've done this for another Facebook open source project, you're good to go. If you are submitting a pull request for the first time, just let us know that you have completed the CLA and we can cross-check with your GitHub username.
|
||||
|
||||
[Complete your CLA here](https://code.facebook.com/cla)
|
||||
Complete your CLA here: <https://code.facebook.com/cla>
|
||||
|
||||
## Bugs
|
||||
|
||||
@@ -41,12 +41,12 @@ The best way to get your bug fixed is to provide a reduced test case. jsFiddle,
|
||||
|
||||
### Security Bugs
|
||||
|
||||
Facebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe disclosure of security bugs. With that in mind, please do not file public issues; go through the process outlined on that page.
|
||||
Facebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe disclosure of security bugs. With that in mind, please do not file public issues and go through the process outlined on that page.
|
||||
|
||||
## How to Get in Touch
|
||||
|
||||
* IRC - [#reactjs on freenode](https://webchat.freenode.net/?channels=reactjs)
|
||||
* Discussion forum - [discuss.reactjs.org](https://discuss.reactjs.org/)
|
||||
* IRC - [#reactjs on freenode](http://webchat.freenode.net/?channels=reactjs)
|
||||
* Mailing list - [reactjs on Google Groups](http://groups.google.com/group/reactjs)
|
||||
|
||||
## Style Guide
|
||||
|
||||
@@ -56,7 +56,7 @@ Facebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe
|
||||
* Commas last,
|
||||
* 2 spaces for indentation (no tabs)
|
||||
* Prefer `'` over `"`
|
||||
* `'use strict';`
|
||||
* `"use strict";`
|
||||
* 80 character line length
|
||||
* "Attractive"
|
||||
* Do not use the optional parameters of `setTimeout` and `setInterval`
|
||||
|
||||
80
Gruntfile.js
80
Gruntfile.js
@@ -1,5 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
var exec = require('child_process').exec;
|
||||
var jsxTask = require('./grunt/tasks/jsx');
|
||||
var browserifyTask = require('./grunt/tasks/browserify');
|
||||
var populistTask = require('./grunt/tasks/populist');
|
||||
@@ -12,53 +13,35 @@ var npmReactTasks = require('./grunt/tasks/npm-react');
|
||||
var npmReactToolsTasks = require('./grunt/tasks/npm-react-tools');
|
||||
var versionCheckTask = require('./grunt/tasks/version-check');
|
||||
var gemReactSourceTasks = require('./grunt/tasks/gem-react-source');
|
||||
var eslintTask = require('./grunt/tasks/eslint');
|
||||
|
||||
module.exports = function(grunt) {
|
||||
|
||||
grunt.initConfig({
|
||||
pkg: grunt.file.readJSON('package.json'),
|
||||
copy: require('./grunt/config/copy'),
|
||||
jsx: require('./grunt/config/jsx'),
|
||||
browserify: require('./grunt/config/browserify'),
|
||||
populist: require('./grunt/config/populist')(grunt),
|
||||
connect: require('./grunt/config/server')(grunt),
|
||||
'webdriver-jasmine': require('./grunt/config/webdriver-jasmine'),
|
||||
'webdriver-perf': require('./grunt/config/webdriver-perf'),
|
||||
"webdriver-jasmine": require('./grunt/config/webdriver-jasmine'),
|
||||
"webdriver-perf": require('./grunt/config/webdriver-perf'),
|
||||
npm: require('./grunt/config/npm'),
|
||||
clean: [
|
||||
'./build',
|
||||
'./*.gem',
|
||||
'./docs/_site',
|
||||
'./examples/shared/*.js',
|
||||
'.module-cache'
|
||||
],
|
||||
clean: ['./build', './*.gem', './docs/_site', './examples/shared/*.js', '.module-cache'],
|
||||
jshint: require('./grunt/config/jshint'),
|
||||
/*eslint-disable camelcase */
|
||||
compare_size: require('./grunt/config/compare_size')
|
||||
/*eslint-enable camelcase */
|
||||
});
|
||||
|
||||
grunt.config.set('compress', require('./grunt/config/compress'));
|
||||
|
||||
Object.keys(grunt.file.readJSON('package.json').devDependencies)
|
||||
.filter(function(npmTaskName) {
|
||||
return npmTaskName.indexOf('grunt-') === 0;
|
||||
})
|
||||
.filter(function(npmTaskName) {
|
||||
return npmTaskName !== 'grunt-cli';
|
||||
})
|
||||
.forEach(function(npmTaskName) {
|
||||
grunt.loadNpmTasks(npmTaskName);
|
||||
});
|
||||
.filter(function(npmTaskName) { return npmTaskName.indexOf('grunt-') === 0; })
|
||||
.filter(function(npmTaskName) { return npmTaskName != 'grunt-cli'; })
|
||||
.forEach(function(npmTaskName) { grunt.loadNpmTasks(npmTaskName); });
|
||||
|
||||
grunt.registerTask('eslint', eslintTask);
|
||||
// Alias 'jshint' to 'lint' to better match the workflow we know
|
||||
grunt.registerTask('lint', ['jshint']);
|
||||
|
||||
grunt.registerTask('lint', ['eslint']);
|
||||
|
||||
grunt.registerTask(
|
||||
'download-previous-version',
|
||||
require('./grunt/tasks/download-previous-version.js')
|
||||
);
|
||||
grunt.registerTask('download-previous-version', require('./grunt/tasks/download-previous-version.js'));
|
||||
|
||||
grunt.registerTask('delete-build-modules', function() {
|
||||
if (grunt.file.exists('build/modules')) {
|
||||
@@ -91,28 +74,11 @@ module.exports = function(grunt) {
|
||||
|
||||
grunt.registerTask('version-check', versionCheckTask);
|
||||
|
||||
grunt.registerTask('build:basic', [
|
||||
'jsx:normal',
|
||||
'version-check',
|
||||
'browserify:basic'
|
||||
]);
|
||||
grunt.registerTask('build:addons', [
|
||||
'jsx:normal',
|
||||
'browserify:addons'
|
||||
]);
|
||||
grunt.registerTask('build:transformer', [
|
||||
'jsx:normal',
|
||||
'browserify:transformer'
|
||||
]);
|
||||
grunt.registerTask('build:min', [
|
||||
'jsx:normal',
|
||||
'version-check',
|
||||
'browserify:min'
|
||||
]);
|
||||
grunt.registerTask('build:addons-min', [
|
||||
'jsx:normal',
|
||||
'browserify:addonsMin'
|
||||
]);
|
||||
grunt.registerTask('build:basic', ['jsx:normal', 'version-check', 'browserify:basic']);
|
||||
grunt.registerTask('build:addons', ['jsx:normal', 'browserify:addons']);
|
||||
grunt.registerTask('build:transformer', ['jsx:normal', 'browserify:transformer']);
|
||||
grunt.registerTask('build:min', ['jsx:normal', 'version-check', 'browserify:min']);
|
||||
grunt.registerTask('build:addons-min', ['jsx:normal', 'browserify:addonsMin']);
|
||||
grunt.registerTask('build:withCodeCoverageLogging', [
|
||||
'jsx:normal',
|
||||
'version-check',
|
||||
@@ -132,15 +98,8 @@ module.exports = function(grunt) {
|
||||
'version-check',
|
||||
'populist:test'
|
||||
]);
|
||||
grunt.registerTask('build:npm-react', [
|
||||
'version-check',
|
||||
'jsx:normal',
|
||||
'npm-react:release'
|
||||
]);
|
||||
grunt.registerTask('build:gem-react-source', [
|
||||
'build',
|
||||
'gem-react-source:release'
|
||||
]);
|
||||
grunt.registerTask('build:npm-react', ['version-check', 'jsx:normal', 'npm-react:release']);
|
||||
grunt.registerTask('build:gem-react-source', ['build', 'gem-react-source:release'])
|
||||
|
||||
grunt.registerTask('webdriver-phantomjs', webdriverPhantomJSTask);
|
||||
|
||||
@@ -183,7 +142,7 @@ module.exports = function(grunt) {
|
||||
'webdriver-perf:saucelabs_firefox',
|
||||
'webdriver-perf:saucelabs_chrome',
|
||||
'webdriver-perf:saucelabs_ie11',
|
||||
'webdriver-perf:saucelabs_ie8'
|
||||
'webdriver-perf:saucelabs_ie8',
|
||||
]);
|
||||
|
||||
grunt.registerTask('test:webdriver:saucelabs', [
|
||||
@@ -268,6 +227,7 @@ module.exports = function(grunt) {
|
||||
'npm-react:pack',
|
||||
'npm-react-tools:release',
|
||||
'npm-react-tools:pack',
|
||||
'copy:react_docs',
|
||||
'compare_size'
|
||||
]);
|
||||
|
||||
|
||||
2
LICENSE
2
LICENSE
@@ -2,7 +2,7 @@ BSD License
|
||||
|
||||
For React software
|
||||
|
||||
Copyright (c) 2013-2015, Facebook, Inc.
|
||||
Copyright (c) 2013-2014, Facebook, Inc.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
|
||||
46
PATENTS
46
PATENTS
@@ -1,33 +1,23 @@
|
||||
Additional Grant of Patent Rights Version 2
|
||||
Additional Grant of Patent Rights
|
||||
|
||||
"Software" means the React software distributed by Facebook, Inc.
|
||||
|
||||
Facebook, Inc. ("Facebook") hereby grants to each recipient of the Software
|
||||
("you") a perpetual, worldwide, royalty-free, non-exclusive, irrevocable
|
||||
(subject to the termination provision below) license under any Necessary
|
||||
Claims, to make, have made, use, sell, offer to sell, import, and otherwise
|
||||
transfer the Software. For avoidance of doubt, no license is granted under
|
||||
Facebook's rights in any patent claims that are infringed by (i) modifications
|
||||
to the Software made by you or any third party or (ii) the Software in
|
||||
combination with any software or other technology.
|
||||
Facebook hereby grants you a perpetual, worldwide, royalty-free, non-exclusive,
|
||||
irrevocable (subject to the termination provision below) license under any
|
||||
rights in any patent claims owned by Facebook, to make, have made, use, sell,
|
||||
offer to sell, import, and otherwise transfer the Software. For avoidance of
|
||||
doubt, no license is granted under Facebook’s rights in any patent claims that
|
||||
are infringed by (i) modifications to the Software made by you or a third party,
|
||||
or (ii) the Software in combination with any software or other technology
|
||||
provided by you or a third party.
|
||||
|
||||
The license granted hereunder will terminate, automatically and without notice,
|
||||
if you (or any of your subsidiaries, corporate affiliates or agents) initiate
|
||||
directly or indirectly, or take a direct financial interest in, any Patent
|
||||
Assertion: (i) against Facebook or any of its subsidiaries or corporate
|
||||
affiliates, (ii) against any party if such Patent Assertion arises in whole or
|
||||
in part from any software, technology, product or service of Facebook or any of
|
||||
its subsidiaries or corporate affiliates, or (iii) against any party relating
|
||||
to the Software. Notwithstanding the foregoing, if Facebook or any of its
|
||||
subsidiaries or corporate affiliates files a lawsuit alleging patent
|
||||
infringement against you in the first instance, and you respond by filing a
|
||||
patent infringement counterclaim in that lawsuit against that party that is
|
||||
unrelated to the Software, the license granted hereunder will not terminate
|
||||
under section (i) of this paragraph due to such counterclaim.
|
||||
|
||||
A "Necessary Claim" is a claim of a patent owned by Facebook that is
|
||||
necessarily infringed by the Software standing alone.
|
||||
|
||||
A "Patent Assertion" is any lawsuit or other action alleging direct, indirect,
|
||||
or contributory infringement or inducement to infringe any patent, including a
|
||||
cross-claim or counterclaim.
|
||||
for anyone that makes any claim (including by filing any lawsuit, assertion or
|
||||
other action) alleging (a) direct, indirect, or contributory infringement or
|
||||
inducement to infringe any patent: (i) by Facebook or any of its subsidiaries or
|
||||
affiliates, whether or not such claim is related to the Software, (ii) by any
|
||||
party if such claim arises in whole or in part from any software, product or
|
||||
service of Facebook or any of its subsidiaries or affiliates, whether or not
|
||||
such claim is related to the Software, or (iii) by any party relating to the
|
||||
Software; or (b) that any right in any patent claim of Facebook is invalid or
|
||||
unenforceable.
|
||||
|
||||
20
README.md
20
README.md
@@ -1,18 +1,16 @@
|
||||
# [React](https://facebook.github.io/react/) [](https://travis-ci.org/facebook/react)
|
||||
# [React](http://facebook.github.io/react) [](https://travis-ci.org/facebook/react)
|
||||
|
||||
React is a JavaScript library for building user interfaces.
|
||||
|
||||
* **Just the UI:** Lots of people use React as the V in MVC. Since React makes no assumptions about the rest of your technology stack, it's easy to try it out on a small feature in an existing project.
|
||||
* **Virtual DOM:** React abstracts away the DOM from you, giving a simpler programming model and better performance. React can also render on the server using Node, and it can power native apps using [React Native](https://facebook.github.io/react-native/).
|
||||
* **Virtual DOM:** React uses a *virtual DOM* diff implementation for ultra-high performance. It can also render on the server using Node.js — no heavy browser DOM required.
|
||||
* **Data flow:** React implements one-way reactive data flow which reduces boilerplate and is easier to reason about than traditional data binding.
|
||||
|
||||
**NEW**! Check out our newest project [React Native](https://github.com/facebook/react-native), which uses React and JavaScript to create native mobile apps.
|
||||
|
||||
[Learn how to use React in your own project.](https://facebook.github.io/react/docs/getting-started.html).
|
||||
[Learn how to use React in your own project.](http://facebook.github.io/react/docs/getting-started.html)
|
||||
|
||||
## Examples
|
||||
|
||||
We have several examples [on the website](https://facebook.github.io/react/). Here is the first one to get you started:
|
||||
We have several examples [on the website](http://facebook.github.io/react/). Here is the first one to get you started:
|
||||
|
||||
```js
|
||||
var HelloMessage = React.createClass({
|
||||
@@ -29,7 +27,7 @@ React.render(
|
||||
|
||||
This example will render "Hello John" into a container on the page.
|
||||
|
||||
You'll notice that we used an HTML-like syntax; [we call it JSX](https://facebook.github.io/react/docs/jsx-in-depth.html). JSX is not required to use React, but it makes code more readable, and writing it feels like writing HTML. A simple transform is included with React that allows converting JSX into native JavaScript for browsers to digest.
|
||||
You'll notice that we used an HTML-like syntax; [we call it JSX](http://facebook.github.io/react/docs/jsx-in-depth.html). JSX is not required to use React, but it makes code more readable, and writing it feels like writing HTML. A simple transform is included with React that allows converting JSX into native JavaScript for browsers to digest.
|
||||
|
||||
## Installation
|
||||
|
||||
@@ -37,12 +35,12 @@ The fastest way to get started is to serve JavaScript from the CDN (also availab
|
||||
|
||||
```html
|
||||
<!-- The core React library -->
|
||||
<script src="https://fb.me/react-0.13.3.js"></script>
|
||||
<script src="http://fb.me/react-0.12.2.js"></script>
|
||||
<!-- In-browser JSX transformer, remove when pre-compiling JSX. -->
|
||||
<script src="https://fb.me/JSXTransformer-0.13.3.js"></script>
|
||||
<script src="http://fb.me/JSXTransformer-0.12.2.js"></script>
|
||||
```
|
||||
|
||||
We've also built a [starter kit](https://facebook.github.io/react/downloads/react-0.13.3.zip) which might be useful if this is your first time using React. It includes a webpage with an example of using React with live code.
|
||||
We've also built a [starter kit](http://facebook.github.io/react/downloads/react-0.12.2.zip) which might be useful if this is your first time using React. It includes a webpage with an example of using React with live code.
|
||||
|
||||
If you'd like to use [bower](http://bower.io), it's as easy as:
|
||||
|
||||
@@ -88,7 +86,7 @@ grunt test
|
||||
grunt test --debug
|
||||
# For speed, you can use fasttest and add --filter to only run one test
|
||||
grunt fasttest --filter=ReactIdentity
|
||||
# Lint the code with ESLint
|
||||
# Lint the code with JSHint
|
||||
grunt lint
|
||||
# Wipe out build directory
|
||||
grunt clean
|
||||
|
||||
27
bin/jsx
27
bin/jsx
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env node
|
||||
// -*- mode: js -*-
|
||||
'use strict';
|
||||
"use strict";
|
||||
|
||||
var transform = require('../main').transform;
|
||||
|
||||
@@ -11,41 +11,18 @@ require('commoner').version(
|
||||
}).option(
|
||||
'--harmony',
|
||||
'Turns on JS transformations such as ES6 Classes etc.'
|
||||
).option(
|
||||
'--target [version]',
|
||||
'Specify your target version of ECMAScript. Valid values are "es3" and ' +
|
||||
'"es5". The default is "es5". "es3" will avoid uses of defineProperty and ' +
|
||||
'will quote reserved words. WARNING: "es5" is not properly supported, even ' +
|
||||
'with the use of es5shim, es5sham. If you need to support IE8, use "es3".',
|
||||
'es5'
|
||||
).option(
|
||||
'--strip-types',
|
||||
'Strips out type annotations.'
|
||||
).option(
|
||||
'--es6module',
|
||||
'Parses the file as a valid ES6 module. ' +
|
||||
'(Note that this means implicit strict mode)'
|
||||
).option(
|
||||
'--non-strict-es6module',
|
||||
'Parses the file as an ES6 module, except disables implicit strict-mode. ' +
|
||||
'(This is useful if you\'re porting non-ES6 modules to ES6, but haven\'t ' +
|
||||
'yet verified that they are strict-mode safe yet)'
|
||||
).option(
|
||||
'--source-map-inline',
|
||||
'Embed inline sourcemap in transformed source'
|
||||
).process(function(id, source) {
|
||||
// This is where JSX, ES6, etc. desugaring happens.
|
||||
// We don't do any pre-processing of options so that the command line and the
|
||||
// JS API both expose the same set of options. We do extract the options that
|
||||
// we care about from commoner though so we aren't passing too many things
|
||||
// along.
|
||||
var options = {
|
||||
harmony: this.options.harmony,
|
||||
sourceMap: this.options.sourceMapInline,
|
||||
stripTypes: this.options.stripTypes,
|
||||
es6module: this.options.es6module,
|
||||
nonStrictEs6module: this.options.nonStrictEs6module,
|
||||
target: this.options.target
|
||||
stripTypes: this.options.stripTypes
|
||||
};
|
||||
return transform(source, options);
|
||||
});
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
// -*- mode: js -*-
|
||||
"use strict";
|
||||
|
||||
var transform = require('../main').transform;
|
||||
var getAllVisitors = require('../vendor/fbtransform/visitors').getAllVisitors;
|
||||
var transform = require('jstransform').transform;
|
||||
var propagate = require("../vendor/constants").propagate;
|
||||
|
||||
require("commoner").version(
|
||||
@@ -30,7 +31,7 @@ require("commoner").version(
|
||||
var constants = context.config.constants || {};
|
||||
|
||||
// This is where JSX, ES6, etc. desugaring happens.
|
||||
source = transform(source, {harmony: true, stripTypes: true});
|
||||
source = transform(getAllVisitors(), source).code;
|
||||
|
||||
// Constant propagation means removing any obviously dead code after
|
||||
// replacing constant expressions with literal (boolean) values.
|
||||
|
||||
@@ -80,6 +80,3 @@ DEPENDENCIES
|
||||
rake
|
||||
rb-fsevent
|
||||
sanitize (~> 2.0)
|
||||
|
||||
BUNDLED WITH
|
||||
1.10.1
|
||||
|
||||
@@ -52,7 +52,7 @@ $ bundle exec rake watch # Automatically compiles as needed.
|
||||
|
||||
### Updating `facebook.github.io/react`
|
||||
|
||||
The easiest way to do this is to have a separate clone of this repository, checked out to the `gh-pages` branch. We have a build step that expects this to be in a directory named `react-gh-pages` at the same depth as `react`. Then it's just a matter of running `grunt docs`, which will compile the site and copy it out to this repository. From there, you can check it in.
|
||||
The easiest way to do this is to have a separate clone of this repository, checked out to the `gh-pages` branch. We have a build step that expects this to be in a directory named `react-gh-pages` at the same depth as `react`. Then it's just a matter of running `grunt docs`, which will compile the site and copy it out to this repository. From there you can check it in.
|
||||
|
||||
**Note:** This should only be done for new releases. You should create a tag corresponding to the release tag in the main repository.
|
||||
|
||||
|
||||
@@ -4,8 +4,7 @@ require('yaml')
|
||||
|
||||
desc "generate js from jsx"
|
||||
task :js do
|
||||
system "cp ../node_modules/babel/node_modules/babel-core/browser.min.js ./js/babel-browser.min.js"
|
||||
system "../node_modules/.bin/babel _js --out-dir=js"
|
||||
system "../bin/jsx --harmony _js js"
|
||||
end
|
||||
|
||||
desc "watch js"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
name: React
|
||||
description: A JavaScript library for building user interfaces
|
||||
url: https://facebook.github.io
|
||||
url: http://facebook.github.io
|
||||
baseurl: "/react"
|
||||
permalink: "/blog/:year/:month/:day/:title.html"
|
||||
paginate_path: "/blog/page:num/"
|
||||
@@ -25,15 +25,13 @@ exclude:
|
||||
- Gemfile.lock
|
||||
- README.md
|
||||
- Rakefile
|
||||
- vendor/bundle
|
||||
markdown: redcarpet
|
||||
redcarpet:
|
||||
extensions:
|
||||
- fenced_code_blocks
|
||||
- footnotes
|
||||
sass:
|
||||
style: :compressed
|
||||
sass_dir: _css
|
||||
gems:
|
||||
- jekyll-redirect-from
|
||||
react_version: 0.13.3
|
||||
react_version: 0.12.2
|
||||
|
||||
@@ -68,7 +68,7 @@ h3 {
|
||||
}
|
||||
|
||||
h4 {
|
||||
font-size: 16px;
|
||||
font-size: 17px;
|
||||
}
|
||||
|
||||
h5 {
|
||||
|
||||
@@ -1,64 +1,40 @@
|
||||
---
|
||||
- - Aaron Franks
|
||||
- Adam Krebs
|
||||
- - Adam Krebs
|
||||
- Adam Mark
|
||||
- Adam Solove
|
||||
- Alan deLevie
|
||||
- Alex Boyd
|
||||
- Alex Mykyta
|
||||
- Alex Zelenskiy
|
||||
- Alexander Solovyov
|
||||
- Alexander Tseung
|
||||
- Alexandre Gaudencio
|
||||
- Alexey Raspopov
|
||||
- Alexey Shamrin
|
||||
- Andre Z Sanchez
|
||||
- Andreas Svensson
|
||||
- Andres Suarez
|
||||
- Andrew Cobby
|
||||
- Andrew Davey
|
||||
- Andrew Rasmussen
|
||||
- Andrew Zich
|
||||
- Andrey Popp
|
||||
- Anthony van der Hoorn
|
||||
- Antti Ahti
|
||||
- Areeb Malik
|
||||
- Aria Buckles
|
||||
- Artem Nezvigin
|
||||
- Ayman Osman
|
||||
- Bartosz Kaszubowski
|
||||
- Beau Smith
|
||||
- Ben Alpert
|
||||
- Ben Foxall
|
||||
- Ben Newman
|
||||
- Ben Ripkens
|
||||
- Benjamin Keen
|
||||
- Benjamin Leiken
|
||||
- Bill Fisher
|
||||
- Blaine Hatab
|
||||
- Bob Eagan
|
||||
- Bob Ralian
|
||||
- Bojan Mihelac
|
||||
- Brandon Bloom
|
||||
- Brandon Tilley
|
||||
- Brian Cooke
|
||||
- Brian Holt
|
||||
- Brian Hsu
|
||||
- Brian Kim
|
||||
- Brian Kung
|
||||
- Brian Reavis
|
||||
- Brian Rue
|
||||
- Bruno Škvorc
|
||||
- Cam Song
|
||||
- Cam Spiers
|
||||
- Cassus Adam Banko
|
||||
- Cat Chen
|
||||
- Cedric Sohrauer
|
||||
- Charles Marsh
|
||||
- Cheng Lou
|
||||
- Chitharanjan Das
|
||||
- Chris Sciolla
|
||||
- Christian
|
||||
- Christian Alfoni
|
||||
- Christian Roman
|
||||
- Christoph Pojer
|
||||
@@ -67,26 +43,19 @@
|
||||
- Connor McSheffrey
|
||||
- Cotton Hou
|
||||
- Dan Abramov
|
||||
- Dan Fox
|
||||
- Dan Schafer
|
||||
- Daniel Carlsson
|
||||
- Daniel Gasienica
|
||||
- Daniel Lo Nigro
|
||||
- Daniel Mané
|
||||
- Daniel Miladinov
|
||||
- Daniel Schonfeld
|
||||
- Danny Ben-David
|
||||
- Daryl Lau
|
||||
- David Hellsing
|
||||
- David Hu
|
||||
- Denis Sokolov
|
||||
- Dennis Johnson
|
||||
- Devon Blandin
|
||||
- Dmitrii Abramov
|
||||
- Dmitry Mazuro
|
||||
- Dustan Kasten
|
||||
- Dustin Getz
|
||||
- Dylan Harrington
|
||||
- Enguerran
|
||||
- Eric Clemmons
|
||||
- Eric Florenzano
|
||||
@@ -100,8 +69,6 @@
|
||||
- François-Xavier Bois
|
||||
- Fred Zhao
|
||||
- G Scott Olson
|
||||
- G. Kay Lee
|
||||
- Gabe Levi
|
||||
- Garren Smith
|
||||
- Geert Pasteels
|
||||
- Geert-Jan Brits
|
||||
@@ -113,20 +80,14 @@
|
||||
- Guangqiang Dong
|
||||
- Guido Bouman
|
||||
- Harry Hull
|
||||
- Harry Marr
|
||||
- - Harry Moreno
|
||||
- Harshad Sabne
|
||||
- - Harshad Sabne
|
||||
- Hendrik Swanepoel
|
||||
- Henry Zhu
|
||||
- Hou Chia
|
||||
- Hugo Jobling
|
||||
- Héliton Nordt
|
||||
- Ian Obermiller
|
||||
- Ingvar Stepanyan
|
||||
- Irae Carvalho
|
||||
- Isaac Salier-Hellendag
|
||||
- Ivan Kozik
|
||||
- Ivan Krechetov
|
||||
- Ivan Vergiliev
|
||||
- Jacob Gable
|
||||
- Jacob Greenleaf
|
||||
@@ -141,30 +102,24 @@
|
||||
- Jan Kassens
|
||||
- Jared Forsyth
|
||||
- Jason Bonta
|
||||
- Jason Ly
|
||||
- Jason Trill
|
||||
- Jean Lauliac
|
||||
- Jed Watson
|
||||
- Jeff Barczewski
|
||||
- Jeff Carpenter
|
||||
- Jeff Chan
|
||||
- Jeff Kolesky
|
||||
- Jeff Morrison
|
||||
- Jeff Welch
|
||||
- Jeffrey Lin
|
||||
- Jesse Skinner
|
||||
- Jignesh Kakadiya
|
||||
- Jim OBrien
|
||||
- Jim Sproch
|
||||
- Jimmy Jea
|
||||
- Jing Chen
|
||||
- Joel Auterson
|
||||
- Johannes Baiter
|
||||
- Johannes Emerich
|
||||
- John Heroy
|
||||
- John Watson
|
||||
- Jon Beebe
|
||||
- Jon Madison
|
||||
- Jonas Enlund
|
||||
- Jonas Gebhardt
|
||||
- Jonathan Hsu
|
||||
@@ -172,29 +127,20 @@
|
||||
- Josh Bassett
|
||||
- Josh Duck
|
||||
- Josh Yudaken
|
||||
- Joshua Goldberg
|
||||
- Joshua Ma
|
||||
- João Valente
|
||||
- Juan Serrano
|
||||
- Julen Ruiz Aizpuru
|
||||
- Julien Bordellier
|
||||
- Jun Wu
|
||||
- Juraj Dudak
|
||||
- Justin Jaffray
|
||||
- Justin Woo
|
||||
- Karl Mikkelsen
|
||||
- Karpich Dmitry
|
||||
- Keito Uchiyama
|
||||
- Kevin Old
|
||||
- Kirk Steven Hansen
|
||||
- Kit Randel
|
||||
- Kunal Mehta
|
||||
- Kurt Ruppel
|
||||
- Kyle Mathews
|
||||
- Laurence Rowe
|
||||
- Lee Byron
|
||||
- Lei
|
||||
- Leon Fedotov
|
||||
- Levi McCallum
|
||||
- Lily
|
||||
- Logan Allen
|
||||
@@ -203,33 +149,23 @@
|
||||
- Marcin Szczepanski
|
||||
- Mariano Desanze
|
||||
- Mark Anderson
|
||||
- Mark Funk
|
||||
- Mark Hintz
|
||||
- Mark IJbema
|
||||
- Mark Richardson
|
||||
- Marlon Landaverde
|
||||
- Marshall Roch
|
||||
- Martin Andert
|
||||
- Martin Jul
|
||||
- Martin Konicek
|
||||
- Mathieu M-Gosselin
|
||||
- Matias Singers
|
||||
- Matt Harrison
|
||||
- Matt Huggins
|
||||
- Matt Zabriskie
|
||||
- Matthew Dapena-Tretter
|
||||
- Matthew Johnston
|
||||
- Matti Nelimarkka
|
||||
- Max F. Albrecht
|
||||
- Michael Chan
|
||||
- Michael Randers-Pehrson
|
||||
- - Michael Randers-Pehrson
|
||||
- Michal Srb
|
||||
- Michelle Todd
|
||||
- Mihai Parparita
|
||||
- Mike D Pilsbury
|
||||
- Minwe LUO
|
||||
- Miorel Palii
|
||||
- - Mouad Debbar
|
||||
- Mouad Debbar
|
||||
- Nadeesha Cabral
|
||||
- Naman Goel
|
||||
- Nate Hunzaker
|
||||
@@ -238,70 +174,45 @@
|
||||
- Nick Fitzgerald
|
||||
- Nick Gavalas
|
||||
- Nick Merwin
|
||||
- Nick Raienko
|
||||
- Nick Thompson
|
||||
- Nick Williams
|
||||
- Niklas Boström
|
||||
- Oiva Eskola
|
||||
- Oleg
|
||||
- Oleksii Markhovskyi
|
||||
- Oliver Zeigermann
|
||||
- Owen Coutts
|
||||
- Pablo Lacerda de Miranda
|
||||
- Pascal Hartig
|
||||
- Patrick Laughlin
|
||||
- Paul O’Shannessy
|
||||
- Paul Seiffert
|
||||
- Paul Shen
|
||||
- Pedro Nauck
|
||||
- Pete Hunt
|
||||
- Peter Blazejewicz
|
||||
- Peter Cottle
|
||||
- Peter Jaros
|
||||
- Petri Lehtinen
|
||||
- Petri Lievonen
|
||||
- Pieter Vanderwerff
|
||||
- Pouja Nikray
|
||||
- Preston Parry
|
||||
- Rafael
|
||||
- Rafal Dittwald
|
||||
- Rajiv Tirumalareddy
|
||||
- Randall Randall
|
||||
- Ray
|
||||
- Raymond Ha
|
||||
- Richard D. Worth
|
||||
- Richard Feldman
|
||||
- Richard Kho
|
||||
- Richard Littauer
|
||||
- Richard Livesey
|
||||
- Rick Beerendonk
|
||||
- Riley Tomasek
|
||||
- Rob Arnold
|
||||
- Robert Sedovsek
|
||||
- Roman Vanesyan
|
||||
- Ryan Seddon
|
||||
- Sahat Yalkabov
|
||||
- Sam Saccone
|
||||
- Sam Selikoff
|
||||
- Sander Spies
|
||||
- Scott Feeney
|
||||
- Sean Kinsey
|
||||
- Sebastian Markbåge
|
||||
- Sergey Generalov
|
||||
- Sergey Rubanov
|
||||
- Shane O'Sullivan
|
||||
- Shaun Trennery
|
||||
- Sheraz
|
||||
- ShihChi Huang
|
||||
- Shripad K
|
||||
- Simon Højberg
|
||||
- Simon Welsh
|
||||
- Sophia Westwood
|
||||
- Spencer Handley
|
||||
- Stefan Dombrowski
|
||||
- Stephen Murphy
|
||||
- Steve Baker
|
||||
- Steven Luscher
|
||||
- Stoyan Stefanov
|
||||
- Sundeep Malladi
|
||||
- Sunny Juneja
|
||||
@@ -312,33 +223,22 @@
|
||||
- Thomas Shaddox
|
||||
- Thomas Shafer
|
||||
- ThomasCrvsr
|
||||
- Tienchai Wirojsaksaree
|
||||
- Tim Schaub
|
||||
- Timothy Yung
|
||||
- Tom Haggie
|
||||
- Tom Hauburger
|
||||
- Tom MacWright
|
||||
- Tom Occhino
|
||||
- Toru Kobayashi
|
||||
- Ville Immonen
|
||||
- Vincent Riemer
|
||||
- Vincent Siao
|
||||
- Vjeux
|
||||
- Volkan Unsal
|
||||
- Wayne Larsen
|
||||
- WickyNilliams
|
||||
- Wincent Colaiuta
|
||||
- Wout Mertens
|
||||
- XuefengWu
|
||||
- YouBao Nong
|
||||
- Yuriy Dybskiy
|
||||
- Yuval Dekel
|
||||
- Zach Bruggeman
|
||||
- Zacharias
|
||||
- brafdlog
|
||||
- chen
|
||||
- cutbko
|
||||
- davidxi
|
||||
- imagentleman
|
||||
- "Árni Hermann Reynisson"
|
||||
- "张敏"
|
||||
- jon madison
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
# Map of short name to more information. `name` will be used but if you don't
|
||||
# want to use your real name, just use whatever. If url is included, your name
|
||||
# will be a link to the provided url.
|
||||
billandjing:
|
||||
name: Bill Fisher and Jing Chen
|
||||
chenglou:
|
||||
name: Cheng Lou
|
||||
url: https://twitter.com/_chenglou
|
||||
Daniel15:
|
||||
name: Daniel Lo Nigro
|
||||
url: http://dan.cx/
|
||||
fisherwebdev:
|
||||
name: Bill Fisher
|
||||
url: https://twitter.com/fisherwebdev
|
||||
jaredly:
|
||||
name: Jared Forsyth
|
||||
url: https://twitter.com/jaredforsyth
|
||||
jgebhardt:
|
||||
name: Jonas Gebhardt
|
||||
url: https://twitter.com/jonasgebhardt
|
||||
jimandsebastian:
|
||||
name: Jim Sproch and Sebastian Markbåge
|
||||
josephsavona:
|
||||
name: Joseph Savona
|
||||
url: https://twitter.com/en_JS
|
||||
kmeht:
|
||||
name: Kunal Mehta
|
||||
url: https://github.com/kmeht
|
||||
LoukaN:
|
||||
name: Lou Husson
|
||||
url: https://twitter.com/loukan42
|
||||
matthewjohnston4:
|
||||
name: Matthew Johnston
|
||||
url: https://github.com/matthewathome
|
||||
petehunt:
|
||||
name: Pete Hunt
|
||||
url: https://twitter.com/floydophone
|
||||
schrockn:
|
||||
name: Nick Schrock
|
||||
url: https://twitter.com/schrockn
|
||||
sebmarkbage:
|
||||
name: Sebastian Markbåge
|
||||
url: https://twitter.com/sebmarkbage
|
||||
spicyj:
|
||||
name: Ben Alpert
|
||||
url: http://benalpert.com
|
||||
steveluscher:
|
||||
name: Steven Luscher
|
||||
url: https://twitter.com/steveluscher
|
||||
vjeux:
|
||||
name: Vjeux
|
||||
url: https://twitter.com/vjeux
|
||||
wincent:
|
||||
name: Greg Hurrell
|
||||
url: https://twitter.com/wincent
|
||||
zpao:
|
||||
name: Paul O’Shannessy
|
||||
url: https://twitter.com/zpao
|
||||
@@ -8,8 +8,6 @@
|
||||
title: Thinking in React
|
||||
- title: Community Resources
|
||||
items:
|
||||
- id: conferences
|
||||
title: Conferences
|
||||
- id: videos
|
||||
title: Videos
|
||||
- id: complementary-tools
|
||||
@@ -58,9 +56,7 @@
|
||||
- id: test-utils
|
||||
title: Test Utilities
|
||||
- id: clone-with-props
|
||||
title: Cloning Elements
|
||||
- id: create-fragment
|
||||
title: Keyed Fragments
|
||||
title: Cloning Components
|
||||
- id: update
|
||||
title: Immutability Helpers
|
||||
- id: pure-render-mixin
|
||||
@@ -93,7 +89,7 @@
|
||||
items:
|
||||
- id: flux-overview
|
||||
title: Flux Overview
|
||||
href: https://facebook.github.io/flux/docs/overview.html
|
||||
href: http://facebook.github.io/flux/docs/overview.html
|
||||
- id: flux-todo-list
|
||||
title: Flux TodoMVC Tutorial
|
||||
href: https://facebook.github.io/flux/docs/todo-list.html
|
||||
href: http://facebook.github.io/flux/docs/todo-list.html
|
||||
|
||||
@@ -36,5 +36,3 @@
|
||||
title: this.props.children undefined
|
||||
- id: use-react-with-other-libraries
|
||||
title: Use React with Other Libraries
|
||||
- id: dangerously-set-inner-html
|
||||
title: Dangerously Set innerHTML
|
||||
|
||||
@@ -1,30 +1,10 @@
|
||||
{% assign page = include.page %}
|
||||
{% assign author = site.data.authors[page.author] %}
|
||||
<h1><a href="/react{{ page.url }}">{{ page.title }}</a></h1>
|
||||
<p class="meta">{{ page.date | date_to_string }} by {{ page.author }}</p>
|
||||
|
||||
<h1>
|
||||
{% if include.isPermalink %}
|
||||
{{ page.title }}
|
||||
<div id="post">
|
||||
{% if content != '' %}
|
||||
{{ page.excerpt }}
|
||||
{% else %}
|
||||
<a href="/react{{ page.url }}">{{ page.title }}</a>
|
||||
{{ page.content }}
|
||||
{% endif %}
|
||||
</h1>
|
||||
|
||||
<p class="meta">
|
||||
{{ page.date | date: "%B %e, %Y" }}
|
||||
by
|
||||
{% if author.url %}
|
||||
<a href="{{author.url}}">{{ author.name }}</a>
|
||||
{% else %}
|
||||
{{ author.name }}
|
||||
{% endif %}
|
||||
</p>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="post">
|
||||
{{ include.content }}
|
||||
</div>
|
||||
|
||||
{% if include.isPermalink %}
|
||||
<div class="fb-like" data-send="true" data-width="650" data-show-faces="false"></div>
|
||||
{% endif %}
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
rules:
|
||||
block-scoped-var: false
|
||||
no-undef: false
|
||||
@@ -1,13 +1,12 @@
|
||||
var MARKDOWN_COMPONENT = `
|
||||
var converter = new Showdown.converter();
|
||||
|
||||
var MarkdownEditor = React.createClass({
|
||||
getInitialState: function() {
|
||||
return {value: 'Type some *markdown* here!'};
|
||||
},
|
||||
handleChange: function() {
|
||||
this.setState({value: React.findDOMNode(this.refs.textarea).value});
|
||||
},
|
||||
rawMarkup: function() {
|
||||
return { __html: marked(this.state.value, {sanitize: true}) };
|
||||
this.setState({value: this.refs.textarea.getDOMNode().value});
|
||||
},
|
||||
render: function() {
|
||||
return (
|
||||
@@ -20,7 +19,9 @@ var MarkdownEditor = React.createClass({
|
||||
<h3>Output</h3>
|
||||
<div
|
||||
className="content"
|
||||
dangerouslySetInnerHTML={this.rawMarkup()}
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: converter.makeHtml(this.state.value)
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
var TODO_COMPONENT = `
|
||||
var TodoList = React.createClass({
|
||||
render: function() {
|
||||
var createItem = function(itemText, index) {
|
||||
return <li key={index + itemText}>{itemText}</li>;
|
||||
var createItem = function(itemText) {
|
||||
return <li>{itemText}</li>;
|
||||
};
|
||||
return <ul>{this.props.items.map(createItem)}</ul>;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright 2013-2015, Facebook, Inc.
|
||||
* Copyright 2013-2014, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
|
||||
45
docs/_js/jsx-compiler.js
Normal file
45
docs/_js/jsx-compiler.js
Normal file
@@ -0,0 +1,45 @@
|
||||
var HELLO_COMPONENT = "\
|
||||
var HelloMessage = React.createClass({\n\
|
||||
render: function() {\n\
|
||||
return <div>Hello {this.props.name}</div>;\n\
|
||||
}\n\
|
||||
});\n\
|
||||
\n\
|
||||
React.render(<HelloMessage name=\"John\" />, mountNode);\
|
||||
";
|
||||
|
||||
function transformer(harmony, code) {
|
||||
return JSXTransformer.transform(code, {harmony: harmony}).code;
|
||||
}
|
||||
|
||||
var CompilerPlayground = React.createClass({
|
||||
getInitialState: function() {
|
||||
return {harmony: false};
|
||||
},
|
||||
handleHarmonyChange: function(e) {
|
||||
this.setState({harmony: e.target.checked});
|
||||
},
|
||||
render: function() {
|
||||
return (
|
||||
<div>
|
||||
<ReactPlayground
|
||||
codeText={HELLO_COMPONENT}
|
||||
renderCode={true}
|
||||
transformer={transformer.bind(null, this.state.harmony)}
|
||||
showCompiledJSTab={false}
|
||||
/>
|
||||
<label className="compiler-option">
|
||||
<input
|
||||
type="checkbox"
|
||||
onChange={this.handleHarmonyChange}
|
||||
checked={this.state.harmony} />{' '}
|
||||
Enable ES6 transforms (<code>--harmony</code>)
|
||||
</label>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
});
|
||||
React.render(
|
||||
<CompilerPlayground />,
|
||||
document.getElementById('jsxCompiler')
|
||||
);
|
||||
@@ -9,21 +9,12 @@ var IS_MOBILE = (
|
||||
);
|
||||
|
||||
var CodeMirrorEditor = React.createClass({
|
||||
propTypes: {
|
||||
lineNumbers: React.PropTypes.bool,
|
||||
onChange: React.PropTypes.func
|
||||
},
|
||||
getDefaultProps: function() {
|
||||
return {
|
||||
lineNumbers: false
|
||||
};
|
||||
},
|
||||
componentDidMount: function() {
|
||||
if (IS_MOBILE) return;
|
||||
|
||||
this.editor = CodeMirror.fromTextArea(React.findDOMNode(this.refs.editor), {
|
||||
this.editor = CodeMirror.fromTextArea(this.refs.editor.getDOMNode(), {
|
||||
mode: 'javascript',
|
||||
lineNumbers: this.props.lineNumbers,
|
||||
lineNumbers: false,
|
||||
lineWrapping: true,
|
||||
smartIndent: false, // javascript mode does bad things with jsx indents
|
||||
matchBrackets: true,
|
||||
@@ -84,18 +75,16 @@ var ReactPlayground = React.createClass({
|
||||
transformer: React.PropTypes.func,
|
||||
renderCode: React.PropTypes.bool,
|
||||
showCompiledJSTab: React.PropTypes.bool,
|
||||
showLineNumbers: React.PropTypes.bool,
|
||||
editorTabTitle: React.PropTypes.string
|
||||
},
|
||||
|
||||
getDefaultProps: function() {
|
||||
return {
|
||||
transformer: function(code) {
|
||||
return babel.transform(code).code;
|
||||
return JSXTransformer.transform(code).code;
|
||||
},
|
||||
editorTabTitle: 'Live JSX Editor',
|
||||
showCompiledJSTab: true,
|
||||
showLineNumbers: false
|
||||
showCompiledJSTab: true
|
||||
};
|
||||
},
|
||||
|
||||
@@ -133,7 +122,6 @@ var ReactPlayground = React.createClass({
|
||||
onChange={this.handleCodeChange}
|
||||
codeText={compiledCode}
|
||||
readOnly={true}
|
||||
lineNumbers={this.props.showLineNumbers}
|
||||
/>;
|
||||
|
||||
var JSXContent =
|
||||
@@ -142,7 +130,6 @@ var ReactPlayground = React.createClass({
|
||||
onChange={this.handleCodeChange}
|
||||
className="playgroundStage"
|
||||
codeText={this.state.code}
|
||||
lineNumbers={this.props.showLineNumbers}
|
||||
/>;
|
||||
|
||||
var JSXTabClassName =
|
||||
@@ -194,7 +181,7 @@ var ReactPlayground = React.createClass({
|
||||
},
|
||||
|
||||
executeCode: function() {
|
||||
var mountNode = React.findDOMNode(this.refs.mount);
|
||||
var mountNode = this.refs.mount.getDOMNode();
|
||||
|
||||
try {
|
||||
React.unmountComponentAtNode(mountNode);
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
<meta name="viewport" content="width=device-width">
|
||||
<meta property="og:title" content="{{ page.title }} | React">
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:url" content="https://facebook.github.io/react{{ page.url }}">
|
||||
<meta property="og:image" content="https://facebook.github.io/react/img/logo_og.png">
|
||||
<meta property="og:url" content="http://facebook.github.io/react{{ page.url }}">
|
||||
<meta property="og:image" content="http://facebook.github.io/react/img/logo_og.png">
|
||||
<meta property="og:description" content="A JavaScript library for building user interfaces">
|
||||
<meta property="fb:app_id" content="623268441017527">
|
||||
|
||||
@@ -28,11 +28,12 @@
|
||||
<script type="text/javascript" src="/react/js/es5-shim.min.js"></script>
|
||||
<script type="text/javascript" src="/react/js/es5-sham.min.js"></script>
|
||||
<![endif]-->
|
||||
<script type="text/javascript" src="/react/js/babel-browser.min.js"></script>
|
||||
<script type="text/javascript" src="/react/js/codemirror.js"></script>
|
||||
<script type="text/javascript" src="/react/js/javascript.js"></script>
|
||||
<script type="text/javascript" src="/react/js/react.js"></script>
|
||||
<script type="text/javascript" src="/react/js/JSXTransformer.js"></script>
|
||||
<script type="text/javascript" src="/react/js/live_editor.js"></script>
|
||||
<script type="text/javascript" src="/react/js/showdown.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -44,16 +45,12 @@
|
||||
<img class="nav-logo" src="/react/img/logo.svg" width="36" height="36">
|
||||
React
|
||||
</a>
|
||||
<ul class="nav-site nav-site-internal">
|
||||
<li><a href="/react/docs/getting-started.html"{% if page.sectionid == 'docs' or page.sectionid == 'tips' %} class="active"{% endif %}>Docs</a></li>
|
||||
<li><a href="/react/support.html"{% if page.id == 'support' %} class="active"{% endif %}>Support</a></li>
|
||||
<li><a href="/react/downloads.html"{% if page.id == 'downloads' %} class="active"{% endif %}>Download</a></li>
|
||||
<li><a href="/react/blog/"{% if page.sectionid == 'blog' %} class="active"{% endif %}>Blog</a></li>
|
||||
</ul>
|
||||
|
||||
<ul class="nav-site nav-site-external">
|
||||
<li><a href="https://github.com/facebook/react">GitHub</a>
|
||||
<li><a href="https://facebook.github.io/react-native/">React Native</a>
|
||||
<ul class="nav-site">
|
||||
<li><a href="/react/docs/getting-started.html"{% if page.sectionid == 'docs' or page.sectionid == 'tips' %} class="active"{% endif %}>docs</a></li>
|
||||
<li><a href="/react/support.html"{% if page.id == 'support' %} class="active"{% endif %}>support</a></li>
|
||||
<li><a href="/react/downloads.html"{% if page.id == 'downloads' %} class="active"{% endif %}>download</a></li>
|
||||
<li><a href="/react/blog/"{% if page.sectionid == 'blog' %} class="active"{% endif %}>blog</a></li>
|
||||
<li><a href="http://github.com/facebook/react">github</a>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -83,7 +80,7 @@
|
||||
</div>
|
||||
<div class="right">
|
||||
© 2013–{{ site.time | date: '%Y' }} Facebook Inc.<br>
|
||||
Documentation licensed under <a href="https://creativecommons.org/licenses/by/4.0/">CC BY 4.0</a>.
|
||||
Documentation licensed under <a href="http://creativecommons.org/licenses/by/4.0/">CC BY 4.0</a>.
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
@@ -6,6 +6,15 @@ sectionid: blog
|
||||
<section class="content wrap blogContent">
|
||||
{% include nav_blog.html %}
|
||||
<div class="inner-content">
|
||||
{% include blog_post.html isPermalink="true" page=page content=content %}
|
||||
<h1>{{ page.title }}</h1>
|
||||
<p class="meta">{{ page.date | date: "%B %e, %Y" }} by {{ page.author }}</p>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="post">
|
||||
{{ content }}
|
||||
</div>
|
||||
|
||||
<div class="fb-like" data-send="true" data-width="650" data-show-faces="false"></div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -8,15 +8,13 @@ layout: default
|
||||
<div class="subHeader">{{ page.description }}</div>
|
||||
{{ content }}
|
||||
|
||||
{% if page.prev or page.next %}
|
||||
<div class="docs-prevnext">
|
||||
{% if page.prev %}
|
||||
<a class="docs-prev" href="/react/docs/{{ page.prev }}">← Prev</a>
|
||||
{% endif %}
|
||||
{% if page.next %}
|
||||
<a class="docs-next" href="/react/docs/{{ page.next }}">Next →</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="docs-prevnext">
|
||||
{% if page.prev %}
|
||||
<a class="docs-prev" href="/react/docs/{{ page.prev }}">← Prev</a>
|
||||
{% endif %}
|
||||
{% if page.next %}
|
||||
<a class="docs-next" href="/react/docs/{{ page.next }}">Next →</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
---
|
||||
title: JSFiddle Integration
|
||||
author: vjeux
|
||||
author: Christopher Chedeau
|
||||
---
|
||||
|
||||
[JSFiddle](https://jsfiddle.net) just announced support for React. This is an exciting news as it makes collaboration on snippets of code a lot easier. You can play around this **[base React JSFiddle](http://jsfiddle.net/vjeux/kb3gN/)**, fork it and share it! A [fiddle without JSX](http://jsfiddle.net/vjeux/VkebS/) is also available.
|
||||
[JSFiddle](http://jsfiddle.net) just announced support for React. This is an exciting news as it makes collaboration on snippets of code a lot easier. You can play around this **[base React JSFiddle](http://jsfiddle.net/vjeux/kb3gN/)**, fork it and share it! A [fiddle without JSX](http://jsfiddle.net/vjeux/VkebS/) is also available.
|
||||
|
||||
|
||||
<blockquote class="twitter-tweet" align="center"><p>React (by Facebook) is now available on JSFiddle. <a href="http://t.co/wNQf9JPv5u" title="http://facebook.github.io/react/">facebook.github.io/react/</a></p>— JSFiddle (@jsfiddle) <a href="https://twitter.com/jsfiddle/status/341114115781177344">June 2, 2013</a></blockquote>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: Why did we build React?
|
||||
author: petehunt
|
||||
author: Pete Hunt
|
||||
---
|
||||
|
||||
There are a lot of JavaScript MVC frameworks out there. Why did we build React
|
||||
@@ -40,7 +40,7 @@ React really shines when your data changes over time.
|
||||
In a traditional JavaScript application, you need to look at what data changed
|
||||
and imperatively make changes to the DOM to keep it up-to-date. Even AngularJS,
|
||||
which provides a declarative interface via directives and data binding [requires
|
||||
a linking function to manually update DOM nodes](https://code.angularjs.org/1.0.8/docs/guide/directive#reasonsbehindthecompilelinkseparation).
|
||||
a linking function to manually update DOM nodes](http://code.angularjs.org/1.0.8/docs/guide/directive#reasonsbehindthecompilelinkseparation).
|
||||
|
||||
React takes a different approach.
|
||||
|
||||
@@ -74,7 +74,7 @@ some pretty cool things with it:
|
||||
- We've built internal prototypes that run React apps in a web worker and use
|
||||
React to drive **native iOS views** via an Objective-C bridge.
|
||||
- You can run React
|
||||
[on the server](https://github.com/petehunt/react-server-rendering-example)
|
||||
[on the server](http://github.com/petehunt/react-server-rendering-example)
|
||||
for SEO, performance, code sharing and overall flexibility.
|
||||
- Events behave in a consistent, standards-compliant way in all browsers
|
||||
(including IE8) and automatically use
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "Community Round-up #1"
|
||||
author: vjeux
|
||||
author: Vjeux
|
||||
---
|
||||
|
||||
React was open sourced two weeks ago and it's time for a little round-up of what has been going on.
|
||||
@@ -38,10 +38,10 @@ It looks like [Ben Alpert](http://benalpert.com/) is the first person outside of
|
||||
|
||||
## Origins of React
|
||||
|
||||
[Pete Hunt](http://www.petehunt.net/blog/) explained what differentiates React from other JavaScript libraries in [a previous blog post](/react/blog/2013/06/05/why-react.html). [Lee Byron](http://leebyron.com/) gives another perspective on Quora:
|
||||
[Pete Hunt](http://www.petehunt.net/blog/) explained what differentiates React from other JavaScript libraries in [a previous blog post](http://facebook.github.io/react/blog/2013/06/05/why-react.html). [Lee Byron](http://leebyron.com/) gives another perspective on Quora:
|
||||
|
||||
> React isn't quite like any other popular Javascript libraries, and it solves a very specific problem: complex UI rendering. It's also intended to be used along side many other popular libraries. For example, React works well with Backbone.js, amongst many others.
|
||||
>
|
||||
> React was born out of frustrations with the common pattern of writing two-way data bindings in complex MVC apps. React is an implementation of one-way data bindings.
|
||||
>
|
||||
> [Read the full post...](https://www.quora.com/React-JS-Library/How-is-Facebooks-React-JavaScript-library/answer/Lee-Byron?srid=3DcX)
|
||||
> [Read the full post...](http://www.quora.com/React-JS-Library/How-is-Facebooks-React-JavaScript-library/answer/Lee-Byron?srid=3DcX)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "Community Round-up #2"
|
||||
author: vjeux
|
||||
author: Vjeux
|
||||
---
|
||||
|
||||
Since the launch we have received a lot of feedback and are actively working on React 0.4. In the meantime, here are the highlights of this week.
|
||||
@@ -21,12 +21,12 @@ Since the launch we have received a lot of feedback and are actively working on
|
||||
|
||||
## React and Socket.IO Chat Application
|
||||
|
||||
[Danial Khosravi](https://danialk.github.io/) made a real-time chat application that interacts with the back-end using Socket.IO.
|
||||
[Danial Khosravi](http://danialk.github.io/) made a real-time chat application that interacts with the back-end using Socket.IO.
|
||||
|
||||
> A week ago I was playing with AngularJS and [this little chat application](https://github.com/btford/angular-socket-io-im) which uses socket.io and nodejs for realtime communication. Yesterday I saw a post about ReactJS in [EchoJS](http://www.echojs.com/) and started playing with this UI library. After playing a bit with React, I decided to write and chat application using React and I used Bran Ford's Backend for server side of this little app.
|
||||
> <figure>[](https://danialk.github.io/blog/2013/06/16/reactjs-and-socket-dot-io-chat-application/)</figure>
|
||||
> <figure>[](http://danialk.github.io/blog/2013/06/16/reactjs-and-socket-dot-io-chat-application/)</figure>
|
||||
>
|
||||
> [Read the full post...](https://danialk.github.io/blog/2013/06/16/reactjs-and-socket-dot-io-chat-application/)
|
||||
> [Read the full post...](http://danialk.github.io/blog/2013/06/16/reactjs-and-socket-dot-io-chat-application/)
|
||||
|
||||
## React and Other Frameworks
|
||||
|
||||
@@ -36,7 +36,7 @@ Since the launch we have received a lot of feedback and are actively working on
|
||||
>
|
||||
> We've designed React from the beginning to work well with other libraries. Angular is no exception. Let's take the original Angular example and use React to implement the fundoo-rating directive.
|
||||
>
|
||||
> [Read the full post...](https://www.quora.com/Pete-Hunt/Posts/Facebooks-React-vs-AngularJS-A-Closer-Look)
|
||||
> [Read the full post...](http://www.quora.com/Pete-Hunt/Posts/Facebooks-React-vs-AngularJS-A-Closer-Look)
|
||||
|
||||
In the same vein, [Markov Twain](https://twitter.com/markov_twain/status/345702941845499906) re-implemented the examples on the front-page [with Ember](http://jsbin.com/azihiw/2/edit) and [Vlad Yazhbin](https://twitter.com/vla) re-implemented the tutorial [with Angular](http://jsfiddle.net/vla/Cdrse/).
|
||||
|
||||
@@ -64,7 +64,7 @@ Mozilla and Google are actively working on Web Components. [Vjeux](http://blog.v
|
||||
|
||||
Many of you pointed out differences between JSX and HTML. In order to clear up some confusion, we have added some documentation that covers the four main differences:
|
||||
|
||||
- [Whitespace removal](/react/docs/jsx-is-not-html.html)
|
||||
- [HTML Entities](/react/docs/jsx-is-not-html.html)
|
||||
- [Comments](/react/docs/jsx-is-not-html.html)
|
||||
- [Custom HTML Attributes](/react/docs/jsx-is-not-html.html)
|
||||
- [Whitespace removal](http://facebook.github.io/react/docs/jsx-is-not-html.html)
|
||||
- [HTML Entities](http://facebook.github.io/react/docs/jsx-is-not-html.html)
|
||||
- [Comments](http://facebook.github.io/react/docs/jsx-is-not-html.html)
|
||||
- [Custom HTML Attributes](http://facebook.github.io/react/docs/jsx-is-not-html.html)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "React v0.3.3"
|
||||
author: zpao
|
||||
author: Paul O'Shannessy
|
||||
---
|
||||
|
||||
We have a ton of great stuff coming in v0.4, but in the meantime we're releasing v0.3.3. This release addresses some small issues people were having and simplifies our tools to make them easier to use.
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
---
|
||||
title: "Community Round-up #3"
|
||||
author: vjeux
|
||||
author: Vjeux
|
||||
---
|
||||
|
||||
The highlight of this week is that an interaction-heavy app has been ported to React. React components are solving issues they had with nested views.
|
||||
|
||||
## Moving From Backbone To React
|
||||
|
||||
[Clay Allsopp](https://twitter.com/clayallsopp) successfully ported [Propeller](http://usepropeller.com/blog/posts/from-backbone-to-react/), a fairly big, interaction-heavy JavaScript app, to React.
|
||||
[Clay Allsopp](http://twitter.com/clayallsopp) successfully ported [Propeller](http://usepropeller.com/blog/posts/from-backbone-to-react/), a fairly big, interaction-heavy JavaScript app, to React.
|
||||
|
||||
> [<img style="float: right; margin: 0 0 10px 10px;" src="/react/img/blog/propeller-logo.png" />](http://usepropeller.com/blog/posts/from-backbone-to-react/)Subviews involve a lot of easy-to-forget boilerplate that Backbone (by design) doesn't automate. Libraries like Backbone.Marionette offer more abstractions to make view nesting easier, but they're all limited by the fact that Backbone delegates how and went view-document attachment occurs to the application code.
|
||||
>
|
||||
@@ -19,7 +19,7 @@ The highlight of this week is that an interaction-heavy app has been ported to R
|
||||
|
||||
## Grunt Task for JSX
|
||||
|
||||
[Eric Clemmons](https://ericclemmons.github.io/) wrote a task for [Grunt](http://gruntjs.com/) that applies the JSX transformation to your Javascript files. It also works with [Browserify](http://browserify.org/) if you want all your files to be concatenated and minified together.
|
||||
[Eric Clemmons](http://ericclemmons.github.io/) wrote a task for [Grunt](http://gruntjs.com/) that applies the JSX transformation to your Javascript files. It also works with [Browserify](http://browserify.org/) if you want all your files to be concatenated and minified together.
|
||||
|
||||
> Grunt task for compiling Facebook React's .jsx templates into .js
|
||||
>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "New in React v0.4: Autobind by Default"
|
||||
author: zpao
|
||||
author: Paul O'Shannessy
|
||||
---
|
||||
|
||||
React v0.4 is very close to completion. As we finish it off, we'd like to share with you some of the major changes we've made since v0.3. This is the first of several posts we'll be making over the next week.
|
||||
@@ -8,7 +8,7 @@ React v0.4 is very close to completion. As we finish it off, we'd like to share
|
||||
|
||||
## What is React.autoBind?
|
||||
|
||||
If you take a look at most of our current examples, you'll see us using `React.autoBind` for event handlers. This is used in place of `Function.prototype.bind`. Remember that in JS, [function calls are late-bound](https://bonsaiden.github.io/JavaScript-Garden/#function.this). That means that if you simply pass a function around, the `this` used inside won't necessarily be the `this` you expect. `Function.prototype.bind` creates a new, properly bound, function so that when called, `this` is exactly what you expect it to be.
|
||||
If you take a look at most of our current examples, you'll see us using `React.autoBind` for event handlers. This is used in place of `Function.prototype.bind`. Remember that in JS, [function calls are late-bound](http://bonsaiden.github.io/JavaScript-Garden/#function.this). That means that if you simply pass a function around, the `this` used inside won't necessarily be the `this` you expect. `Function.prototype.bind` creates a new, properly bound, function so that when called, `this` is exactly what you expect it to be.
|
||||
|
||||
Before we launched React, we would write this:
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "Community Round-up #4"
|
||||
author: vjeux
|
||||
author: Vjeux
|
||||
---
|
||||
|
||||
React reconciliation process appears to be very well suited to implement a text editor with a live preview as people at Khan Academy show us.
|
||||
@@ -47,11 +47,11 @@ Over the past several weeks, members of our team, [Pete Hunt](http://www.petehun
|
||||
|
||||
[Pete Hunt](http://www.petehunt.net/) recorded himself implementing a simple `<Blink>` tag in React.
|
||||
|
||||
<figure><iframe src="https://player.vimeo.com/video/67248575" width="500" height="340" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></figure>
|
||||
<figure><iframe src="http://player.vimeo.com/video/67248575" width="500" height="340" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></figure>
|
||||
|
||||
## Snake in React
|
||||
|
||||
[Tom Occhino](http://tomocchino.com/) implemented Snake in 150 lines with React.
|
||||
|
||||
> [Check the source on Github](https://github.com/tomocchino/react-snake/blob/master/src/snake.js)
|
||||
> <figure>[](https://tomocchino.github.io/react-snake/)</figure>
|
||||
> <figure>[](http://tomocchino.github.io/react-snake/)</figure>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "New in React v0.4: Prop Validation and Default Values"
|
||||
author: zpao
|
||||
author: Paul O'Shannessy
|
||||
---
|
||||
|
||||
Many of the questions we got following the public launch of React revolved around `props`, specifically that people wanted to do validation and to make sure their components had sensible defaults.
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
---
|
||||
title: "React v0.4.0"
|
||||
author: zpao
|
||||
author: Paul O'Shannessy
|
||||
---
|
||||
|
||||
Over the past 2 months we've been taking feedback and working hard to make React even better. We fixed some bugs, made some under-the-hood improvements, and added several features that we think will improve the experience developing with React. Today we're proud to announce the availability of React v0.4!
|
||||
|
||||
|
||||
This release could not have happened without the support of our growing community. Since launch day, the community has contributed blog posts, questions to the [Google Group](https://groups.google.com/group/reactjs), and issues and pull requests on GitHub. We've had contributions ranging from documentation improvements to major changes to React's rendering. We've seen people integrate React into the tools they're using and the products they're building, and we're all very excited to see what our budding community builds next!
|
||||
This release could not have happened without the support of our growing community. Since launch day, the community has contributed blog posts, questions to the [Google Group](http://groups.google.com/group/reactjs), and issues and pull requests on GitHub. We've had contributions ranging from documentation improvements to major changes to React's rendering. We've seen people integrate React into the tools they're using and the products they're building, and we're all very excited to see what our budding community builds next!
|
||||
|
||||
React v0.4 has some big changes. We've also restructured the documentation to better communicate how to use React. We've summarized the changes below and linked to documentation where we think it will be especially useful.
|
||||
|
||||
@@ -18,10 +18,10 @@ When you're ready, [go download it](/react/downloads.html)!
|
||||
* Switch from using `id` attribute to `data-reactid` to track DOM nodes. This allows you to integrate with other JS and CSS libraries more easily.
|
||||
* Support for more DOM elements and attributes (e.g., `<canvas>`)
|
||||
* Improved server-side rendering APIs. `React.renderComponentToString(<component>, callback)` allows you to use React on the server and generate markup which can be sent down to the browser.
|
||||
* `prop` improvements: validation and default values. [Read our blog post for details...](/react/blog/2013/07/11/react-v0-4-prop-validation-and-default-values.html)
|
||||
* Support for the `key` prop, which allows for finer control over reconciliation. [Read the docs for details...](/react/docs/multiple-components.html)
|
||||
* Removed `React.autoBind`. [Read our blog post for details...](/react/blog/2013/07/02/react-v0-4-autobind-by-default.html)
|
||||
* Improvements to forms. We've written wrappers around `<input>`, `<textarea>`, `<option>`, and `<select>` in order to standardize many inconsistencies in browser implementations. This includes support for `defaultValue`, and improved implementation of the `onChange` event, and circuit completion. [Read the docs for details...](/react/docs/forms.html)
|
||||
* `prop` improvements: validation and default values. [Read our blog post for details...](http://facebook.github.io/react/blog/2013/07/11/react-v0-4-prop-validation-and-default-values.html)
|
||||
* Support for the `key` prop, which allows for finer control over reconciliation. [Read the docs for details...](http://facebook.github.io/react/docs/multiple-components.html)
|
||||
* Removed `React.autoBind`. [Read our blog post for details...](http://facebook.github.io/react/blog/2013/07/02/react-v0-4-autobind-by-default.html)
|
||||
* Improvements to forms. We've written wrappers around `<input>`, `<textarea>`, `<option>`, and `<select>` in order to standardize many inconsistencies in browser implementations. This includes support for `defaultValue`, and improved implementation of the `onChange` event, and circuit completion. [Read the docs for details...](http://facebook.github.io/react/docs/forms.html)
|
||||
* We've implemented an improved synthetic event system that conforms to the W3C spec.
|
||||
* Updates to your component are batched now, which may result in a significantly faster re-render of components. `this.setState` now takes an optional callback as its second parameter. If you were using `onClick={this.setState.bind(this, state)}` previously, you'll want to make sure you add a third parameter so that the event is not treated as the callback.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "Community Round-up #5"
|
||||
author: vjeux
|
||||
author: Vjeux
|
||||
---
|
||||
|
||||
We launched the [React Facebook Page](https://www.facebook.com/react) along with the React v0.4 launch. 700 people already liked it to get updated on the project :)
|
||||
@@ -52,7 +52,7 @@ Learning a new library is always easier when you have working examples you can p
|
||||
|
||||
## React Chosen Wrapper
|
||||
|
||||
[Cheng Lou](https://github.com/chenglou) wrote a wrapper for the [Chosen](https://harvesthq.github.io/chosen/) input library called [react-chosen](https://github.com/chenglou/react-chosen). It took just 25 lines to be able to use jQuery component as a React one.
|
||||
[Cheng Lou](https://github.com/chenglou) wrote a wrapper for the [Chosen](http://harvesthq.github.io/chosen/) input library called [react-chosen](https://github.com/chenglou/react-chosen). It took just 25 lines to be able to use jQuery component as a React one.
|
||||
|
||||
```javascript
|
||||
React.renderComponent(
|
||||
@@ -60,7 +60,7 @@ React.renderComponent(
|
||||
<option value="Facebook">Facebook</option>
|
||||
<option value="Harvest">Harvest</option>
|
||||
</Chosen>
|
||||
, document.getElementById('example'));
|
||||
, document.body);
|
||||
```
|
||||
|
||||
|
||||
@@ -68,14 +68,14 @@ React.renderComponent(
|
||||
|
||||
[Domenic Denicola](http://domenicdenicola.com/) wrote a slide deck about the great applications of ES6 features and one slide shows how we could use Template Strings to compile JSX at run-time without the need for a pre-processing phase.
|
||||
|
||||
<figure><iframe src="https://www.slideshare.net/slideshow/embed_code/24187146?rel=0&startSlide=36" width="600" height="356" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" style="border:1px solid #CCC;border-width:1px 1px 0;margin-bottom:5px" allowfullscreen webkitallowfullscreen mozallowfullscreen> </iframe></figure>
|
||||
<figure><iframe src="http://www.slideshare.net/slideshow/embed_code/24187146?rel=0&startSlide=36" width="600" height="356" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" style="border:1px solid #CCC;border-width:1px 1px 0;margin-bottom:5px" allowfullscreen webkitallowfullscreen mozallowfullscreen> </iframe></figure>
|
||||
|
||||
|
||||
## React Presentation
|
||||
|
||||
[Tom Occhino](http://tomocchino.com/) and [Jordan Walke](https://github.com/jordwalke), React developers, did a presentation of React at Facebook Seattle's office. Check out the first 25 minutes for the presentation and the remaining 45 for a Q&A. I highly recommend you watching this video.
|
||||
|
||||
<figure><iframe width="650" height="400" src="//www.youtube-nocookie.com/embed/XxVg_s8xAms" frameborder="0" allowfullscreen></iframe></figure>
|
||||
<figure><iframe width="650" height="400" src="//www.youtube.com/embed/XxVg_s8xAms" frameborder="0" allowfullscreen></iframe></figure>
|
||||
|
||||
|
||||
## Docs
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "React v0.4.1"
|
||||
author: zpao
|
||||
author: Paul O'Shannessy
|
||||
---
|
||||
|
||||
React v0.4.1 is a small update, mostly containing correctness fixes. Some code has been restructured internally but those changes do not impact any of our public APIs.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "Use React and JSX in Ruby on Rails"
|
||||
author: zpao
|
||||
author: Paul O'Shannessy
|
||||
---
|
||||
|
||||
Today we're releasing a gem to make it easier to use React and JSX in Ruby on Rails applications: [react-rails](https://github.com/facebook/react-rails).
|
||||
@@ -38,7 +38,7 @@ When you name your file with `myfile.js.jsx`, `react-rails` will automatically t
|
||||
|
||||
```js
|
||||
/** @jsx React.DOM */
|
||||
React.renderComponent(<MyComponent/>, document.getElementById('example'))
|
||||
React.renderComponent(<MyComponent/>, document.body)
|
||||
```
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "Community Round-up #6"
|
||||
author: vjeux
|
||||
author: Vjeux
|
||||
---
|
||||
|
||||
This is the first Community Round-up where none of the items are from Facebook/Instagram employees. It's great to see the adoption of React growing.
|
||||
@@ -54,7 +54,7 @@ este.demos.react.todoApp = este.react.create (`/** @lends {React.ReactComponent.
|
||||
|
||||
## React Stylus Boilerplate
|
||||
|
||||
[Zaim Bakar](https://zaim.github.io/) shared his boilerplate to get started with Stylus CSS processor.
|
||||
[Zaim Bakar](http://zaim.github.io/) shared his boilerplate to get started with Stylus CSS processor.
|
||||
|
||||
> This is my boilerplate React project using Grunt as the build tool, and Stylus as my CSS preprocessor.
|
||||
>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "Use React and JSX in Python Applications"
|
||||
author: kmeht
|
||||
author: Kunal Mehta
|
||||
---
|
||||
|
||||
Today we're happy to announce the initial release of [PyReact](https://github.com/facebook/react-python), which makes it easier to use React and JSX in your Python applications. It's designed to provide an API to transform your JSX files into JavaScript, as well as provide access to the latest React source files.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "Community Round-up #7"
|
||||
author: vjeux
|
||||
author: Vjeux
|
||||
---
|
||||
|
||||
It's been three months since we open sourced React and it is going well. Some stats so far:
|
||||
@@ -10,7 +10,7 @@ It's been three months since we open sourced React and it is going well. Some st
|
||||
* [226 posts on Google Group](https://groups.google.com/forum/#!forum/reactjs)
|
||||
* [76 Github projects using React](https://gist.github.com/vjeux/6335762)
|
||||
* [30 contributors](https://github.com/facebook/react/graphs/contributors)
|
||||
* [15 blog posts](/react/blog/)
|
||||
* [15 blog posts](http://facebook.github.io/react/blog/)
|
||||
* 2 early adopters: [Khan Academy](http://benalpert.com/2013/06/09/using-react-to-speed-up-khan-academy.html) and [Propeller](http://usepropeller.com/blog/posts/from-backbone-to-react/)
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "Community Round-up #8"
|
||||
author: vjeux
|
||||
author: Vjeux
|
||||
---
|
||||
|
||||
A lot has happened in the month since our last update. Here are some of the more interesting things we've found. But first, we have a couple updates before we share links.
|
||||
@@ -66,4 +66,4 @@ While this is not going to work for all the attributes since they are camelCased
|
||||
|
||||
[Vjeux](http://blog.vjeux.com/) re-implemented the display part of the IRC logger in React. Just 130 lines are needed for a performant infinite scroll with timestamps and color-coded author names.
|
||||
|
||||
[View the source on JSFiddle...](http://jsfiddle.net/vjeux/QL9tz)
|
||||
<iframe width="100%" height="300" src="http://jsfiddle.net/vjeux/QL9tz/embedded/" allowfullscreen="allowfullscreen" frameborder="0"></iframe>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "React v0.5"
|
||||
author: zpao
|
||||
author: Paul O'Shannessy
|
||||
---
|
||||
|
||||
This release is the result of several months of hard work from members of the team and the community. While there are no groundbreaking changes in core, we've worked hard to improve performance and memory usage. We've also worked hard to make sure we are being consistent in our usage of DOM properties.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "React v0.5.1"
|
||||
author: zpao
|
||||
author: Paul O'Shannessy
|
||||
---
|
||||
|
||||
This release focuses on fixing some small bugs that have been uncovered over the past two weeks. I would like to thank everybody involved, specifically members of the community who fixed half of the issues found. Thanks to [Ben Alpert][1], [Andrey Popp][2], and [Laurence Rowe][3] for their contributions!
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "Community Round-up #9"
|
||||
author: vjeux
|
||||
author: Vjeux
|
||||
---
|
||||
|
||||
We organized a React hackathon last week-end in the Facebook Seattle office. 50 people, grouped into 15 teams, came to hack for a day on React. It was a lot of fun and we'll probably organize more in the future.
|
||||
@@ -29,7 +29,7 @@ We organized a React hackathon last week-end in the Facebook Seattle office. 50
|
||||
|
||||
The video will be available soon on the [JSConf EU website](http://2013.jsconf.eu/speakers/pete-hunt-react-rethinking-best-practices.html), but in the meantime, here are Pete's slides:
|
||||
|
||||
<figure><iframe src="https://www.slideshare.net/slideshow/embed_code/26589373" width="550" height="450" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" allowfullscreen></iframe></figure>
|
||||
<figure><iframe src="http://www.slideshare.net/slideshow/embed_code/26589373" width="550" height="450" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" allowfullscreen></iframe></figure>
|
||||
|
||||
|
||||
## Pump - Clojure bindings for React
|
||||
|
||||
142
docs/_posts/2013-11-05-thinking-in-react.md
Normal file
142
docs/_posts/2013-11-05-thinking-in-react.md
Normal file
@@ -0,0 +1,142 @@
|
||||
---
|
||||
title: "Thinking in React"
|
||||
author: Pete Hunt
|
||||
---
|
||||
|
||||
React is, in my opinion, the premier way to build big, fast Web apps with JavaScript. It has scaled very well for us at Facebook and Instagram.
|
||||
|
||||
One of the many great parts of React is how it makes you think about apps as you build them. In this post I'll walk you through the thought process of building a searchable product data table using React.
|
||||
|
||||
## Start with a mock
|
||||
|
||||
Imagine that we already have a JSON API and a mock from our designer. Our designer apparently isn't very good because the mock looks like this:
|
||||
|
||||

|
||||
|
||||
Our JSON API returns some data that looks like this:
|
||||
|
||||
```
|
||||
[
|
||||
{category: "Sporting Goods", price: "$49.99", stocked: true, name: "Football"},
|
||||
{category: "Sporting Goods", price: "$9.99", stocked: true, name: "Baseball"},
|
||||
{category: "Sporting Goods", price: "$29.99", stocked: false, name: "Basketball"},
|
||||
{category: "Electronics", price: "$99.99", stocked: true, name: "iPod Touch"},
|
||||
{category: "Electronics", price: "$399.99", stocked: false, name: "iPhone 5"},
|
||||
{category: "Electronics", price: "$199.99", stocked: true, name: "Nexus 7"}
|
||||
];
|
||||
```
|
||||
|
||||
## Step 1: break the UI into a component hierarchy
|
||||
|
||||
The first thing you'll want to do is to draw boxes around every component (and subcomponent) in the mock and give them all names. If you're working with a designer they may have already done this, so go talk to them! Their Photoshop layer names may end up being the names of your React components!
|
||||
|
||||
But how do you know what should be its own component? Just use the same techniques for deciding if you should create a new function or object. One such technique is the [single responsibility principle](http://en.wikipedia.org/wiki/Single_responsibility_principle), that is, a component should ideally only do one thing. If it ends up growing it should be decomposed into smaller subcomponents.
|
||||
|
||||
Since you're often displaying a JSON data model to a user, you'll find that if your model was built correctly your UI (and therefore your component structure) will map nicely onto it. That's because user interfaces and data models tend to adhere to the same *information architecture* which means the work of separating your UI into components is often trivial. Just break it up into components that represent exactly one piece of your data model.
|
||||
|
||||

|
||||
|
||||
You'll see here that we have five components in our simple app. I've italicized the data each component represents.
|
||||
|
||||
1. **`FilterableProductTable` (orange):** contains the entirety of the example
|
||||
2. **`SearchBar` (blue):** receives all *user input*
|
||||
3. **`ProductTable` (green):** displays and filters the *data collection* based on *user input*
|
||||
4. **`ProductCategoryRow` (turquoise):** displays a heading for each *category*
|
||||
5. **`ProductRow` (red):** displays a row for each *product*
|
||||
|
||||
If you look at `ProductTable` you'll see that the table header (containing the "Name" and "Price" labels) isn't its own component. This is a matter of preference and there's an argument to be made either way. For this example I left it as part of `ProductTable` because it is part of rendering the *data collection* which is `ProductTable`'s responsibility. However if this header grows to be complex (i.e. if we were to add affordances for sorting) it would certainly make sense to make this its own `ProductTableHeader` component.
|
||||
|
||||
Now that we've identified the components in our mock, let's arrange them into a hierarchy. This is easy. Components that appear within another component in the mock should appear as a child in the hierarchy:
|
||||
|
||||
* `FilterableProductTable`
|
||||
* `SearchBar`
|
||||
* `ProductTable`
|
||||
* `ProductCategoryRow`
|
||||
* `ProductRow`
|
||||
|
||||
## Step 2: Build a static version in React
|
||||
|
||||
<iframe width="100%" height="300" src="http://jsfiddle.net/6wQMG/embedded/" allowfullscreen="allowfullscreen" frameborder="0"></iframe>
|
||||
|
||||
Now that you have your component hierarchy it's time to start implementing your app. The easiest way is to build a version that takes your data model and renders the UI but has no interactivity. It's easiest to decouple these processes because building a static version requires a lot of typing and no thinking, and adding interactivity requires a lot of thinking and not a lot of typing. We'll see why.
|
||||
|
||||
To build a static version of your app that renders your data model you'll want to build components that reuse other components and pass data using *props*. *props* are a way of passing data from parent to child. If you're familiar with the concept of *state*, **don't use state at all** to build this static version. State is reserved only for interactivity, that is, data that changes over time. Since this is a static version of the app you don't need it.
|
||||
|
||||
You can build top-down or bottom-up. That is, you can either start with building the components higher up in the hierarchy (i.e. starting with `FilterableProductTable`) or with the ones lower in it (`ProductRow`). In simpler examples it's usually easier to go top-down and on larger projects it's easier to go bottom-up and write tests as you build.
|
||||
|
||||
At the end of this step you'll have a library of reusable components that render your data model. The components will only have `render()` methods since this is a static version of your app. The component at the top of the hierarchy (`FilterableProductTable`) will take your data model as a prop. If you make a change to your underlying data model and call `renderComponent()` again the UI will be updated. It's easy to see how your UI is updated and where to make changes since there's nothing complicated going on since React's **one-way data flow** (also called *one-way binding*) keeps everything modular, easy to reason about, and fast.
|
||||
|
||||
Simply refer to the [React docs](http://facebook.github.io/react/docs/) if you need help executing this step.
|
||||
|
||||
### A brief interlude: props vs state
|
||||
|
||||
There are two types of "model" data in React: props and state. It's important to understand the distinction between the two; skim [the official React docs](http://facebook.github.io/react/docs/interactivity-and-dynamic-uis.html) if you aren't sure what the difference is.
|
||||
|
||||
## Step 3: Identify the minimal (but complete) representation of UI state
|
||||
|
||||
To make your UI interactive you need to be able to trigger changes to your underlying data model. React makes this easy with **state**.
|
||||
|
||||
To build your app correctly you first need to think of the minimal set of mutable state that your app needs. The key here is DRY: *Don't Repeat Yourself*. Figure out what the absolute minimal representation of the state of your application needs to be and compute everything else you need on-demand. For example, if you're building a TODO list, just keep an array of the TODO items around; don't keep a separate state variable for the count. Instead, when you want to render the TODO count simply take the length of the TODO items array.
|
||||
|
||||
Think of all of the pieces of data in our example application. We have:
|
||||
|
||||
* The original list of products
|
||||
* The search text the user has entered
|
||||
* The value of the checkbox
|
||||
* The filtered list of products
|
||||
|
||||
Let's go through each one and figure out which one is state. Simply ask three questions about each piece of data:
|
||||
|
||||
1. Is it passed in from a parent via props? If so, it probably isn't state.
|
||||
2. Does it change over time? If not, it probably isn't state.
|
||||
3. Can you compute it based on any other state or props in your component? If so, it's not state.
|
||||
|
||||
The original list of products is passed in as props, so that's not state. The search text and the checkbox seem to be state since they change over time and can't be computed from anything. And finally, the filtered list of products isn't state because it can be computed by combining the original list of products with the search text and value of the checkbox.
|
||||
|
||||
So finally, our state is:
|
||||
|
||||
* The search text the user has entered
|
||||
* The value of the checkbox
|
||||
|
||||
## Step 4: Identify where your state should live
|
||||
|
||||
<iframe width="100%" height="300" src="http://jsfiddle.net/QvHnx/embedded/" allowfullscreen="allowfullscreen" frameborder="0"></iframe>
|
||||
|
||||
OK, so we've identified what the minimal set of app state is. Next we need to identify which component mutates, or *owns*, this state.
|
||||
|
||||
Remember: React is all about one-way data flow down the component hierarchy. It may not be immediately clear which component should own what state. **This is often the most challenging part for newcomers to understand,** so follow these steps to figure it out:
|
||||
|
||||
For each piece of state in your application:
|
||||
|
||||
* Identify every component that renders something based on that state.
|
||||
* Find a common owner component (a single component above all the components that need the state in the hierarchy).
|
||||
* Either the common owner or another component higher up in the hierarchy should own the state.
|
||||
* If you can't find a component where it makes sense to own the state, create a new component simply for holding the state and add it somewhere in the hierarchy above the common owner component.
|
||||
|
||||
Let's run through this strategy for our application:
|
||||
|
||||
* `ProductTable` needs to filter the product list based on state and `SearchBar` needs to display the search text and checked state.
|
||||
* The common owner component is `FilterableProductTable`.
|
||||
* It conceptually makes sense for the filter text and checked value to live in `FilterableProductTable`
|
||||
|
||||
Cool, so we've decided that our state lives in `FilterableProductTable`. First, add a `getInitialState()` method to `FilterableProductTable` that returns `{filterText: '', inStockOnly: false}` to reflect the initial state of your application. Then pass `filterText` and `inStockOnly` to `ProductTable` and `SearchBar` as a prop. Finally, use these props to filter the rows in `ProductTable` and set the values of the form fields in `SearchBar`.
|
||||
|
||||
You can start seeing how your application will behave: set `filterText` to `"ball"` and refresh your app. You'll see the data table is updated correctly.
|
||||
|
||||
## Step 5: Add inverse data flow
|
||||
|
||||
<iframe width="100%" height="300" src="http://jsfiddle.net/3Vs3Q/embedded/" allowfullscreen="allowfullscreen" frameborder="0"></iframe>
|
||||
|
||||
So far we've built an app that renders correctly as a function of props and state flowing down the hierarchy. Now it's time to support data flowing the other way: the form components deep in the hierarchy need to update the state in `FilterableProductTable`.
|
||||
|
||||
React makes this data flow explicit to make it easy to understand how your program works, but it does require a little more typing than traditional two-way data binding. React provides an add-on called `ReactLink` to make this pattern as convenient as two-way binding, but for the purpose of this post we'll keep everything explicit.
|
||||
|
||||
If you try to type or check the box in the current version of the example you'll see that React ignores your input. This is intentional, as we've set the `value` prop of the `input` to always be equal to the `state` passed in from `FilterableProductTable`.
|
||||
|
||||
Let's think about what we want to happen. We want to make sure that whenever the user changes the form we update the state to reflect the user input. Since components should only update their own state, `FilterableProductTable` will pass a callback to `SearchBar` that will fire whenever the state should be updated. We can use the `onChange` event on the inputs to be notified of it. And the callback passed by `FilterableProductTable` will call `setState()` and the app will be updated.
|
||||
|
||||
Though this sounds like a lot it's really just a few lines of code. And it's really explicit how your data is flowing throughout the app.
|
||||
|
||||
## And that's it
|
||||
|
||||
Hopefully this gives you an idea of how to think about building components and applications with React. While it may be a little more typing than you're used to, remember that code is read far more than it's written, and it's extremely easy to read this modular, explicit code. As you start to build large libraries of components you'll appreciate this explicitness and modularity, and with code reuse your lines of code will start to shrink :)
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "Community Round-up #10"
|
||||
author: vjeux
|
||||
author: Vjeux
|
||||
---
|
||||
|
||||
This is the 10th round-up already and React has come quite far since it was open sourced. Almost all new web projects at Khan Academy, Facebook, and Instagram are being developed using React. React has been deployed in a variety of contexts: a Chrome extension, a Windows 8 application, mobile websites, and desktop websites supporting Internet Explorer 8! Language-wise, React is not only being used within JavaScript but also CoffeeScript and ClojureScript.
|
||||
@@ -26,7 +26,7 @@ The best part is that no drastic changes have been required to support all those
|
||||
|
||||
[Pete Hunt](http://www.petehunt.net/)'s talk at JSConf EU 2013 is now available in video.
|
||||
|
||||
<figure><iframe width="600" height="370" src="//www.youtube-nocookie.com/embed/x7cQ3mrcKaY" frameborder="0" allowfullscreen></iframe></figure>
|
||||
<figure><iframe width="600" height="370" src="//www.youtube.com/embed/x7cQ3mrcKaY" frameborder="0" allowfullscreen></iframe></figure>
|
||||
|
||||
|
||||
## Server-side React with PHP
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "Community Round-up #11"
|
||||
author: vjeux
|
||||
author: Vjeux
|
||||
---
|
||||
|
||||
This round-up is the proof that React has taken off from its Facebook's root: it features three in-depth presentations of React done by external people. This is awesome, keep them coming!
|
||||
@@ -9,25 +9,25 @@ This round-up is the proof that React has taken off from its Facebook's root: it
|
||||
|
||||
[Steve Luscher](https://github.com/steveluscher) working at [LeanPub](https://leanpub.com/) made a 30 min talk at [Super VanJS](https://twitter.com/vanjs). He does a remarkable job at explaining why React is so fast with very exciting demos using the HTML5 Audio API.
|
||||
|
||||
<figure><iframe width="600" height="338" src="//www.youtube-nocookie.com/embed/1OeXsL5mr4g" frameborder="0" allowfullscreen></iframe></figure>
|
||||
<figure><iframe width="600" height="338" src="//www.youtube.com/embed/1OeXsL5mr4g" frameborder="0" allowfullscreen></iframe></figure>
|
||||
|
||||
|
||||
## React Tips
|
||||
|
||||
[Connor McSheffrey](http://connormcsheffrey.com/) and [Cheng Lou](https://github.com/chenglou) added a new section to the documentation. It's a list of small tips that you will probably find useful while working on React. Since each article is very small and focused, we [encourage you to contribute](/react/tips/introduction.html)!
|
||||
[Connor McSheffrey](http://connormcsheffrey.com/) and [Cheng Lou](https://github.com/chenglou) added a new section to the documentation. It's a list of small tips that you will probably find useful while working on React. Since each article is very small and focused, we [encourage you to contribute](http://facebook.github.io/react/tips/introduction.html)!
|
||||
|
||||
- [Inline Styles](/react/tips/inline-styles.html)
|
||||
- [If-Else in JSX](/react/tips/if-else-in-JSX.html)
|
||||
- [Self-Closing Tag](/react/tips/self-closing-tag.html)
|
||||
- [Maximum Number of JSX Root Nodes](/react/tips/maximum-number-of-jsx-root-nodes.html)
|
||||
- [Shorthand for Specifying Pixel Values in style props](/react/tips/style-props-value-px.html)
|
||||
- [Type of the Children props](/react/tips/children-props-type.html)
|
||||
- [Value of null for Controlled Input](/react/tips/controlled-input-null-value.html)
|
||||
- [`componentWillReceiveProps` Not Triggered After Mounting](/react/tips/componentWillReceiveProps-not-triggered-after-mounting.html)
|
||||
- [Props in getInitialState Is an Anti-Pattern](/react/tips/props-in-getInitialState-as-anti-pattern.html)
|
||||
- [DOM Event Listeners in a Component](/react/tips/dom-event-listeners.html)
|
||||
- [Load Initial Data via AJAX](/react/tips/initial-ajax.html)
|
||||
- [False in JSX](/react/tips/false-in-jsx.html)
|
||||
- [Inline Styles](http://facebook.github.io/react/tips/inline-styles.html)
|
||||
- [If-Else in JSX](http://facebook.github.io/react/tips/if-else-in-JSX.html)
|
||||
- [Self-Closing Tag](http://facebook.github.io/react/tips/self-closing-tag.html)
|
||||
- [Maximum Number of JSX Root Nodes](http://facebook.github.io/react/tips/maximum-number-of-jsx-root-nodes.html)
|
||||
- [Shorthand for Specifying Pixel Values in style props](http://facebook.github.io/react/tips/style-props-value-px.html)
|
||||
- [Type of the Children props](http://facebook.github.io/react/tips/children-props-type.html)
|
||||
- [Value of null for Controlled Input](http://facebook.github.io/react/tips/controlled-input-null-value.html)
|
||||
- [`componentWillReceiveProps` Not Triggered After Mounting](http://facebook.github.io/react/tips/componentWillReceiveProps-not-triggered-after-mounting.html)
|
||||
- [Props in getInitialState Is an Anti-Pattern](http://facebook.github.io/react/tips/props-in-getInitialState-as-anti-pattern.html)
|
||||
- [DOM Event Listeners in a Component](http://facebook.github.io/react/tips/dom-event-listeners.html)
|
||||
- [Load Initial Data via AJAX](http://facebook.github.io/react/tips/initial-ajax.html)
|
||||
- [False in JSX](http://facebook.github.io/react/tips/false-in-jsx.html)
|
||||
|
||||
|
||||
## Intro to the React Framework
|
||||
@@ -50,7 +50,7 @@ This round-up is the proof that React has taken off from its Facebook's root: it
|
||||
|
||||
## Genesis Skeleton
|
||||
|
||||
[Eric Clemmons](https://ericclemmons.github.io/) is working on a "Modern, opinionated, full-stack starter kit for rapid, streamlined application development". The version 0.4.0 has just been released and has first-class support for React.
|
||||
[Eric Clemmons](http://ericclemmons.github.io/) is working on a "Modern, opinionated, full-stack starter kit for rapid, streamlined application development". The version 0.4.0 has just been released and has first-class support for React.
|
||||
<figure>[](http://genesis-skeleton.com/)</figure>
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "React v0.5.2, v0.4.2"
|
||||
author: zpao
|
||||
author: Paul O'Shannessy
|
||||
---
|
||||
|
||||
Today we're releasing an update to address a potential XSS vulnerability that can arise when using user data as a `key`. Typically "safe" data is used for a `key`, for example, an id from your database, or a unique hash. However there are cases where it may be reasonable to use user generated content. A carefully crafted piece of content could result in arbitrary JS execution. While we make a very concerted effort to ensure all text is escaped before inserting it into the DOM, we missed one case. Immediately following the discovery of this vulnerability, we performed an audit to ensure we this was the only such vulnerability.
|
||||
@@ -15,7 +15,7 @@ While we've encouraged responsible disclosure as part of [Facebook's whitehat bo
|
||||
|
||||
You can learn more about the vulnerability discussed here: [CVE-2013-7035][cve].
|
||||
|
||||
[download]: /react/downloads.html
|
||||
[download]: http://facebook.github.io/react/downloads.html
|
||||
[bounty]: https://www.facebook.com/whitehat/
|
||||
[ember]: http://emberjs.com/security/
|
||||
[cve]: https://groups.google.com/forum/#!topic/reactjs/OIqxlB2aGfU
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "React v0.8"
|
||||
author: zpao
|
||||
author: Paul O'Shannessy
|
||||
---
|
||||
|
||||
I'll start by answering the obvious question:
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
---
|
||||
title: "Community Round-up #12"
|
||||
author: vjeux
|
||||
author: Vjeux
|
||||
---
|
||||
|
||||
React got featured on the front-page of Hacker News thanks to the Om library. If you try it out for the first time, take a look at the [docs](/react/docs/getting-started.html) and do not hesitate to ask questions on the [Google Group](https://groups.google.com/group/reactjs), [IRC](irc://chat.freenode.net/reactjs) or [Stack Overflow](http://stackoverflow.com/questions/tagged/reactjs). We are trying our best to help you out!
|
||||
React got featured on the front-page of Hacker News thanks to the Om library. If you try it out for the first time, take a look at the [docs](/react/docs/getting-started.html) and do not hesitate to ask questions on the [Google Group](http://groups.google.com/group/reactjs), [IRC](irc://chat.freenode.net/reactjs) or [Stack Overflow](http://stackoverflow.com/questions/tagged/reactjs). We are trying our best to help you out!
|
||||
|
||||
## The Future of Javascript MVC
|
||||
|
||||
[David Nolen](https://swannodette.github.io/) announced Om, a thin wrapper on-top of React in ClojureScript. It stands out by only using immutable data structures. This unlocks the ability to write a very efficient [shouldComponentUpdate](/react/docs/component-specs.html#updating-shouldcomponentupdate) and get huge performance improvements on some tasks.
|
||||
[David Nolen](http://swannodette.github.io/) announced Om, a thin wrapper on-top of React in ClojureScript. It stands out by only using immutable data structures. This unlocks the ability to write a very efficient [shouldComponentUpdate](http://facebook.github.io/react/docs/component-specs.html#updating-shouldcomponentupdate) and get huge performance improvements on some tasks.
|
||||
|
||||
> We've known this for some time over here in the ClojureScript corner of the world - all of our collections are immutable and modeled directly on the original Clojure versions written in Java. Modern JavaScript engines have now been tuned to the point that it's no longer uncommon to see collection performance within 2.5X of the Java Virtual Machine.
|
||||
>
|
||||
> Wait, wait, wait. What does the performance of persistent data structures have to do with the future of JavaScript MVCs?
|
||||
>
|
||||
> A whole lot.
|
||||
> <figure>[](https://swannodette.github.io/2013/12/17/the-future-of-javascript-mvcs/)</figure>
|
||||
> <figure>[](http://swannodette.github.io/2013/12/17/the-future-of-javascript-mvcs/)</figure>
|
||||
>
|
||||
> [Read the full article...](https://swannodette.github.io/2013/12/17/the-future-of-javascript-mvcs/)
|
||||
> [Read the full article...](http://swannodette.github.io/2013/12/17/the-future-of-javascript-mvcs/)
|
||||
|
||||
|
||||
|
||||
## Scroll Position with React
|
||||
|
||||
Managing the scroll position when new content is inserted is usually very tricky to get right. [Vjeux](http://blog.vjeux.com/) discovered that [componentWillUpdate](/react/docs/component-specs.html#updating-componentwillupdate) and [componentDidUpdate](/react/docs/component-specs.html#updating-componentdidupdate) were triggered exactly at the right time to manage the scroll position.
|
||||
Managing the scroll position when new content is inserted is usually very tricky to get right. [Vjeux](http://blog.vjeux.com/) discovered that [componentWillUpdate](http://facebook.github.io/react/docs/component-specs.html#updating-componentwillupdate) and [componentDidUpdate](http://facebook.github.io/react/docs/component-specs.html#updating-componentdidupdate) were triggered exactly at the right time to manage the scroll position.
|
||||
|
||||
> We can check the scroll position before the component has updated with componentWillUpdate and scroll if necessary at componentDidUpdate
|
||||
>
|
||||
@@ -45,10 +45,10 @@ componentDidUpdate: function() {
|
||||
|
||||
## Lights Out
|
||||
|
||||
React declarative approach is well suited to write games. [Cheng Lou](https://github.com/chenglou) wrote the famous Lights Out game in React. It's a good example of use of [TransitionGroup](/react/docs/animation.html) to implement animations.
|
||||
<figure>[](https://chenglou.github.io/react-lights-out/)</figure>
|
||||
React declarative approach is well suited to write games. [Cheng Lou](https://github.com/chenglou) wrote the famous Lights Out game in React. It's a good example of use of [TransitionGroup](http://facebook.github.io/react/docs/animation.html) to implement animations.
|
||||
<figure>[](http://chenglou.github.io/react-lights-out/)</figure>
|
||||
|
||||
[Try it out!](https://chenglou.github.io/react-lights-out/)
|
||||
[Try it out!](http://chenglou.github.io/react-lights-out/)
|
||||
|
||||
|
||||
## Reactive Table Bookmarklet
|
||||
@@ -63,7 +63,9 @@ React declarative approach is well suited to write games. [Cheng Lou](https://gi
|
||||
|
||||
[Ross Allen](https://twitter.com/ssorallen) implemented [MontageJS](http://montagejs.org/)'s [Reddit tutorial](http://montagejs.org/docs/tutorial-reddit-client-with-montagejs.html) in React. This is a good opportunity to compare the philosophies of the two libraries.
|
||||
|
||||
[View the source on JSFiddle...](https://jsfiddle.net/ssorallen/fEsYt/)
|
||||
<iframe width="100%" height="300" src="http://jsfiddle.net/ssorallen/fEsYt/embedded/result,html,js" allowfullscreen="allowfullscreen" frameborder="0"></iframe>
|
||||
|
||||
[View the source on JSFiddle...](http://jsfiddle.net/ssorallen/fEsYt/)
|
||||
|
||||
## Writing Good React Components
|
||||
|
||||
@@ -91,9 +93,9 @@ hoodie new todomvc -t "hoodiehq/hoodie-react-todomvc"
|
||||
## JSX Compiler
|
||||
|
||||
Ever wanted to have a quick way to see what a JSX tag would be converted to? [Tim Yung](http://www.yungsters.com/) made a page for it.
|
||||
<figure>[](/react/jsx-compiler.html)</figure>
|
||||
<figure>[](http://facebook.github.io/react/jsx-compiler.html)</figure>
|
||||
|
||||
[Try it out!](/react/jsx-compiler.html)
|
||||
[Try it out!](http://facebook.github.io/react/jsx-compiler.html)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "Community Round-up #13"
|
||||
author: vjeux
|
||||
author: Vjeux
|
||||
---
|
||||
|
||||
Happy holidays! This blog post is a little-late Christmas present for all the React users. Hopefully it will inspire you to write awesome web apps in 2014!
|
||||
@@ -12,14 +12,14 @@ Happy holidays! This blog post is a little-late Christmas present for all the Re
|
||||
|
||||
<figure><iframe src="//player.vimeo.com/video/79659941" width="220" height="400" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></figure>
|
||||
|
||||
[Try out the demos!](https://petehunt.github.io/react-touch/)
|
||||
[Try out the demos!](http://petehunt.github.io/react-touch/)
|
||||
|
||||
|
||||
## Introduction to React
|
||||
|
||||
[Stoyan Stefanov](http://www.phpied.com/) talked at Joe Dev On Tech about React. He goes over all the features of the library and ends with a concrete example.
|
||||
|
||||
<figure><iframe width="560" height="315" src="//www.youtube-nocookie.com/embed/SMMRJif5QW0" frameborder="0" allowfullscreen></iframe></figure>
|
||||
<figure><iframe width="560" height="315" src="//www.youtube.com/embed/SMMRJif5QW0" frameborder="0" allowfullscreen></iframe></figure>
|
||||
|
||||
|
||||
## JSX: E4X The Good Parts
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
---
|
||||
title: "React Chrome Developer Tools"
|
||||
author: sebmarkbage
|
||||
author: Sebastian Markbåge
|
||||
---
|
||||
|
||||
With the new year, we thought you'd enjoy some new tools for debugging React code. Today we're releasing the [React Developer Tools](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi), an extension to the Chrome Developer Tools. [Download them from the Chrome Web Store](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi).
|
||||
|
||||
<figure><iframe width="560" height="315" src="//www.youtube-nocookie.com/embed/Cey7BS6dE0M" frameborder="0" allowfullscreen></iframe></figure>
|
||||
<figure><iframe width="560" height="315" src="//www.youtube.com/embed/Cey7BS6dE0M" frameborder="0" allowfullscreen></iframe></figure>
|
||||
|
||||
You will get a new tab titled "React" in your Chrome DevTools. This tab shows you a list of the root React Components that are rendered on the page as well as the subcomponents that each root renders.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "Community Round-up #14"
|
||||
author: vjeux
|
||||
author: Vjeux
|
||||
---
|
||||
|
||||
The theme of this first round-up of 2014 is integration. I've tried to assemble a list of articles and projects that use React in various environments.
|
||||
@@ -28,7 +28,7 @@ React is only one-piece of your web application stack. [Mark Lussier](https://gi
|
||||
|
||||
## React Rails Tutorial
|
||||
|
||||
[Selem Delul](http://selem.im) bundled the [React Tutorial](/react/docs/tutorial.html) into a rails app. This is a good example on how to get started with a rails project.
|
||||
[Selem Delul](http://selem.im) bundled the [React Tutorial](http://facebook.github.io/react/docs/tutorial.html) into a rails app. This is a good example on how to get started with a rails project.
|
||||
|
||||
> ```
|
||||
git clone https://github.com/necrodome/react-rails-tutorial
|
||||
@@ -45,7 +45,7 @@ rails s
|
||||
|
||||
[Eldar Djafarov](http://eldar.djafarov.com/) implemented a mixin to link Backbone models to React state and a small abstraction to write two-way binding on-top.
|
||||
|
||||
[View code on JSFiddle](http://jsfiddle.net/djkojb/qZf48/13/)
|
||||
<iframe width="100%" height="300" src="http://jsfiddle.net/djkojb/qZf48/13/embedded/" allowfullscreen="allowfullscreen" frameborder="0"></iframe>
|
||||
|
||||
[Check out the blog post...](http://eldar.djafarov.com/2013/11/reactjs-mixing-with-backbone/)
|
||||
|
||||
@@ -71,7 +71,8 @@ rails s
|
||||
|
||||
[Thomas Aylott](http://subtlegradient.com/) implemented an API that looks like Web Components but using React underneath.
|
||||
|
||||
[View the source on JSFiddle...](http://jsfiddle.net/SubtleGradient/ue2Aa)
|
||||
<iframe width="100%" height="300" src="http://jsfiddle.net/SubtleGradient/ue2Aa/embedded/html,js,result" allowfullscreen="allowfullscreen" frameborder="0"></iframe>
|
||||
|
||||
|
||||
## React vs Angular
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
---
|
||||
title: "Community Round-up #15"
|
||||
author: jgebhardt
|
||||
author: Jonas Gebhardt
|
||||
---
|
||||
|
||||
Interest in React seems to have surged ever since David Nolen ([@swannodette](https://twitter.com/swannodette))'s introduction of [Om](https://github.com/swannodette/om) in his post ["The Future of Javascript MVC Frameworks"](https://swannodette.github.io/2013/12/17/the-future-of-javascript-mvcs/).
|
||||
Interest in React seems to have surged ever since David Nolen ([@swannodette](https://twitter.com/swannodette))'s introduction of [Om](https://github.com/swannodette/om) in his post ["The Future of Javascript MVC Frameworks"](http://swannodette.github.io/2013/12/17/the-future-of-javascript-mvcs/).
|
||||
|
||||
In this React Community Round-up, we are taking a closer look at React from a functional programming perspective.
|
||||
|
||||
@@ -15,13 +15,13 @@ To start things off, Eric Normand ([@ericnormand](https://twitter.com/ericnorman
|
||||
> [Read the full post...](http://www.lispcast.com/react-another-level-of-indirection)
|
||||
|
||||
## Reagent: Minimalistic React for ClojureScript
|
||||
Dan Holmsand ([@holmsand](https://twitter.com/holmsand)) created [Reagent](https://holmsand.github.io/reagent/), a simplistic ClojureScript API to React.
|
||||
Dan Holmsand ([@holmsand](https://twitter.com/holmsand)) created [Reagent](http://holmsand.github.io/reagent/), a simplistic ClojureScript API to React.
|
||||
|
||||
> It allows you to define efficient React components using nothing but plain ClojureScript functions and data, that describe your UI using a Hiccup-like syntax.
|
||||
>
|
||||
> The goal of Reagent is to make it possible to define arbitrarily complex UIs using just a couple of basic concepts, and to be fast enough by default that you rarely have to care about performance.
|
||||
>
|
||||
> [Check it out on Github...](https://holmsand.github.io/reagent/)
|
||||
> [Check it out on Github...](http://holmsand.github.io/reagent/)
|
||||
|
||||
|
||||
## Functional DOM programming
|
||||
@@ -34,7 +34,7 @@ React's one-way data-binding naturally lends itself to a functional programming
|
||||
|
||||
Pete also explains this in detail at his #MeteorDevShop talk (about 30 Minutes):
|
||||
|
||||
<iframe width="560" height="315" src="//www.youtube-nocookie.com/embed/Lqcs6hPOcFw?start=2963" frameborder="0" allowfullscreen></iframe>
|
||||
<iframe width="560" height="315" src="//www.youtube.com/embed/Lqcs6hPOcFw?start=2963" frameborder="0" allowfullscreen></iframe>
|
||||
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ In a separate post, Dyrkell breaks down [how to build a binary clock component](
|
||||
[[Demo](http://www.lexicallyscoped.com/demo/binclock/)] [[Code](https://github.com/fredyr/binclock/blob/master/src/binclock/core.cljs)]
|
||||
|
||||
### Time Travel: Implementing undo in Om
|
||||
David Nolen shows how to leverage immutable data structures to [add global undo](https://swannodette.github.io/2013/12/31/time-travel/) functionality to an app – using just 13 lines of ClojureScript.
|
||||
David Nolen shows how to leverage immutable data structures to [add global undo](http://swannodette.github.io/2013/12/31/time-travel/) functionality to an app – using just 13 lines of ClojureScript.
|
||||
|
||||
### A Step-by-Step Om Walkthrough
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "Community Round-up #16"
|
||||
author: jgebhardt
|
||||
author: Jonas Gebhardt
|
||||
---
|
||||
|
||||
There have been many posts recently covering the <i>why</i> and <i>how</i> of React. This week's community round-up includes a collection of recent articles to help you get started with React, along with a few posts that explain some of the inner workings.
|
||||
@@ -54,7 +54,7 @@ It's great to see the React community expand internationally. [This site](http:/
|
||||
|
||||
### Egghead.io video tutorials
|
||||
|
||||
Joe Maddalone ([@joemaddalone](https://twitter.com/joemaddalone)) of [egghead.io](https://egghead.io/) created a series of React video tutorials, such as [this](http://www.youtube-nocookie.com/watch?v=rFvZydtmsxM&feature=youtu.be&a) introduction to React Components. [[part 1](http://www.youtube-nocookie.com/watch?v=rFvZydtmsxM&feature=youtu.be&a)], [[part 2](http://www.youtube-nocookie.com/watch?v=5yvFLrt7N8M)]
|
||||
Joe Maddalone ([@joemaddalone](https://twitter.com/joemaddalone)) of [egghead.io](https://egghead.io/) created a series of React video tutorials, such as [this](http://www.youtube.com/watch?v=rFvZydtmsxM&feature=youtu.be&a) introduction to React Components. [[part 1](http://www.youtube.com/watch?v=rFvZydtmsxM&feature=youtu.be&a)], [[part 2](http://www.youtube.com/watch?v=5yvFLrt7N8M)]
|
||||
|
||||
### "React: Finally, a great server/client web stack"
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: React v0.9 RC
|
||||
author: spicyj
|
||||
author: Ben Alpert
|
||||
---
|
||||
|
||||
We're almost ready to release React v0.9! We're posting a release candidate so that you can test your apps on it; we'd much prefer to find show-stopping bugs now rather than after we release.
|
||||
@@ -8,13 +8,13 @@ We're almost ready to release React v0.9! We're posting a release candidate so t
|
||||
The release candidate is available for download from the CDN:
|
||||
|
||||
* **React**
|
||||
Dev build with warnings: <https://fb.me/react-0.9.0-rc1.js>
|
||||
Minified build for production: <https://fb.me/react-0.9.0-rc1.min.js>
|
||||
Dev build with warnings: <http://fb.me/react-0.9.0-rc1.js>
|
||||
Minified build for production: <http://fb.me/react-0.9.0-rc1.min.js>
|
||||
* **React with Add-Ons**
|
||||
Dev build with warnings: <https://fb.me/react-with-addons-0.9.0-rc1.js>
|
||||
Minified build for production: <https://fb.me/react-with-addons-0.9.0-rc1.min.js>
|
||||
Dev build with warnings: <http://fb.me/react-with-addons-0.9.0-rc1.js>
|
||||
Minified build for production: <http://fb.me/react-with-addons-0.9.0-rc1.min.js>
|
||||
* **In-Browser JSX transformer**
|
||||
<https://fb.me/JSXTransformer-0.9.0-rc1.js>
|
||||
<http://fb.me/JSXTransformer-0.9.0-rc1.js>
|
||||
|
||||
We've also published version `0.9.0-rc1` of the `react` and `react-tools` packages on npm and the `react` package on bower.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: React v0.9
|
||||
author: spicyj
|
||||
author: Ben Alpert
|
||||
---
|
||||
|
||||
I'm excited to announce that today we're releasing React v0.9, which incorporates many bug fixes and several new features since the last release. This release contains almost four months of work, including over 800 commits from over 70 committers!
|
||||
@@ -10,13 +10,13 @@ Thanks to everyone who tested the release candidate; we were able to find and fi
|
||||
As always, the release is available for download from the CDN:
|
||||
|
||||
* **React**
|
||||
Dev build with warnings: <https://fb.me/react-0.9.0.js>
|
||||
Minified build for production: <https://fb.me/react-0.9.0.min.js>
|
||||
Dev build with warnings: <http://fb.me/react-0.9.0.js>
|
||||
Minified build for production: <http://fb.me/react-0.9.0.min.js>
|
||||
* **React with Add-Ons**
|
||||
Dev build with warnings: <https://fb.me/react-with-addons-0.9.0.js>
|
||||
Minified build for production: <https://fb.me/react-with-addons-0.9.0.min.js>
|
||||
Dev build with warnings: <http://fb.me/react-with-addons-0.9.0.js>
|
||||
Minified build for production: <http://fb.me/react-with-addons-0.9.0.min.js>
|
||||
* **In-Browser JSX Transformer**
|
||||
<https://fb.me/JSXTransformer-0.9.0.js>
|
||||
<http://fb.me/JSXTransformer-0.9.0.js>
|
||||
|
||||
We've also published version `0.9.0` of the `react` and `react-tools` packages on npm and the `react` package on bower.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "Community Round-up #17"
|
||||
author: jgebhardt
|
||||
author: Jonas Gebhardt
|
||||
---
|
||||
|
||||
|
||||
@@ -15,12 +15,12 @@ Large parts of Facebook's web frontend are already powered by React. The recentl
|
||||
Sberbank, Russia's largest bank, recently switched large parts of their site to use React, as detailed in [this post by Vyacheslav Slinko](https://groups.google.com/forum/#!topic/reactjs/Kj6WATX0atg).
|
||||
|
||||
### Relato
|
||||
[Relato](https://bripkens.github.io/relato/) by [Ben Ripkens](https://github.com/bripkens) shows Open Source Statistics based on npm data. It features a filterable and sortable table built in React. Check it out – it's super fast!
|
||||
[Relato](http://bripkens.github.io/relato/) by [Ben Ripkens](https://github.com/bripkens) shows Open Source Statistics based on npm data. It features a filterable and sortable table built in React. Check it out – it's super fast!
|
||||
|
||||
### Makona Editor
|
||||
|
||||
John Lynch ([@johnrlynch](https://twitter.com/johnrlynch)) created Makona, a block-style document editor for the web. Blocks of different content types comprise documents, authored using plain markup. At the switch of a toggle, block contents are then rendered on the page. While not quite a WYSIWYG editor, Makona uses plain textareas for input. This makes it compatible with a wider range of platforms than traditional rich text editors.
|
||||
<figure>[](https://johnthethird.github.io/makona-editor/)</figure>
|
||||
<figure>[](http://johnthethird.github.io/makona-editor/)</figure>
|
||||
|
||||
### Create Chrome extensions using React
|
||||
React is in no way limited to just web pages. Brandon Tilley ([@BinaryMuse](https://twitter.com/BinaryMuse)) just released a detailed walk-through of [how he built his Chrome extension "Fast Tab Switcher" using React](http://brandontilley.com/2014/02/24/creating-chrome-extensions-with-react.html).
|
||||
@@ -40,12 +40,12 @@ Javier Aguirre ([@javaguirre](https://twitter.com/javaguirre)) put together a si
|
||||
|
||||
|
||||
### SVG-based graphical node editor
|
||||
[NoFlo](http://noflojs.org/) and [Meemoo](http://meemoo.org/) developer [Forresto Oliphant](http://www.forresto.com/) built an awesome SVG-based [node editor](https://forresto.github.io/prototyping/react/) in React.
|
||||
<figure>[](https://forresto.github.io/prototyping/react/)</figure>
|
||||
[NoFlo](http://noflojs.org/) and [Meemoo](http://meemoo.org/) developer [Forresto Oliphant](http://www.forresto.com/) built an awesome SVG-based [node editor](http://forresto.github.io/prototyping/react/) in React.
|
||||
<figure>[](http://forresto.github.io/prototyping/react/)</figure>
|
||||
|
||||
|
||||
### Ultimate Tic-Tac-Toe Game in React
|
||||
Rafał Cieślak ([@Ravicious](https://twitter.com/Ravicious)) wrote a [React version](https://ravicious.github.io/ultimate-ttt/) of [Ultimate Tic Tac Toe](http://mathwithbaddrawings.com/2013/06/16/ultimate-tic-tac-toe/). Find the source [here](https://github.com/ravicious/ultimate-ttt).
|
||||
Rafał Cieślak ([@Ravicious](https://twitter.com/Ravicious)) wrote a [React version](http://ravicious.github.io/ultimate-ttt/) of [Ultimate Tic Tac Toe](http://mathwithbaddrawings.com/2013/06/16/ultimate-tic-tac-toe/). Find the source [here](https://github.com/ravicious/ultimate-ttt).
|
||||
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ Rafał Cieślak ([@Ravicious](https://twitter.com/Ravicious)) wrote a [React ver
|
||||
|
||||
Emanuele shared this awesome demo video with us:
|
||||
|
||||
<iframe width="560" height="315" src="//www.youtube-nocookie.com/embed/jYcpaemt90M" frameborder="0" allowfullscreen></iframe>
|
||||
<iframe width="560" height="315" src="//www.youtube.com/embed/jYcpaemt90M" frameborder="0" allowfullscreen></iframe>
|
||||
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ Emanuele shared this awesome demo video with us:
|
||||
|
||||
|
||||
### Table Sorter
|
||||
[Table Sorter](https://bgerm.github.io/react-table-sorter-demo/) by [bgerm](https://github.com/bgerm) [[source](https://github.com/bgerm/react-table-sorter-demo)] is another helpful React component.
|
||||
[Table Sorter](http://bgerm.github.io/react-table-sorter-demo/) by [bgerm](https://github.com/bgerm) [[source](https://github.com/bgerm/react-table-sorter-demo)] is another helpful React component.
|
||||
|
||||
### Static-search
|
||||
|
||||
@@ -83,7 +83,7 @@ Dmitry Chestnykh [@dchest](https://twitter.com/dchest) wrote a [static search in
|
||||
|
||||
## React server rendering
|
||||
|
||||
Ever wonder how to pre-render React components on the server? [react-server-example](https://github.com/mhart/react-server-example) by Michael Hart ([@hichaelmart](https://twitter.com/hichaelmart)) walks through the necessary steps.
|
||||
Ever wonder how to pre-render React components on the server? [react-server-example](https://github.com/mhart/react-server-example) by Michael Hart ([@hichaelmart](http://twitter.com/hichaelmart)) walks through the necessary steps.
|
||||
|
||||
Similarly, Alan deLevie ([@adelevie](https://twitter.com/adelevie)) created [react-client-server-starter](https://github.com/adelevie/react-client-server-starter), another detailed walk-through of how to server-render your app.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "Community Round-up #18"
|
||||
author: jgebhardt
|
||||
author: Jonas Gebhardt
|
||||
---
|
||||
|
||||
In this Round-up, we are taking a few closer looks at React's interplay with different frameworks and architectures.
|
||||
@@ -41,7 +41,7 @@ Thomas Boyt ([@thomasaboyt](https://twitter.com/thomasaboyt)) wrote [this detail
|
||||
|
||||
## React vs. Ember
|
||||
|
||||
Eric Berry ([@coderberry](https://twitter.com/coderberry)) developed Ember equivalents for some of the official React examples. Read his post for a side-by-side comparison of the respective implementations: ["Facebook React vs. Ember"](https://instructure.github.io/blog/2013/12/17/facebook-react-vs-ember/).
|
||||
Eric Berry ([@coderberry](https://twitter.com/coderberry)) developed Ember equivalents for some of the official React examples. Read his post for a side-by-side comparison of the respective implementations: ["Facebook React vs. Ember"](http://instructure.github.io/blog/2013/12/17/facebook-react-vs-ember/).
|
||||
|
||||
|
||||
## React and plain old HTML
|
||||
@@ -75,7 +75,7 @@ Ian Bicking ([@ianbicking](https://twitter.com/ianbicking)) of Mozilla Labs [exp
|
||||
|
||||
React was also recently mentioned at ng-conf, where the Angular team commented on React's concept of the virtual DOM:
|
||||
|
||||
<iframe width="560" height="315" src="//www.youtube-nocookie.com/embed/srt3OBP2kGc?start=113" frameborder="0" allowfullscreen></iframe>
|
||||
<iframe width="560" height="315" src="//www.youtube.com/embed/srt3OBP2kGc?start=113" frameborder="0" allowfullscreen></iframe>
|
||||
|
||||
## React and Web Components
|
||||
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
---
|
||||
title: React v0.10 RC
|
||||
author: zpao
|
||||
author: Paul O’Shannessy
|
||||
---
|
||||
|
||||
[v0.9 has only been out for a month](/react/blog/2014/02/20/react-v0.9.html), but we’re getting ready to push out v0.10 already. Unlike v0.9 which took a long time, we don't have a long list of changes to talk about.
|
||||
[v0.9 has only been out for a month](http://facebook.github.io/react/blog/2014/02/20/react-v0.9.html), but we’re getting ready to push out v0.10 already. Unlike v0.9 which took a long time, we don't have a long list of changes to talk about.
|
||||
|
||||
The release candidate is available for download from the CDN:
|
||||
|
||||
* **React**
|
||||
Dev build with warnings: <https://fb.me/react-0.10.0-rc1.js>
|
||||
Minified build for production: <https://fb.me/react-0.10.0-rc1.min.js>
|
||||
Dev build with warnings: <http://fb.me/react-0.10.0-rc1.js>
|
||||
Minified build for production: <http://fb.me/react-0.10.0-rc1.min.js>
|
||||
* **React with Add-Ons**
|
||||
Dev build with warnings: <https://fb.me/react-with-addons-0.10.0-rc1.js>
|
||||
Minified build for production: <https://fb.me/react-with-addons-0.10.0-rc1.min.js>
|
||||
Dev build with warnings: <http://fb.me/react-with-addons-0.10.0-rc1.js>
|
||||
Minified build for production: <http://fb.me/react-with-addons-0.10.0-rc1.min.js>
|
||||
* **In-Browser JSX transformer**
|
||||
<https://fb.me/JSXTransformer-0.10.0-rc1.js>
|
||||
<http://fb.me/JSXTransformer-0.10.0-rc1.js>
|
||||
|
||||
We've also published version `0.10.0-rc1` of the `react` and `react-tools` packages on npm and the `react` package on bower.
|
||||
|
||||
@@ -24,7 +24,7 @@ Please try these builds out and [file an issue on GitHub](https://github.com/fac
|
||||
|
||||
The main purpose of this release is to provide a smooth upgrade path as we evolve some of the implementation of core. In v0.9 we started warning in cases where you called methods on unmounted components. This is part of an effort to enforce the idea that the return value of a component (`React.DOM.div()`, `MyComponent()`) is in fact not a reference to the component instance React uses in the virtual DOM. The return value is instead a light-weight object that React knows how to use. Since the return value currently is a reference to the same object React uses internally, we need to make this transition in stages as many people have come to depend on this implementation detail.
|
||||
|
||||
In 0.10, we’re adding more warnings to catch a similar set of patterns. When a component is mounted we clone it and use that object for our internal representation. This allows us to capture calls you think you’re making to a mounted component. We’ll forward them on to the right object, but also warn you that this is breaking. See “Access to the Mounted Instance” on [this page](https://fb.me/react-warning-descriptors). Most of the time you can solve your pattern by using refs.
|
||||
In 0.10, we’re adding more warnings to catch a similar set of patterns. When a component is mounted we clone it and use that object for our internal representation. This allows us to capture calls you think you’re making to a mounted component. We’ll forward them on to the right object, but also warn you that this is breaking. See “Access to the Mounted Instance” on [this page](http://fb.me/react-warning-descriptors). Most of the time you can solve your pattern by using refs.
|
||||
|
||||
Storing a reference to your top level component is a pattern touched upon on that page, but another examples that demonstrates what we see a lot of:
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: React v0.10
|
||||
author: zpao
|
||||
author: Paul O’Shannessy
|
||||
---
|
||||
|
||||
Hot on the heels of the [release candidate earlier this week](/react/blog/2014/03/19/react-v0.10-rc1.html), we're ready to call v0.10 done. The only major issue we discovered had to do with the `react-tools` package, which has been updated. We've copied over the changelog from the RC with some small clarifying changes.
|
||||
@@ -8,13 +8,13 @@ Hot on the heels of the [release candidate earlier this week](/react/blog/2014/0
|
||||
The release is available for download from the CDN:
|
||||
|
||||
* **React**
|
||||
Dev build with warnings: <https://fb.me/react-0.10.0.js>
|
||||
Minified build for production: <https://fb.me/react-0.10.0.min.js>
|
||||
Dev build with warnings: <http://fb.me/react-0.10.0.js>
|
||||
Minified build for production: <http://fb.me/react-0.10.0.min.js>
|
||||
* **React with Add-Ons**
|
||||
Dev build with warnings: <https://fb.me/react-with-addons-0.10.0.js>
|
||||
Minified build for production: <https://fb.me/react-with-addons-0.10.0.min.js>
|
||||
Dev build with warnings: <http://fb.me/react-with-addons-0.10.0.js>
|
||||
Minified build for production: <http://fb.me/react-with-addons-0.10.0.min.js>
|
||||
* **In-Browser JSX transformer**
|
||||
<https://fb.me/JSXTransformer-0.10.0.js>
|
||||
<http://fb.me/JSXTransformer-0.10.0.js>
|
||||
|
||||
We've also published version `0.10.0` of the `react` and `react-tools` packages on npm and the `react` package on bower.
|
||||
|
||||
@@ -24,7 +24,7 @@ Please try these builds out and [file an issue on GitHub](https://github.com/fac
|
||||
|
||||
The main purpose of this release is to provide a smooth upgrade path as we evolve some of the implementation of core. In v0.9 we started warning in cases where you called methods on unmounted components. This is part of an effort to enforce the idea that the return value of a component (`React.DOM.div()`, `MyComponent()`) is in fact not a reference to the component instance React uses in the virtual DOM. The return value is instead a light-weight object that React knows how to use. Since the return value currently is a reference to the same object React uses internally, we need to make this transition in stages as many people have come to depend on this implementation detail.
|
||||
|
||||
In 0.10, we’re adding more warnings to catch a similar set of patterns. When a component is mounted we clone it and use that object for our internal representation. This allows us to capture calls you think you’re making to a mounted component. We’ll forward them on to the right object, but also warn you that this is breaking. See “Access to the Mounted Instance” on [this page](https://fb.me/react-warning-descriptors). Most of the time you can solve your pattern by using refs.
|
||||
In 0.10, we’re adding more warnings to catch a similar set of patterns. When a component is mounted we clone it and use that object for our internal representation. This allows us to capture calls you think you’re making to a mounted component. We’ll forward them on to the right object, but also warn you that this is breaking. See “Access to the Mounted Instance” on [this page](http://fb.me/react-warning-descriptors). Most of the time you can solve your pattern by using refs.
|
||||
|
||||
Storing a reference to your top level component is a pattern touched upon on that page, but another examples that demonstrates what we see a lot of:
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: The Road to 1.0
|
||||
author: zpao
|
||||
author: Paul O'Shannessy
|
||||
---
|
||||
|
||||
When we launched React last spring, we purposefully decided not to call it 1.0. It was production ready, but we had plans to evolve APIs and behavior as we saw how people were using React, both internally and externally. We've learned a lot over the past 9 months and we've thought a lot about what 1.0 will mean for React. A couple weeks ago, I outlined [several projects][projects] that we have planned to take us to 1.0 and beyond. Today I'm writing a bit more about them to give our users a better insight into our plans.
|
||||
@@ -51,6 +51,6 @@ Finding a way to define animations in a declarative way is a hard problem. We've
|
||||
|
||||
There are several other things I listed on [our projects page][projects] that we're tracking. Some of them are internals and have no obvious outward effect (improve tests, repo separation, updated test runner). I encourage you to take a look.
|
||||
|
||||
[v0.10]: /react/blog/2014/03/21/react-v0.10.html
|
||||
[v0.10]: http://facebook.github.io/react/blog/2014/03/21/react-v0.10.html
|
||||
[pitofsuccess]: http://blog.codinghorror.com/falling-into-the-pit-of-success/
|
||||
[projects]: https://github.com/facebook/react/wiki/Projects
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "Use React and JSX in ASP.NET MVC"
|
||||
author: Daniel15
|
||||
author: Daniel Lo Nigro
|
||||
---
|
||||
|
||||
Today we're happy to announce the initial release of
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
---
|
||||
title: "Flux: An Application Architecture for React"
|
||||
author: fisherwebdevandjing
|
||||
author: Bill Fisher and Jing Chen
|
||||
---
|
||||
|
||||
We recently spoke at one of f8's breakout session about Flux, a data flow architecture that works well with React. Check out the video here:
|
||||
|
||||
<figure><iframe width="560" height="315" src="//www.youtube-nocookie.com/embed/nYkdrAPrdcw?list=PLb0IAmt7-GS188xDYE-u1ShQmFFGbrk0v&start=621" frameborder="0" allowfullscreen></iframe></figure>
|
||||
<figure><iframe width="560" height="315" src="//www.youtube.com/embed/nYkdrAPrdcw?list=PLb0IAmt7-GS188xDYE-u1ShQmFFGbrk0v&start=621" frameborder="0" allowfullscreen></iframe></figure>
|
||||
|
||||
To summarize, Flux works well for us because the single directional data flow makes it easy to understand and modify an application as it becomes more complicated. We found that two-way data bindings lead to cascading updates, where changing one data model led to another data model updating, making it very difficult to predict what would change as the result of a single user interaction.
|
||||
|
||||
@@ -13,4 +13,4 @@ In Flux, the Dispatcher is a singleton that directs the flow of data and ensures
|
||||
|
||||
When a user interacts with a React view, the view sends an action (usually represented as a JavaScript object with some fields) through the dispatcher, which notifies the various stores that hold the application's data and business logic. When the stores change state, they notify the views that something has updated. This works especially well with React's declarative model, which allows the stores to send updates without specifying how to transition views between states.
|
||||
|
||||
Flux is more of a pattern than a formal framework, so you can start using Flux immediately without a lot of new code. An [example of this architecture](https://github.com/facebook/flux/tree/master/examples/flux-todomvc) is available, along with more [detailed documentation](https://facebook.github.io/flux/docs/overview.html) and a [tutorial](https://facebook.github.io/flux/docs/todo-list.html). Look for more examples to come in the future.
|
||||
Flux is more of a pattern than a formal framework, so you can start using Flux immediately without a lot of new code. An [example of this architecture](https://github.com/facebook/flux/tree/master/examples/flux-todomvc) is available, along with more [detailed documentation](http://facebook.github.io/flux/docs/overview.html) and a [tutorial](http://facebook.github.io/flux/docs/todo-list.html). Look for more examples to come in the future.
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
---
|
||||
title: "One Year of Open-Source React"
|
||||
author: chenglou
|
||||
author: Cheng Lou
|
||||
---
|
||||
|
||||
Today marks the one-year open-source anniversary of React.
|
||||
|
||||
It’s been a crazy ride. 2.3k commits and 1.5k issues and pull requests later, we’re approaching version 1.0 and nearing 7k Github stars, with big names such as Khan Academy, New York Times, and Airbnb (and naturally, Facebook and Instagram) using React in production, and many more developers blogging their success stories with it. The [roadmap](/react/blog/2014/03/28/the-road-to-1.0.html) gives a glimpse into the future of the library; exciting stuff lies ahead!
|
||||
It’s been a crazy ride. 2.3k commits and 1.5k issues and pull requests later, we’re approaching version 1.0 and nearing 7k Github stars, with big names such as Khan Academy, New York Times, and Airbnb (and naturally, Facebook and Instagram) using React in production, and many more developers blogging their success stories with it. The [roadmap](http://facebook.github.io/react/blog/2014/03/28/the-road-to-1.0.html) gives a glimpse into the future of the library; exciting stuff lies ahead!
|
||||
|
||||
Every success has its story. React was born out of our frustration at existing solutions for building UIs. When it was first suggested at Facebook, few people thought that functionally re-rendering everything and diffing the results could ever perform well. However, support grew after we built the first implementation and people wrote their first components. When we open-sourced React, the initial reception was [similarly skeptical](https://www.reddit.com/r/programming/comments/1fak87/react_facebooks_latest_javascript_client_library/). It challenges many pre-established conventions and received mostly disapproving first-impressions, intermingled with positive ones that often were votes of confidence in Facebook’s engineering capabilities. On an open, competitive platform such as the web, it's been hard to convince people to try React. [JSX](/react/docs/jsx-in-depth.html), in particular, filtered out a huge chunk of potential early adopters.
|
||||
Every success has its story. React was born out of our frustration at existing solutions for building UIs. When it was first suggested at Facebook, few people thought that functionally re-rendering everything and diffing the results could ever perform well. However, support grew after we built the first implementation and people wrote their first components. When we open-sourced React, the initial reception was [similarly skeptical](http://www.reddit.com/r/programming/comments/1fak87/react_facebooks_latest_javascript_client_library/). It challenges many pre-established conventions and received mostly disapproving first-impressions, intermingled with positive ones that often were votes of confidence in Facebook’s engineering capabilities. On an open, competitive platform such as the web, it's been hard to convince people to try React. [JSX](http://facebook.github.io/react/docs/jsx-in-depth.html), in particular, filtered out a huge chunk of potential early adopters.
|
||||
|
||||
Fast forward one year, React has strongly [grown in popularity](https://news.ycombinator.com/item?id=7489959). Special acknowledgments go to Khan Academy, the ClojureScript community, and established frameworks such as Ember and Angular for contributing to and debating on our work. We'd also like to thank all the [individual contributors](https://github.com/facebook/react/graphs/contributors) who have taken the time to help out over the past year. React, as a library and as a new paradigm on the web, wouldn't have gained as much traction without them. In the future, we will continue to try to set an example of what's possible to achieve when we rethink about current “best practices”.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "Community Round-up #19"
|
||||
author: chenglou
|
||||
author: Cheng Lou
|
||||
---
|
||||
|
||||
## React Meetups!
|
||||
@@ -13,7 +13,7 @@ In case you haven't seen it, we've consolidated the tooling solution around Reac
|
||||
|
||||
- [Ryan Florence](https://github.com/rpflorence) and [Michael Jackson](https://github.com/mjackson)'s [react-nested-router](https://github.com/rpflorence/react-nested-router), which is a translation of the Ember router API to React.
|
||||
|
||||
- [Stephen J. Collings](https://github.com/stevoland)'s [react-bootstrap](https://github.com/react-bootstrap/react-bootstrap), which wraps the popular framework with a bit of React goodness. The [website](https://react-bootstrap.github.io/components.html) features live-editable demos.
|
||||
- [Stephen J. Collings](https://github.com/stevoland)'s [react-bootstrap](https://github.com/react-bootstrap/react-bootstrap), which wraps the popular framework with a bit of React goodness. The [website](http://react-bootstrap.github.io/components.html) features live-editable demos.
|
||||
|
||||
- [Andrey Popp](https://github.com/andreypopp)'s [react-quickstart](https://github.com/andreypopp/react-quickstart), which gives you a quick template for server-side rendering and routing, among other features.
|
||||
|
||||
@@ -23,7 +23,7 @@ These are some of the links that often pop up on the #reactjs IRC channel. If yo
|
||||
|
||||
The core concepts React themselves is something very valuable that the community is exploring and pushing further. A year ago, we wouldn't have imagined something like [Bruce Hauman](http://rigsomelight.com)'s [Flappy Bird ClojureScript port](http://rigsomelight.com/2014/05/01/interactive-programming-flappy-bird-clojurescript.html), whose interactive programming has been made possible through React:
|
||||
|
||||
<iframe width="560" height="315" src="//www.youtube-nocookie.com/embed/KZjFVdU8VLI" frameborder="0" allowfullscreen></iframe>
|
||||
<iframe width="560" height="315" src="//www.youtube.com/embed/KZjFVdU8VLI" frameborder="0" allowfullscreen></iframe>
|
||||
|
||||
And don't forget [Pete Hunt](https://github.com/petehunt)'s Wolfenstein 3D rendering engine in React ([source code](https://github.com/petehunt/wolfenstein3D-react/blob/master/js/renderer.js#L183)). While it's nearly a year old, it's still a nice demo.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: React v0.11 RC
|
||||
author: zpao
|
||||
author: Paul O’Shannessy
|
||||
---
|
||||
|
||||
It's that time again… we're just about ready to ship a new React release! v0.11 includes a wide array of bug fixes and features. We highlighted some of the most important changes below, along with the full changelog.
|
||||
@@ -8,13 +8,13 @@ It's that time again… we're just about ready to ship a new React release! v0.1
|
||||
The release candidate is available for download from the CDN:
|
||||
|
||||
* **React**
|
||||
Dev build with warnings: <https://fb.me/react-0.11.0-rc1.js>
|
||||
Minified build for production: <https://fb.me/react-0.11.0-rc1.min.js>
|
||||
Dev build with warnings: <http://fb.me/react-0.11.0-rc1.js>
|
||||
Minified build for production: <http://fb.me/react-0.11.0-rc1.min.js>
|
||||
* **React with Add-Ons**
|
||||
Dev build with warnings: <https://fb.me/react-with-addons-0.11.0-rc1.js>
|
||||
Minified build for production: <https://fb.me/react-with-addons-0.11.0-rc1.min.js>
|
||||
Dev build with warnings: <http://fb.me/react-with-addons-0.11.0-rc1.js>
|
||||
Minified build for production: <http://fb.me/react-with-addons-0.11.0-rc1.min.js>
|
||||
* **In-Browser JSX transformer**
|
||||
<https://fb.me/JSXTransformer-0.11.0-rc1.js>
|
||||
<http://fb.me/JSXTransformer-0.11.0-rc1.js>
|
||||
|
||||
We've also published version `0.11.0-rc1` of the `react` and `react-tools` packages on npm and the `react` package on bower.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: React v0.11
|
||||
author: zpao
|
||||
author: Paul O’Shannessy
|
||||
---
|
||||
|
||||
**Update:** We missed a few important changes in our initial post and changelog. We've updated this post with details about [Descriptors](#descriptors) and [Prop Type Validation](#prop-type-validation).
|
||||
@@ -15,13 +15,13 @@ This version has been cooking for a couple months now and includes a wide array
|
||||
The release is available for download from the CDN:
|
||||
|
||||
* **React**
|
||||
Dev build with warnings: <https://fb.me/react-0.11.0.js>
|
||||
Minified build for production: <https://fb.me/react-0.11.0.min.js>
|
||||
Dev build with warnings: <http://fb.me/react-0.11.0.js>
|
||||
Minified build for production: <http://fb.me/react-0.11.0.min.js>
|
||||
* **React with Add-Ons**
|
||||
Dev build with warnings: <https://fb.me/react-with-addons-0.11.0.js>
|
||||
Minified build for production: <https://fb.me/react-with-addons-0.11.0.min.js>
|
||||
Dev build with warnings: <http://fb.me/react-with-addons-0.11.0.js>
|
||||
Minified build for production: <http://fb.me/react-with-addons-0.11.0.min.js>
|
||||
* **In-Browser JSX transformer**
|
||||
<https://fb.me/JSXTransformer-0.11.0.js>
|
||||
<http://fb.me/JSXTransformer-0.11.0.js>
|
||||
|
||||
We've also published version `0.11.0` of the `react` and `react-tools` packages on npm and the `react` package on bower.
|
||||
|
||||
@@ -100,7 +100,7 @@ Keyboard and mouse events also now include a normalized `e.getModifierState()` t
|
||||
|
||||
## Descriptors
|
||||
|
||||
In our [v0.10 release notes](/react/blog/2014/03/21/react-v0.10.html#clone-on-mount), we called out that we were deprecating the existing behavior of the component function call (eg `component = MyComponent(props, ...children)` or `component = <MyComponent prop={...}/>`). Previously that would create an instance and React would modify that internally. You could store that reference and then call functions on it (eg `component.setProps(...)`). This no longer works. `component` in the above examples will be a descriptor and not an instance that can be operated on. The v0.10 release notes provide a complete example along with a migration path. The development builds also provided warnings if you called functions on descriptors.
|
||||
In our [v0.10 release notes](http://facebook.github.io/react/blog/2014/03/21/react-v0.10.html#clone-on-mount), we called out that we were deprecating the existing behavior of the component function call (eg `component = MyComponent(props, ...children)` or `component = <MyComponent prop={...}/>`). Previously that would create an instance and React would modify that internally. You could store that reference and then call functions on it (eg `component.setProps(...)`). This no longer works. `component` in the above examples will be a descriptor and not an instance that can be operated on. The v0.10 release notes provide a complete example along with a migration path. The development builds also provided warnings if you called functions on descriptors.
|
||||
|
||||
Along with this change to descriptors, `React.isValidComponent` and `React.PropTypes.component` now actually validate that the value is a descriptor. Overwhelmingly, these functions are used to validate the value of `MyComponent()`, which as mentioned is now a descriptor, not a component instance. We opted to reduce code churn and make the migration to 0.11 as easy as possible. However, we realize this is has caused some confusion and we're working to make sure we are consistent with our terminology.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: React v0.11.1
|
||||
author: zpao
|
||||
author: Paul O’Shannessy
|
||||
---
|
||||
|
||||
Today we're releasing React v0.11.1 to address a few small issues. Thanks to everybody who has reported them as they've begun upgrading.
|
||||
@@ -16,13 +16,13 @@ We'd also like to call out a couple additional breaking changes that we failed t
|
||||
The release is available for download from the CDN:
|
||||
|
||||
* **React**
|
||||
Dev build with warnings: <https://fb.me/react-0.11.1.js>
|
||||
Minified build for production: <https://fb.me/react-0.11.1.min.js>
|
||||
Dev build with warnings: <http://fb.me/react-0.11.1.js>
|
||||
Minified build for production: <http://fb.me/react-0.11.1.min.js>
|
||||
* **React with Add-Ons**
|
||||
Dev build with warnings: <https://fb.me/react-with-addons-0.11.1.js>
|
||||
Minified build for production: <https://fb.me/react-with-addons-0.11.1.min.js>
|
||||
Dev build with warnings: <http://fb.me/react-with-addons-0.11.1.js>
|
||||
Minified build for production: <http://fb.me/react-with-addons-0.11.1.min.js>
|
||||
* **In-Browser JSX transformer**
|
||||
<https://fb.me/JSXTransformer-0.11.1.js>
|
||||
<http://fb.me/JSXTransformer-0.11.1.js>
|
||||
|
||||
We've also published version `0.11.1` of the `react` and `react-tools` packages on npm and the `react` package on bower.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "Community Round-up #20"
|
||||
author: LoukaN
|
||||
author: Lou Husson
|
||||
---
|
||||
|
||||
It's an exciting time for React as there are now more commits from open source contributors than from Facebook engineers! Keep up the good work :)
|
||||
@@ -9,19 +9,19 @@ It's an exciting time for React as there are now more commits from open source c
|
||||
|
||||
[Atom, GitHub's code editor, is now using React](http://blog.atom.io/2014/07/02/moving-atom-to-react.html) to build the editing experience. They made the move in order to improve performance. By default, React helped them eliminate unnecessary reflows, enabling them to focus on architecting the rendering pipeline in order to minimize repaints by using hardware acceleration. This is a testament to the fact that React's architecture is perfect for high performant applications.
|
||||
|
||||
[<img src="/react/img/blog/gpu-cursor-move.gif" style="width: 100%;" />](http://blog.atom.io/2014/07/02/moving-atom-to-react.html)
|
||||
[<img src="http://blog.atom.io/img/posts/gpu-cursor-move.gif" style="width: 100%;" />](http://blog.atom.io/2014/07/02/moving-atom-to-react.html)
|
||||
|
||||
|
||||
## Why Does React Scale?
|
||||
|
||||
At the last [JSConf.us](http://2014.jsconf.us/), Vjeux talked about the design decisions made in the API that allows it to scale to a large number of developers. If you don't have 20 minutes, take a look at the [annotated slides](https://speakerdeck.com/vjeux/why-does-react-scale-jsconf-2014).
|
||||
|
||||
<iframe width="650" height="315" src="//www.youtube-nocookie.com/embed/D-ioDiacTm8" frameborder="0" allowfullscreen></iframe>
|
||||
<iframe width="650" height="315" src="//www.youtube.com/embed/D-ioDiacTm8" frameborder="0" allowfullscreen></iframe>
|
||||
|
||||
|
||||
## Live Editing
|
||||
|
||||
One of the best features of React is that it provides the foundations to implement concepts that were otherwise extremely difficult, like server-side rendering, undo-redo, rendering to non-DOM environments like canvas... [Dan Abramov](https://twitter.com/dan_abramov) got hot code reloading working with webpack in order to [live edit a React project](https://gaearon.github.io/react-hot-loader/)!
|
||||
One of the best features of React is that it provides the foundations to implement concepts that were otherwise extremely difficult, like server-side rendering, undo-redo, rendering to non-DOM environments like canvas... [Dan Abramov](https://twitter.com/dan_abramov) got hot code reloading working with webpack in order to [live edit a React project](http://gaearon.github.io/react-hot-loader/)!
|
||||
|
||||
<iframe src="//player.vimeo.com/video/100010922" width="650" height="315" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
|
||||
|
||||
@@ -63,7 +63,7 @@ If you missed the last [London React Meetup](http://www.meetup.com/London-React-
|
||||
- React on Rails - How to use React with Ruby on Rails to build isomorphic apps
|
||||
- Building an isomorphic, real-time to-do list with moped and node.js
|
||||
|
||||
<iframe width="650" height="315" src="//www.youtube-nocookie.com/embed/CP3lvm5Ppqo" frameborder="0" allowfullscreen></iframe>
|
||||
<iframe width="650" height="315" src="//www.youtube.com/embed/CP3lvm5Ppqo" frameborder="0" allowfullscreen></iframe>
|
||||
|
||||
In related news, the next [React SF Meetup](http://www.meetup.com/ReactJS-San-Francisco/events/195518392/) will be from Prezi: [“Immediate Mode on the Web: How We Implemented the Prezi Viewer in JavaScript”](https://medium.com/prezi-engineering/how-and-why-prezi-turned-to-javascript-56e0ca57d135). While not in React, their tech is really awesome and shares a lot of React's design principles and perf optimizations.
|
||||
|
||||
@@ -112,3 +112,4 @@ var Foo = React.createClass({
|
||||
## Random Tweet
|
||||
|
||||
<blockquote class="twitter-tweet" data-conversation="none" lang="en"><p>“<a href="https://twitter.com/apphacker">@apphacker</a>: I take back the mean things I said about <a href="https://twitter.com/reactjs">@reactjs</a> I actually like it.” Summarizing the life of ReactJS in a single tweet.</p>— Jordan (@jordwalke) <a href="https://twitter.com/jordwalke/statuses/490747339607265280">July 20, 2014</a></blockquote>
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
---
|
||||
title: "Flux: Actions and the Dispatcher"
|
||||
author: fisherwebdev
|
||||
author: Bill Fisher
|
||||
---
|
||||
|
||||
Flux is the application architecture Facebook uses to build JavaScript applications. It's based on a unidirectional data flow. We've built everything from small widgets to huge applications with Flux, and it's handled everything we've thrown at it. Because we've found it to be a great way to structure our code, we're excited to share it with the open source community. [Jing Chen presented Flux](http://youtu.be/nYkdrAPrdcw?t=10m20s) at the F8 conference, and since that time we've seen a lot of interest in it. We've also published an [overview of Flux](https://facebook.github.io/flux/docs/overview.html) and a [TodoMVC example](https://github.com/facebook/flux/tree/master/examples/flux-todomvc/), with an accompanying [tutorial](https://facebook.github.io/flux/docs/todo-list.html).
|
||||
Flux is the application architecture Facebook uses to build JavaScript applications. It's based on a unidirectional data flow. We've built everything from small widgets to huge applications with Flux, and it's handled everything we've thrown at it. Because we've found it to be a great way to structure our code, we're excited to share it with the open source community. [Jing Chen presented Flux](http://youtu.be/nYkdrAPrdcw?t=10m20s) at the F8 conference, and since that time we've seen a lot of interest in it. We've also published an [overview of Flux](http://facebook.github.io/flux/docs/overview.html) and a [TodoMVC example](https://github.com/facebook/flux/tree/master/examples/flux-todomvc/), with an accompanying [tutorial](http://facebook.github.io/flux/docs/todo-list.html).
|
||||
|
||||
Flux is more of a pattern than a full-blown framework, and you can start using it without a lot of new code beyond React. Up until recently, however, we haven't released one crucial piece of our Flux software: the dispatcher. But along with the creation of the new [Flux code repository](https://github.com/facebook/flux) and [Flux website](https://facebook.github.io/flux/), we've now open sourced the same [dispatcher](https://facebook.github.io/flux/docs/dispatcher.html) we use in our production applications.
|
||||
Flux is more of a pattern than a full-blown framework, and you can start using it without a lot of new code beyond React. Up until recently, however, we haven't released one crucial piece of our Flux software: the dispatcher. But along with the creation of the new [Flux code repository](https://github.com/facebook/flux) and [Flux website](http://facebook.github.io/flux/), we've now open sourced the same [dispatcher](http://facebook.github.io/flux/docs/dispatcher.html) we use in our production applications.
|
||||
|
||||
|
||||
Where the Dispatcher Fits in the Flux Data Flow
|
||||
@@ -21,7 +21,7 @@ When new data enters the system, whether through a person interacting with the a
|
||||
|
||||
Different actions are identified by a type attribute. When all of the stores receive the action, they typically use this attribute to determine if and how they should respond to it. In a Flux application, both stores and views control themselves; they are not acted upon by external objects. Actions flow into the stores through the callbacks they define and register, not through setter methods.
|
||||
|
||||
Letting the stores update themselves eliminates many entanglements typically found in MVC applications, where cascading updates between models can lead to unstable state and make accurate testing very difficult. The objects within a Flux application are highly decoupled, and adhere very strongly to the [Law of Demeter](https://en.wikipedia.org/wiki/Law_of_Demeter), the principle that each object within a system should know as little as possible about the other objects in the system. This results in software that is more maintainable, adaptable, testable, and easier for new engineering team members to understand.
|
||||
Letting the stores update themselves eliminates many entanglements typically found in MVC applications, where cascading updates between models can lead to unstable state and make accurate testing very difficult. The objects within a Flux application are highly decoupled, and adhere very strongly to the [Law of Demeter](http://en.wikipedia.org/wiki/Law_of_Demeter), the principle that each object within a system should know as little as possible about the other objects in the system. This results in software that is more maintainable, adaptable, testable, and easier for new engineering team members to understand.
|
||||
|
||||
<img src="/react/img/blog/flux-diagram.png" style="width: 100%;" />
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
---
|
||||
title: "Community Round-up #21"
|
||||
author: LoukaN
|
||||
author: Lou Husson
|
||||
---
|
||||
|
||||
## React Router
|
||||
[Ryan Florence](http://ryanflorence.com/) and [Michael Jackson](https://twitter.com/mjackson) ported Ember's router to React in a project called [React Router](https://github.com/rackt/react-router). This is a very good example of both communities working together to make the web better!
|
||||
[Ryan Florence](http://ryanflorence.com/) and [Michael Jackson](http://twitter.com/mjackson) ported Ember's router to React in a project called [React Router](https://github.com/rackt/react-router). This is a very good example of both communities working together to make the web better!
|
||||
|
||||
```javascript
|
||||
React.renderComponent((
|
||||
@@ -16,7 +16,7 @@ React.renderComponent((
|
||||
</Route>
|
||||
</Route>
|
||||
</Routes>
|
||||
), document.getElementById('example'));
|
||||
), document.body);
|
||||
```
|
||||
|
||||
## Going Big with React
|
||||
@@ -49,7 +49,7 @@ Areeb Malik, from Facebook, talks about his experience using React. "On paper, a
|
||||
|
||||
## Referencing Dynamic Children
|
||||
|
||||
While Matt Zabriskie was working on [react-tabs](https://www.npmjs.com/package/react-tabs) he discovered how to use React.Children.map and React.addons.cloneWithProps in order to [reference dynamic children](http://www.mattzabriskie.com/blog/react-referencing-dynamic-children).
|
||||
While Matt Zabriskie was working on [react-tabs](https://www.npmjs.org/package/react-tabs) he discovered how to use React.Children.map and React.addons.cloneWithProps in order to [reference dynamic children](http://www.mattzabriskie.com/blog/react-referencing-dynamic-children).
|
||||
|
||||
```javascript
|
||||
var App = React.createClass({
|
||||
@@ -83,12 +83,12 @@ Have you ever wondered how JSX was implemented? James Long wrote a very instruct
|
||||
|
||||
[Matt Zabriskie](https://github.com/mzabriskie) released a [project](https://github.com/mzabriskie/react-draggable) to make your react components draggable.
|
||||
|
||||
[](https://mzabriskie.github.io/react-draggable/example/)
|
||||
[](http://mzabriskie.github.io/react-draggable/example/)
|
||||
|
||||
|
||||
## HTML Parser2 React
|
||||
|
||||
[Jason Brown](https://browniefed.github.io/) adapted htmlparser2 to React: [htmlparser2-react](https://www.npmjs.com/package/htmlparser2-react). That allows you to convert raw HTML to the virtual DOM.
|
||||
[Jason Brown](http://browniefed.github.io/) adapted htmlparser2 to React: [htmlparser2-react](https://www.npmjs.org/package/htmlparser2-react). That allows you to convert raw HTML to the virtual DOM.
|
||||
This is not the intended way to use React but can be useful as last resort if you have an existing piece of HTML.
|
||||
|
||||
```javascript
|
||||
@@ -104,7 +104,7 @@ var parsedComponent = reactParser(html, React);
|
||||
|
||||
If you haven't yet tried out React, Jacob Rios did a Hangout where he covers the most important aspects and thankfully he recorded it!
|
||||
|
||||
<iframe width="650" height="315" src="//www.youtube-nocookie.com/embed/lAn7GVoGlKU" frameborder="0" allowfullscreen></iframe>
|
||||
<iframe width="650" height="315" src="//www.youtube.com/embed/lAn7GVoGlKU" frameborder="0" allowfullscreen></iframe>
|
||||
|
||||
|
||||
## Random Tweets
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
---
|
||||
title: "Introducing the JSX Specification"
|
||||
author: sebmarkbage
|
||||
author: Sebastian Markbåge
|
||||
---
|
||||
|
||||
At Facebook we've been using JSX for a long time. We originally introduced it to the world last year alongside React, but we actually used it in another form before that to create native DOM nodes. We've also seen some similar efforts grow out of our work in order to be used with other libraries and in interesting ways. At this point React JSX is just one of many implementations.
|
||||
|
||||
In order to make it easier to implement new versions and to make sure that the syntax remains compatible, we're now formalizing the syntax of JSX in a stand-alone spec without any semantic meaning. It's completely stand-alone from React itself.
|
||||
|
||||
Read the spec now at <https://facebook.github.io/jsx/>.
|
||||
Read the spec now at <http://facebook.github.io/jsx/>.
|
||||
|
||||
This is not a proposal to be standardized in ECMAScript. It's just a reference document that transpiler writers and syntax highlighters can agree on. It's currently in a draft stage and will probably continue to be a living document.
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: "Community Round-up #22"
|
||||
layout: post
|
||||
author: LoukaN
|
||||
author: Lou Husson
|
||||
---
|
||||
|
||||
This has been an exciting summer as four big companies: Yahoo, Mozilla, Airbnb and Reddit announced that they were using React!
|
||||
@@ -20,7 +20,7 @@ This has been an exciting summer as four big companies: Yahoo, Mozilla, Airbnb a
|
||||
|
||||
[Vjeux](http://blog.vjeux.com/), from the React team, gave a talk at OSCON on the history of React and the various optimizations strategies that are implemented. You can also check out the [annotated slides](https://speakerdeck.com/vjeux/oscon-react-architecture) or [Chris Dawson](http://thenewstack.io/author/chrisdawson/)'s notes titled [JavaScript’s History and How it Led To React](http://thenewstack.io/javascripts-history-and-how-it-led-to-reactjs/).
|
||||
|
||||
<iframe width="650" height="315" src="//www.youtube-nocookie.com/embed/eCf5CquV_Bw" frameborder="0" allowfullscreen></iframe>
|
||||
<iframe width="650" height="315" src="//www.youtube.com/embed/eCf5CquV_Bw" frameborder="0" allowfullscreen></iframe>
|
||||
|
||||
|
||||
## v8 optimizations
|
||||
@@ -30,7 +30,7 @@ Jakob Kummerow landed [two optimizations to V8](http://www.chromium.org/develope
|
||||
|
||||
## Reusable Components by Khan Academy
|
||||
|
||||
[Khan Academy](https://www.khanacademy.org/) released [many high quality standalone components](https://khan.github.io/react-components/) they are using. This is a good opportunity to see what React code used in production look like.
|
||||
[Khan Academy](https://www.khanacademy.org/) released [many high quality standalone components](http://khan.github.io/react-components/) they are using. This is a good opportunity to see what React code used in production look like.
|
||||
|
||||
```javascript
|
||||
var TeX = require('react-components/js/tex.jsx');
|
||||
@@ -89,7 +89,7 @@ var Button = React.createClass({
|
||||
|
||||
If you are getting started with React, [Joe Maddalone](http://www.joemaddalone.com/) made a good tutorial on how to build your first component.
|
||||
|
||||
<iframe width="650" height="200" src="//www.youtube-nocookie.com/embed/rFvZydtmsxM" frameborder="0" allowfullscreen></iframe>
|
||||
<iframe width="650" height="200" src="//www.youtube.com/embed/rFvZydtmsxM" frameborder="0" allowfullscreen></iframe>
|
||||
|
||||
|
||||
## Saving time & staying sane?
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: React v0.11.2
|
||||
author: zpao
|
||||
author: Paul O’Shannessy
|
||||
---
|
||||
|
||||
Today we're releasing React v0.11.2 to add a few small features.
|
||||
@@ -14,13 +14,13 @@ And lastly, on the heels of announcing Flow at [@Scale](http://atscaleconference
|
||||
The release is available for download from the CDN:
|
||||
|
||||
* **React**
|
||||
Dev build with warnings: <https://fb.me/react-0.11.2.js>
|
||||
Minified build for production: <https://fb.me/react-0.11.2.min.js>
|
||||
Dev build with warnings: <http://fb.me/react-0.11.2.js>
|
||||
Minified build for production: <http://fb.me/react-0.11.2.min.js>
|
||||
* **React with Add-Ons**
|
||||
Dev build with warnings: <https://fb.me/react-with-addons-0.11.2.js>
|
||||
Minified build for production: <https://fb.me/react-with-addons-0.11.2.min.js>
|
||||
Dev build with warnings: <http://fb.me/react-with-addons-0.11.2.js>
|
||||
Minified build for production: <http://fb.me/react-with-addons-0.11.2.min.js>
|
||||
* **In-Browser JSX transformer**
|
||||
<https://fb.me/JSXTransformer-0.11.2.js>
|
||||
<http://fb.me/JSXTransformer-0.11.2.js>
|
||||
|
||||
We've also published version `0.11.2` of the `react` and `react-tools` packages on npm and the `react` package on bower.
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
---
|
||||
title: "Testing Flux Applications"
|
||||
author: fisherwebdev
|
||||
author: Bill Fisher
|
||||
---
|
||||
|
||||
**A more up-to-date version of this post is available as part of the [Flux documentation](https://facebook.github.io/flux/docs/testing-flux-applications.html).**
|
||||
**A more up-to-date version of this post is available as part of the [Flux documentation](http://facebook.github.io/flux/docs/testing-flux-applications.html).**
|
||||
|
||||
[Flux](https://facebook.github.io/flux/) is the application architecture that Facebook uses to build web applications with [React](/react/). It's based on a unidirectional data flow. In previous blog posts and documentation articles, we've shown the [basic structure and data flow](https://facebook.github.io/flux/docs/overview.html), more closely examined the [dispatcher and action creators](/react/blog/2014/07/30/flux-actions-and-the-dispatcher.html), and shown how to put it all together with a [tutorial](https://facebook.github.io/flux/docs/todo-list.html). Now let's look at how to do formal unit testing of Flux applications with [Jest](https://facebook.github.io/jest/), Facebook's auto-mocking testing framework.
|
||||
[Flux](http://facebook.github.io/flux/) is the application architecture that Facebook uses to build web applications with [React](http://facebook.github.io/react/). It's based on a unidirectional data flow. In previous blog posts and documentation articles, we've shown the [basic structure and data flow](http://facebook.github.io/flux/docs/overview.html), more closely examined the [dispatcher and action creators](http://facebook.github.io/react/blog/2014/07/30/flux-actions-and-the-dispatcher.html), and shown how to put it all together with a [tutorial](http://facebook.github.io/flux/docs/todo-list.html). Now let's look at how to do formal unit testing of Flux applications with [Jest](http://facebook.github.io/jest/), Facebook's auto-mocking testing framework.
|
||||
|
||||
|
||||
Testing with Jest
|
||||
@@ -180,7 +180,7 @@ Now we have a collection of objects that will come back from MyOtherStore whenev
|
||||
|
||||
A brief example of this technique is up on GitHub within the Flux Chat example's [UnreadThreadStore-test.js](https://github.com/facebook/flux/tree/master/examples/flux-chat/js/stores/__tests__/UnreadThreadStore-test.js).
|
||||
|
||||
For more information about the `mock` property of mocked methods or Jest's ability to provide custom mock values, see Jest's documentation on [mock functions](https://facebook.github.io/jest/docs/mock-functions.html).
|
||||
For more information about the `mock` property of mocked methods or Jest's ability to provide custom mock values, see Jest's documentation on [mock functions](http://facebook.github.io/jest/docs/mock-functions.html).
|
||||
|
||||
|
||||
Moving Logic from React to Stores
|
||||
@@ -315,11 +315,11 @@ render: function() {
|
||||
},
|
||||
```
|
||||
|
||||
To learn how to test React components themselves, check out the [Jest tutorial for React](https://facebook.github.io/jest/docs/tutorial-react.html) and the [ReactTestUtils documentation](/react/docs/test-utils.html).
|
||||
To learn how to test React components themselves, check out the [Jest tutorial for React](http://facebook.github.io/jest/docs/tutorial-react.html) and the [ReactTestUtils documentation](http://facebook.github.io/react/docs/test-utils.html).
|
||||
|
||||
|
||||
Further Reading
|
||||
---------------
|
||||
|
||||
- [Mocks Aren't Stubs](http://martinfowler.com/articles/mocksArentStubs.html) by Martin Fowler
|
||||
- [Jest API Reference](https://facebook.github.io/jest/docs/api.html)
|
||||
- [Jest API Reference](http://facebook.github.io/jest/docs/api.html)
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
---
|
||||
title: "Introducing React Elements"
|
||||
author: sebmarkbage
|
||||
author: Sebastian Markbåge
|
||||
redirect_from: "blog/2014/10/14/introducting-react-elements.html"
|
||||
---
|
||||
|
||||
The upcoming React 0.12 tweaks some APIs to get us close to the final 1.0 API. This release is all about setting us up for making the `ReactElement` type really FAST, [jest unit testing](https://facebook.github.io/jest/) easier, making classes simpler (in preparation for ES6 classes) and better integration with third-party languages!
|
||||
The upcoming React 0.12 tweaks some APIs to get us close to the final 1.0 API. This release is all about setting us up for making the `ReactElement` type really FAST, [jest unit testing](http://facebook.github.io/jest/) easier, making classes simpler (in preparation for ES6 classes) and better integration with third-party languages!
|
||||
|
||||
If you currently use JSX everywhere, you don't really have to do anything to get these benefits! The updated transformer will do it for you.
|
||||
|
||||
@@ -72,7 +72,7 @@ This is the biggest change to 0.12. Don't worry though. This functionality conti
|
||||
|
||||
### React With JSX
|
||||
|
||||
If you use the React specific [JSX](https://facebook.github.io/jsx/) transform, the upgrade path is simple. Just make sure you have React in scope.
|
||||
If you use the React specific [JSX](http://facebook.github.io/jsx/) transform, the upgrade path is simple. Just make sure you have React in scope.
|
||||
|
||||
```javascript
|
||||
// If you use node/browserify modules make sure
|
||||
@@ -92,7 +92,7 @@ var MyOtherComponent = React.createClass({
|
||||
});
|
||||
```
|
||||
|
||||
*NOTE: React's JSX will not call arbitrary functions in future releases. This restriction is introduced so that it's easier to reason about the output of JSX by both the reader of your code and optimizing compilers. The JSX syntax is not tied to React. Just the transpiler. You can still use [the JSX spec](https://facebook.github.io/jsx/) with a different transpiler for custom purposes.*
|
||||
*NOTE: React's JSX will not call arbitrary functions in future releases. This restriction is introduced so that it's easier to reason about the output of JSX by both the reader of your code and optimizing compilers. The JSX syntax is not tied to React. Just the transpiler. You can still use [the JSX spec](http://facebook.github.io/jsx/) with a different transpiler for custom purposes.*
|
||||
|
||||
### React Without JSX
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "React v0.12 RC"
|
||||
author: sebmarkbage
|
||||
author: Sebastian Markbåge
|
||||
---
|
||||
|
||||
We are finally ready to share the work we've been doing over the past couple months. A lot has gone into this and we want to make sure we iron out any potential issues before we make this final. So, we're shipping a Release Candidate for React v0.12 today. If you get a chance, please give it a try and report any issues you find! A full changelog will accompany the final release but we've highlighted the interesting and breaking changes below.
|
||||
@@ -9,13 +9,13 @@ We are finally ready to share the work we've been doing over the past couple mon
|
||||
The release candidate is available for download:
|
||||
|
||||
* **React**
|
||||
Dev build with warnings: <https://fb.me/react-0.12.0-rc1.js>
|
||||
Minified build for production: <https://fb.me/react-0.12.0-rc1.min.js>
|
||||
Dev build with warnings: <http://fb.me/react-0.12.0-rc1.js>
|
||||
Minified build for production: <http://fb.me/react-0.12.0-rc1.min.js>
|
||||
* **React with Add-Ons**
|
||||
Dev build with warnings: <https://fb.me/react-with-addons-0.12.0-rc1.js>
|
||||
Minified build for production: <https://fb.me/react-with-addons-0.12.0-rc1.min.js>
|
||||
Dev build with warnings: <http://fb.me/react-with-addons-0.12.0-rc1.js>
|
||||
Minified build for production: <http://fb.me/react-with-addons-0.12.0-rc1.min.js>
|
||||
* **In-Browser JSX transformer**
|
||||
<https://fb.me/JSXTransformer-0.12.0-rc1.js>
|
||||
<http://fb.me/JSXTransformer-0.12.0-rc1.js>
|
||||
|
||||
We've also published version `0.12.0-rc1` of the `react` and `react-tools` packages on npm and the `react` package on bower.
|
||||
|
||||
@@ -27,7 +27,7 @@ The biggest conceptual change we made in v0.12 is the move to React Elements. [W
|
||||
|
||||
## JSX Changes
|
||||
|
||||
Earlier this year we decided to write [a specification for JSX](https://facebook.github.io/jsx/). This has allowed us to make some changes focused on the React specific JSX and still allow others to innovate in the same space.
|
||||
Earlier this year we decided to write [a specification for JSX](http://facebook.github.io/jsx/). This has allowed us to make some changes focused on the React specific JSX and still allow others to innovate in the same space.
|
||||
|
||||
|
||||
### The `@jsx` Pragma is Gone!
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
---
|
||||
title: "Community Round-up #23"
|
||||
layout: post
|
||||
author: LoukaN
|
||||
author: Lou Husson
|
||||
---
|
||||
|
||||
This round-up is a special edition on [Flux](https://facebook.github.io/flux/). If you expect to see diagrams showing arrows that all point in the same direction, you won't be disappointed!
|
||||
This round-up is a special edition on [Flux](http://facebook.github.io/flux/). If you expect to see diagrams showing arrows that all point in the same direction, you won't be disappointed!
|
||||
|
||||
## React And Flux at ForwardJS
|
||||
|
||||
Facebook engineers [Jing Chen](https://github.com/jingc) and [Bill Fisher](https://github.com/fisherwebdev) gave a talk about Flux and React at [ForwardJS](http://forwardjs.com/), and how using an application architecture with a unidirectional data flow helped solve recurring bugs.
|
||||
|
||||
<iframe width="650" height="315" src="//www.youtube-nocookie.com/embed/i__969noyAM" frameborder="0" allowfullscreen></iframe>
|
||||
<iframe width="650" height="315" src="//www.youtube.com/embed/i__969noyAM" frameborder="0" allowfullscreen></iframe>
|
||||
|
||||
# Yahoo
|
||||
|
||||
@@ -24,10 +24,10 @@ Yahoo is converting Yahoo Mail to React and Flux and in the process, they open s
|
||||
|
||||
## Reflux
|
||||
|
||||
[Mikael Brassman](https://spoike.ghost.io/) wrote [Reflux](https://github.com/spoike/refluxjs), a library that implements Flux concepts. Note that it diverges significantly from the way we use Flux at Facebook. He explains [the reasons why in a blog post](https://spoike.ghost.io/deconstructing-reactjss-flux/).
|
||||
[Mikael Brassman](http://spoike.ghost.io/) wrote [Reflux](https://github.com/spoike/refluxjs), a library that implements Flux concepts. Note that it diverges significantly from the way we use Flux at Facebook. He explains [the reasons why in a blog post](http://spoike.ghost.io/deconstructing-reactjss-flux/).
|
||||
|
||||
<center>
|
||||
<a href="https://spoike.ghost.io/deconstructing-reactjss-flux/"><img src="/react/img/blog/reflux-flux.png" width="400" /></a>
|
||||
<a href="http://spoike.ghost.io/deconstructing-reactjss-flux/"><img src="/react/img/blog/reflux-flux.png" width="400" /></a>
|
||||
</center>
|
||||
|
||||
|
||||
@@ -107,22 +107,22 @@ undo: function() {
|
||||
|
||||
## React and Flux
|
||||
|
||||
[Christian Alfoni](https://github.com/christianalfoni) wrote an article where [he compares Backbone, Angular and Flux](https://christianalfoni.github.io/javascript/2014/08/20/react-js-and-flux.html) on a simple example that's representative of a real project he worked on.
|
||||
[Christian Alfoni](https://github.com/christianalfoni) wrote an article where [he compares Backbone, Angular and Flux](http://christianalfoni.github.io/javascript/2014/08/20/react-js-and-flux.html) on a simple example that's representative of a real project he worked on.
|
||||
|
||||
> Wow, that was a bit more code! Well, try to think of it like this. In the above examples, if we were to do any changes to the application we would probably have to move things around. In the FLUX example we have considered that from the start.
|
||||
>
|
||||
> Any changes to the application is adding, not moving things around. If you need a new store, just add it and make components dependant of it. If you need more views, create a component and use it inside any other component without affecting their current "parent controller or models".
|
||||
>
|
||||
> [Read the full article...](https://christianalfoni.github.io/javascript/2014/08/20/react-js-and-flux.html)
|
||||
> [Read the full article...](http://christianalfoni.github.io/javascript/2014/08/20/react-js-and-flux.html)
|
||||
|
||||
|
||||
|
||||
## Flux: Step by Step approach
|
||||
|
||||
[Nicola Paolucci](https://github.com/durdn) from Atlassian wrote a great guide to help your getting understand [Flux step by step](https://blogs.atlassian.com/2014/08/flux-architecture-step-by-step/).
|
||||
[Nicola Paolucci](https://github.com/durdn) from Atlassian wrote a great guide to help your getting understand [Flux step by step](http://blogs.atlassian.com/2014/08/flux-architecture-step-by-step/).
|
||||
|
||||
<center>
|
||||
<a href="https://blogs.atlassian.com/2014/08/flux-architecture-step-by-step/"><img src="/react/img/blog/flux-chart.png" width="400" /></a>
|
||||
<a href="http://blogs.atlassian.com/2014/08/flux-architecture-step-by-step/"><img src="/react/img/blog/flux-chart.png" width="400" /></a>
|
||||
</center>
|
||||
|
||||
|
||||
@@ -144,7 +144,7 @@ undo: function() {
|
||||
|
||||
Last but not least, Flux and React ideas are not limited to JavaScript inside of the browser. The iOS team at Facebook re-implemented Newsfeed using very similar patterns.
|
||||
|
||||
<iframe width="650" height="315" src="//www.youtube-nocookie.com/embed/XhXC4SKOGfQ" frameborder="0" allowfullscreen></iframe>
|
||||
<iframe width="650" height="315" src="//www.youtube.com/embed/XhXC4SKOGfQ" frameborder="0" allowfullscreen></iframe>
|
||||
|
||||
|
||||
## Random Tweet
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: React.js Conf
|
||||
author: vjeux
|
||||
author: Vjeux
|
||||
---
|
||||
|
||||
Every few weeks someone asks us when we are going to organize a conference for React. Our answer has always been "some day". In the mean time, people have been talking about React at other JavaScript conferences around the world. But now the time has finally come for us to have a conference of our own.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: React v0.12
|
||||
author: zpao
|
||||
author: Paul O’Shannessy
|
||||
---
|
||||
|
||||
We're happy to announce the availability of React v0.12! After over a week of baking as the release candidate, we uncovered and fixed a few small issues. Thanks to all of you who upgraded and gave us feedback!
|
||||
@@ -11,13 +11,13 @@ We have talked a lot about some of the bigger changes in this release. [We intro
|
||||
The release is available for download:
|
||||
|
||||
* **React**
|
||||
Dev build with warnings: <https://fb.me/react-0.12.0.js>
|
||||
Minified build for production: <https://fb.me/react-0.12.0.min.js>
|
||||
Dev build with warnings: <http://fb.me/react-0.12.0.js>
|
||||
Minified build for production: <http://fb.me/react-0.12.0.min.js>
|
||||
* **React with Add-Ons**
|
||||
Dev build with warnings: <https://fb.me/react-with-addons-0.12.0.js>
|
||||
Minified build for production: <https://fb.me/react-with-addons-0.12.0.min.js>
|
||||
Dev build with warnings: <http://fb.me/react-with-addons-0.12.0.js>
|
||||
Minified build for production: <http://fb.me/react-with-addons-0.12.0.min.js>
|
||||
* **In-Browser JSX transformer**
|
||||
<https://fb.me/JSXTransformer-0.12.0.js>
|
||||
<http://fb.me/JSXTransformer-0.12.0.js>
|
||||
|
||||
We've also published version `0.12.0` of the `react` and `react-tools` packages on npm and the `react` package on bower.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: React.js Conf Updates
|
||||
author: vjeux
|
||||
author: Vjeux
|
||||
---
|
||||
|
||||
Yesterday was the [React.js Conf](http://conf.reactjs.com/index.html) call for presenters submission deadline. We were
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: "Community Round-up #24"
|
||||
layout: post
|
||||
author: steveluscher
|
||||
author: Steven Luscher
|
||||
---
|
||||
|
||||
## Keep it Simple
|
||||
@@ -14,11 +14,11 @@ Murilo Pereira ([mpereira](https://github.com/mpereira)) tussles with the topic
|
||||
|
||||
I ([steveluscher](https://github.com/steveluscher)) spoke at Manning Publications' “Powered By JavaScript” Strangeloop pre-conf in St. Louis. There, I proposed a new notation to talk about development complexity – Big-Coffee Notation ☕(n) – and spoke about the features of React that help keep our Big-Coffee from going quadratic, as our user interfaces get more complex.
|
||||
|
||||
<iframe width="560" height="315" src="//www.youtube-nocookie.com/embed/rI0GQc__0SM" frameborder="0" allowfullscreen></iframe>
|
||||
<iframe width="560" height="315" src="//www.youtube.com/embed/rI0GQc__0SM" frameborder="0" allowfullscreen></iframe>
|
||||
|
||||
James Pearce ([jamesgpearce](https://github.com/jamesgpearce)) carried Big-Coffee all the way to Raleigh, NC. At the _All Things Open_ conference, he spoke about some of the design decisions that went into React, particularly those that lend themselves to simpler, more reliable code.
|
||||
|
||||
<iframe width="560" height="315" src="//www.youtube-nocookie.com/embed/m2fuO2wl_3c" frameborder="0" allowfullscreen></iframe>
|
||||
<iframe width="560" height="315" src="//www.youtube.com/embed/m2fuO2wl_3c" frameborder="0" allowfullscreen></iframe>
|
||||
|
||||
## All About Isomorphism
|
||||
|
||||
@@ -38,7 +38,7 @@ Ryan Florence ([rpflorence](https://github.com/rpflorence])) and Michael Jackson
|
||||
|
||||
Jonathan Beebe ([somethingkindawierd](https://github.com/somethingkindawierd)) spoke about how he uses React to build tools that deliver hope to those trying to make the best of a bad situation. Watch his talk from this year's _Nodevember_ conference in Nashville
|
||||
|
||||
<iframe width="420" height="315" src="//www.youtube-nocookie.com/embed/uZgAq1CZ1N8" frameborder="0" allowfullscreen></iframe>
|
||||
<iframe width="420" height="315" src="//www.youtube.com/embed/uZgAq1CZ1N8" frameborder="0" allowfullscreen></iframe>
|
||||
|
||||
If you take a peek under the covers, you'll find that React powers [Carousel](https://blog.carousel.com/2014/11/introducing-carousel-for-web-ipad-and-android-tablet/), Dropbox's new photo and video gallery app.
|
||||
|
||||
@@ -48,11 +48,11 @@ We enjoyed a cinematic/narrative experience with this React-powered, interactive
|
||||
|
||||
Spend the next 60 seconds watching Daniel Woelfel ([dwwoelfel](https://github.com/dwwoelfel)) serialize a React app's state as a string, then deserialize it to produce a working UI. Read about how he uses this technique to [reproduce bugs](http://blog.circleci.com/local-state-global-concerns/) reported to him by his users.
|
||||
|
||||
<iframe width="420" height="315" src="//www.youtube-nocookie.com/embed/5yHFTN-_mOo" frameborder="0" allowfullscreen></iframe>
|
||||
<iframe width="420" height="315" src="//www.youtube.com/embed/5yHFTN-_mOo" frameborder="0" allowfullscreen></iframe>
|
||||
|
||||
## Community Components
|
||||
|
||||
Tom Chen ([tomchentw](https://github.com/tomchentw)) brings us a [react-google-maps](https://tomchentw.github.io/react-google-maps/) component, and a way to syntax highlight source code using Prism and the [react-prism](https://tomchentw.github.io/react-prism/) component, for good measure.
|
||||
Tom Chen ([tomchentw](https://github.com/tomchentw)) brings us a [react-google-maps](http://tomchentw.github.io/react-google-maps/) component, and a way to syntax highlight source code using Prism and the [react-prism](http://tomchentw.github.io/react-prism/) component, for good measure.
|
||||
|
||||
Jed Watson ([jedwatson](https://github.com/JedWatson)) helps you manage touch, tap, and press events using the [react-tappable](https://github.com/JedWatson/react-tappable) component.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: React v0.12.2
|
||||
author: zpao
|
||||
author: Paul O’Shannessy
|
||||
---
|
||||
|
||||
We just shipped React v0.12.2, bringing the 0.12 branch up to date with a few small fixes that landed in master over the past 2 months.
|
||||
@@ -10,13 +10,13 @@ You may have noticed that we did not do an announcement for v0.12.1. That releas
|
||||
The release is available for download from the CDN:
|
||||
|
||||
* **React**
|
||||
Dev build with warnings: <https://fb.me/react-0.12.2.js>
|
||||
Minified build for production: <https://fb.me/react-0.12.2.min.js>
|
||||
Dev build with warnings: <http://fb.me/react-0.12.2.js>
|
||||
Minified build for production: <http://fb.me/react-0.12.2.min.js>
|
||||
* **React with Add-Ons**
|
||||
Dev build with warnings: <https://fb.me/react-with-addons-0.12.2.js>
|
||||
Minified build for production: <https://fb.me/react-with-addons-0.12.2.min.js>
|
||||
Dev build with warnings: <http://fb.me/react-with-addons-0.12.2.js>
|
||||
Minified build for production: <http://fb.me/react-with-addons-0.12.2.min.js>
|
||||
* **In-Browser JSX transformer**
|
||||
<https://fb.me/JSXTransformer-0.12.2.js>
|
||||
<http://fb.me/JSXTransformer-0.12.2.js>
|
||||
|
||||
We've also published version `0.12.2` of the `react` and `react-tools` packages on npm and the `react` package on bower. `0.12.1` is also available in the same locations if need those.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: React.js Conf Diversity Scholarship
|
||||
author: zpao
|
||||
author: Paul O’Shannessy
|
||||
---
|
||||
|
||||
Today I'm really happy to announce the React.js Conf Diversity Scholarship! We believe that a diverse set of viewpoints and opinions is really important to build a thriving community. In an ideal world, every part of the tech community would be made up of people from all walks of life. However the reality is that we must be proactive and make an effort to make sure everybody has a voice. As conference organizers we worked closely with the Diversity Team here at Facebook to set aside 10 tickets and provide a scholarship. 10 tickets may not be many in the grand scheme but we really believe that this will have a positive impact on the discussions we have at the conference.
|
||||
@@ -11,7 +11,7 @@ I'm really excited about this and I hope you are too! The full announcement is b
|
||||
|
||||
The Diversity Team at Facebook is excited to announce that we are now accepting applications for the React.js Conf scholarship!
|
||||
|
||||
Beginning today, those studying or working in computer science or a related field can apply for an all-expense paid scholarship to attend the React.js Conf at Facebook’s Headquarters in Menlo Park, CA on January 28 & 29, 2015. React opens a world of new possibilities such as server-side rendering, real-time updates, different rendering targets like SVG and canvas. Join us at React.js Conf to shape the future of client-side applications! For more information about the React.js conference, please see the [website](http://conf.reactjs.com/) and [previous](/react/blog/2014/10/27/react-js-conf.html) [updates](/react/blog/2014/11/24/react-js-conf-updates.html) on our blog.
|
||||
Beginning today, those studying or working in computer science or a related field can apply for an all-expense paid scholarship to attend the React.js Conf at Facebook’s Headquarters in Menlo Park, CA on January 28 & 29, 2015. React opens a world of new possibilities such as server-side rendering, real-time updates, different rendering targets like SVG and canvas. Join us at React.js Conf to shape the future of client-side applications! For more information about the React.js conference, please see the [website](http://conf.reactjs.com/) and [previous](http://facebook.github.io/react/blog/2014/10/27/react-js-conf.html) [updates](http://facebook.github.io/react/blog/2014/11/24/react-js-conf-updates.html) on our blog.
|
||||
|
||||
At Facebook, we believe that anyone anywhere can make a positive impact by developing products to make the world more open and connected to the people and things they care about. Given the current realities of the tech industry and the lack of representation of communities we seek to serve, applicants currently under-represented in Computer Science and related fields are strongly encouraged to apply.
|
||||
Facebook will make determinations on scholarship recipients in its sole discretion. Facebook complies with all equal opportunity laws.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: React v0.13.0 Beta 1
|
||||
author: sebmarkbage
|
||||
author: Sebastian Markbåge
|
||||
---
|
||||
|
||||
React 0.13 has a lot of nice features but there is one particular feature that I'm really excited about. I couldn't wait for React.js Conf to start tomorrow morning.
|
||||
@@ -33,7 +33,7 @@ class HelloMessage extends React.Component {
|
||||
React.render(<HelloMessage name="Sebastian" />, mountNode);
|
||||
```
|
||||
|
||||
The API is mostly what you would expect, with the exception of `getInitialState`. We figured that the idiomatic way to specify class state is to just use a simple instance property. Likewise `getDefaultProps` and `propTypes` are really just properties on the constructor.
|
||||
The API is mostly what you would expect, with the exception for `getInitialState`. We figured that the idiomatic way to specify class state is to just use a simple instance property. Likewise `getDefaultProps` and `propTypes` are really just properties on the constructor.
|
||||
|
||||
```javascript
|
||||
export class Counter extends React.Component {
|
||||
@@ -135,20 +135,17 @@ You can also use CoffeeScript classes:
|
||||
div = React.createFactory 'div'
|
||||
|
||||
class Counter extends React.Component
|
||||
@propTypes = initialCount: React.PropTypes.number
|
||||
@defaultProps = initialCount: 0
|
||||
|
||||
constructor: (props) ->
|
||||
super props
|
||||
@state = count: props.initialCount
|
||||
|
||||
@propTypes =
|
||||
initialCount: React.PropTypes.number
|
||||
@defaultProps =
|
||||
initialCount: 0
|
||||
constructor: ->
|
||||
@state =
|
||||
count: @props.initialCount
|
||||
tick: =>
|
||||
@setState count: @state.count + 1
|
||||
|
||||
render: ->
|
||||
div onClick: @tick,
|
||||
'Clicks: '
|
||||
@state.count
|
||||
div(onClick: @tick, 'Clicks: ', @state.count)
|
||||
```
|
||||
|
||||
You can even use the old ES3 module pattern if you want:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: React.js Conf Round-up 2015
|
||||
layout: post
|
||||
author: steveluscher
|
||||
author: Steven Luscher
|
||||
---
|
||||
|
||||
It was a privilege to welcome the React community to Facebook HQ on January 28–29 for the first-ever React.js Conf, and a pleasure to be be able to unveil three new technologies that we've been using internally at Facebook for some time: GraphQL, Relay, and React Native.
|
||||
@@ -16,7 +16,7 @@ It was a privilege to welcome the React community to Facebook HQ on January 28
|
||||
</p>
|
||||
</div>
|
||||
<div class="skinny-col">
|
||||
<iframe width="305" height="171" src="https://www.youtube-nocookie.com/embed/KVZ-P-ZI6W4" frameborder="0" allowfullscreen></iframe>
|
||||
<iframe width="305" height="171" src="https://www.youtube.com/embed/KVZ-P-ZI6W4" frameborder="0" allowfullscreen></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -28,7 +28,7 @@ It was a privilege to welcome the React community to Facebook HQ on January 28
|
||||
</p>
|
||||
</div>
|
||||
<div class="skinny-col">
|
||||
<iframe width="305" height="171" src="https://www.youtube-nocookie.com/embed/yaymfLj5tjA" frameborder="0" allowfullscreen></iframe>
|
||||
<iframe width="305" height="171" src="https://www.youtube.com/embed/yaymfLj5tjA" frameborder="0" allowfullscreen></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -40,7 +40,7 @@ It was a privilege to welcome the React community to Facebook HQ on January 28
|
||||
</p>
|
||||
</div>
|
||||
<div class="skinny-col">
|
||||
<iframe width="305" height="171" src="https://www.youtube-nocookie.com/embed/OZGgVxFxSIs" frameborder="0" allowfullscreen></iframe>
|
||||
<iframe width="305" height="171" src="https://www.youtube.com/embed/OZGgVxFxSIs" frameborder="0" allowfullscreen></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -52,7 +52,7 @@ It was a privilege to welcome the React community to Facebook HQ on January 28
|
||||
</p>
|
||||
</div>
|
||||
<div class="skinny-col">
|
||||
<iframe width="305" height="171" src="https://www.youtube-nocookie.com/embed/9sc8Pyc51uU" frameborder="0" allowfullscreen></iframe>
|
||||
<iframe width="305" height="171" src="https://www.youtube.com/embed/9sc8Pyc51uU" frameborder="0" allowfullscreen></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -64,7 +64,7 @@ It was a privilege to welcome the React community to Facebook HQ on January 28
|
||||
</p>
|
||||
</div>
|
||||
<div class="skinny-col">
|
||||
<iframe width="305" height="171" src="https://www.youtube-nocookie.com/embed/W2DgDNQZOwo" frameborder="0" allowfullscreen></iframe>
|
||||
<iframe width="305" height="171" src="https://www.youtube.com/embed/W2DgDNQZOwo" frameborder="0" allowfullscreen></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -76,7 +76,7 @@ It was a privilege to welcome the React community to Facebook HQ on January 28
|
||||
</p>
|
||||
</div>
|
||||
<div class="skinny-col">
|
||||
<iframe width="305" height="171" src="https://www.youtube-nocookie.com/embed/XZfvW1a8Xac" frameborder="0" allowfullscreen></iframe>
|
||||
<iframe width="305" height="171" src="https://www.youtube.com/embed/XZfvW1a8Xac" frameborder="0" allowfullscreen></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -88,7 +88,7 @@ It was a privilege to welcome the React community to Facebook HQ on January 28
|
||||
</p>
|
||||
</div>
|
||||
<div class="skinny-col">
|
||||
<iframe width="305" height="171" src="https://www.youtube-nocookie.com/embed/KtmjkCuV-EU" frameborder="0" allowfullscreen></iframe>
|
||||
<iframe width="305" height="171" src="https://www.youtube.com/embed/KtmjkCuV-EU" frameborder="0" allowfullscreen></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -96,11 +96,11 @@ It was a privilege to welcome the React community to Facebook HQ on January 28
|
||||
<div class="skinny-col">
|
||||
<h3 style="margin-top:0"><a class="anchor" name="talk-performance"></a>High-performance <a class="hash-link" href="#talk-performance">#</a></h3>
|
||||
<p>
|
||||
<strong>Jason Bonta</strong> showed us how complex user interfaces can get, and how his team keeps them performant as they scale. He also had the pleasure of open-sourcing his team’s work on <a href="https://facebook.github.io/fixed-data-table/">FixedDataTable</a>.
|
||||
<strong>Jason Bonta</strong> showed us how complex user interfaces can get, and how his team keeps them performant as they scale. He also had the pleasure of open-sourcing his team’s work on <a href="http://facebook.github.io/fixed-data-table/">FixedDataTable</a>.
|
||||
</p>
|
||||
</div>
|
||||
<div class="skinny-col">
|
||||
<iframe width="305" height="171" src="https://www.youtube-nocookie.com/embed/KYzlpRvWZ6c" frameborder="0" allowfullscreen></iframe>
|
||||
<iframe width="305" height="171" src="https://www.youtube.com/embed/KYzlpRvWZ6c" frameborder="0" allowfullscreen></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -112,7 +112,7 @@ It was a privilege to welcome the React community to Facebook HQ on January 28
|
||||
</p>
|
||||
</div>
|
||||
<div class="skinny-col">
|
||||
<iframe width="305" height="171" src="https://www.youtube-nocookie.com/embed/Sla-DkvmIHY" frameborder="0" allowfullscreen></iframe>
|
||||
<iframe width="305" height="171" src="https://www.youtube.com/embed/Sla-DkvmIHY" frameborder="0" allowfullscreen></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -124,7 +124,7 @@ It was a privilege to welcome the React community to Facebook HQ on January 28
|
||||
</p>
|
||||
</div>
|
||||
<div class="skinny-col">
|
||||
<iframe width="305" height="171" src="https://www.youtube-nocookie.com/embed/z5e7kWSHWTg" frameborder="0" allowfullscreen></iframe>
|
||||
<iframe width="305" height="171" src="https://www.youtube.com/embed/z5e7kWSHWTg" frameborder="0" allowfullscreen></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -136,7 +136,7 @@ It was a privilege to welcome the React community to Facebook HQ on January 28
|
||||
</p>
|
||||
</div>
|
||||
<div class="skinny-col">
|
||||
<iframe width="305" height="171" src="https://www.youtube-nocookie.com/embed/7rDsRXj9-cU" frameborder="0" allowfullscreen></iframe>
|
||||
<iframe width="305" height="171" src="https://www.youtube.com/embed/7rDsRXj9-cU" frameborder="0" allowfullscreen></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -148,7 +148,7 @@ It was a privilege to welcome the React community to Facebook HQ on January 28
|
||||
</p>
|
||||
</div>
|
||||
<div class="skinny-col">
|
||||
<iframe width="305" height="171" src="https://www.youtube-nocookie.com/embed/g0TD0efcwVg" frameborder="0" allowfullscreen></iframe>
|
||||
<iframe width="305" height="171" src="https://www.youtube.com/embed/g0TD0efcwVg" frameborder="0" allowfullscreen></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -160,7 +160,7 @@ It was a privilege to welcome the React community to Facebook HQ on January 28
|
||||
</p>
|
||||
</div>
|
||||
<div class="skinny-col">
|
||||
<iframe width="305" height="171" src="https://www.youtube-nocookie.com/embed/I7IdS-PbEgI" frameborder="0" allowfullscreen></iframe>
|
||||
<iframe width="305" height="171" src="https://www.youtube.com/embed/I7IdS-PbEgI" frameborder="0" allowfullscreen></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -171,7 +171,7 @@ It was a privilege to welcome the React community to Facebook HQ on January 28
|
||||
<strong>Jafar Husain</strong> told us a story about how Netflix was able to push React into places where the DOM could not go.
|
||||
</div>
|
||||
<div class="skinny-col">
|
||||
<iframe width="305" height="171" src="https://www.youtube-nocookie.com/embed/eNC0mRYGWgc" frameborder="0" allowfullscreen></iframe>
|
||||
<iframe width="305" height="171" src="https://www.youtube.com/embed/eNC0mRYGWgc" frameborder="0" allowfullscreen></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -182,7 +182,7 @@ It was a privilege to welcome the React community to Facebook HQ on January 28
|
||||
<strong>Zach Nation</strong> showed us how we can produce visualizations from over 45 million data points without breaking a sweat.
|
||||
</div>
|
||||
<div class="skinny-col">
|
||||
<iframe width="305" height="171" src="https://www.youtube-nocookie.com/embed/2ii1lEkIv1s" frameborder="0" allowfullscreen></iframe>
|
||||
<iframe width="305" height="171" src="https://www.youtube.com/embed/2ii1lEkIv1s" frameborder="0" allowfullscreen></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -193,7 +193,7 @@ It was a privilege to welcome the React community to Facebook HQ on January 28
|
||||
<strong>David Nolen</strong> gave us a view of React from a non-JavaScript perspective, challenging some common intuition along the way.
|
||||
</div>
|
||||
<div class="skinny-col">
|
||||
<iframe width="305" height="171" src="https://www.youtube-nocookie.com/embed/5hGHdETNteE" frameborder="0" allowfullscreen></iframe>
|
||||
<iframe width="305" height="171" src="https://www.youtube.com/embed/5hGHdETNteE" frameborder="0" allowfullscreen></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -204,7 +204,7 @@ It was a privilege to welcome the React community to Facebook HQ on January 28
|
||||
<strong>Bill Fisher</strong> coordinated a Flux panel together with <strong>Michael Ridgway</strong>, <strong>Spike Brehm</strong>, <strong>Andres Suarez</strong>, <strong>Jing Chen</strong>, <strong>Ian Obermiller</strong>, and <strong>Kyle Davis</strong>.
|
||||
</div>
|
||||
<div class="skinny-col">
|
||||
<iframe width="305" height="171" src="https://www.youtube-nocookie.com/embed/LTj4O7WJJ98" frameborder="0" allowfullscreen></iframe>
|
||||
<iframe width="305" height="171" src="https://www.youtube.com/embed/LTj4O7WJJ98" frameborder="0" allowfullscreen></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -215,7 +215,7 @@ It was a privilege to welcome the React community to Facebook HQ on January 28
|
||||
<strong>Bonnie Eisenman</strong> led us through the ‘adapter’ approach to inter-component communication taken by her team at Codecademy.
|
||||
</div>
|
||||
<div class="skinny-col">
|
||||
<iframe width="305" height="171" src="https://www.youtube-nocookie.com/embed/ZM6wXoFTY3o" frameborder="0" allowfullscreen></iframe>
|
||||
<iframe width="305" height="171" src="https://www.youtube.com/embed/ZM6wXoFTY3o" frameborder="0" allowfullscreen></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -226,7 +226,7 @@ It was a privilege to welcome the React community to Facebook HQ on January 28
|
||||
<strong>James Brantly</strong> demonstrated how we can reap the benefits of static typing using both Flow and TypeScript.
|
||||
</div>
|
||||
<div class="skinny-col">
|
||||
<iframe width="305" height="171" src="https://www.youtube-nocookie.com/embed/9PTa9-PPVAc" frameborder="0" allowfullscreen></iframe>
|
||||
<iframe width="305" height="171" src="https://www.youtube.com/embed/9PTa9-PPVAc" frameborder="0" allowfullscreen></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -237,7 +237,7 @@ It was a privilege to welcome the React community to Facebook HQ on January 28
|
||||
<strong>Tom Occhino</strong>, <strong>Ben Alpert</strong>, <strong>Lee Byron</strong>, <strong>Christopher Chedeau</strong>, <strong>Sebastian Markbåge</strong>, <strong>Jing Chen</strong>, and <strong>Dan Schafer</strong> closed the conference with a Q&A session.
|
||||
</div>
|
||||
<div class="skinny-col">
|
||||
<iframe width="305" height="171" src="https://www.youtube-nocookie.com/embed/EPpkboSKvPI" frameborder="0" allowfullscreen></iframe>
|
||||
<iframe width="305" height="171" src="https://www.youtube.com/embed/EPpkboSKvPI" frameborder="0" allowfullscreen></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -266,4 +266,4 @@ And, in case you missed a session, you can borrow **Michael Chan’s** [drawings
|
||||
|
||||
**All proceeds from React.js Conf 2015 were donated to the wonderful programs at [code.org](http://code.org)**. These programs aim to increase access to the field of computer science by underrepresented members of our community. Watch this video to learn more.
|
||||
|
||||
<iframe width="305" height="171" src="https://www.youtube-nocookie.com/embed/FC5FbmsH4fw" frameborder="0" allowfullscreen></iframe>
|
||||
<iframe width="305" height="171" src="https://www.youtube.com/embed/FC5FbmsH4fw" frameborder="0" allowfullscreen></iframe>
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
---
|
||||
title: "Introducing Relay and GraphQL"
|
||||
layout: post
|
||||
author: wincent
|
||||
author: Greg Hurrell
|
||||
---
|
||||
|
||||
## Data fetching for React applications
|
||||
|
||||
There's more to building an application than creating a user interface. Data fetching is still a tricky problem, especially as applications become more complicated. At [React.js Conf](http://conf.reactjs.com/) we announced two projects we've created at Facebook to make data fetching simple for developers, even as a product grows to include dozens of contributors and the application becomes as complex as Facebook itself.
|
||||
|
||||
<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/9sc8Pyc51uU" frameborder="0" allowfullscreen></iframe>
|
||||
<iframe width="560" height="315" src="https://www.youtube.com/embed/9sc8Pyc51uU" frameborder="0" allowfullscreen></iframe>
|
||||
|
||||
The two projects — Relay and GraphQL — have been in use in production at Facebook for some time, and we're excited to be bringing them to the world as open source in the future. In the meantime, we wanted to share some additional information about the projects here.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "React v0.13 RC"
|
||||
author: zpao
|
||||
author: Paul O'Shannessy
|
||||
date: 2015-02-24 14:00
|
||||
---
|
||||
|
||||
@@ -12,13 +12,13 @@ We've talked a little bit about the changes that are coming. The splashiest of t
|
||||
The release candidate is available for download:
|
||||
|
||||
* **React**
|
||||
Dev build with warnings: <https://fb.me/react-0.13.0-rc1.js>
|
||||
Minified build for production: <https://fb.me/react-0.13.0-rc1.min.js>
|
||||
Dev build with warnings: <http://fb.me/react-0.13.0-rc1.js>
|
||||
Minified build for production: <http://fb.me/react-0.13.0-rc1.min.js>
|
||||
* **React with Add-Ons**
|
||||
Dev build with warnings: <https://fb.me/react-with-addons-0.13.0-rc1.js>
|
||||
Minified build for production: <https://fb.me/react-with-addons-0.13.0-rc1.min.js>
|
||||
Dev build with warnings: <http://fb.me/react-with-addons-0.13.0-rc1.js>
|
||||
Minified build for production: <http://fb.me/react-with-addons-0.13.0-rc1.min.js>
|
||||
* **In-Browser JSX transformer**
|
||||
<https://fb.me/JSXTransformer-0.13.0-rc1.js>
|
||||
<http://fb.me/JSXTransformer-0.13.0-rc1.js>
|
||||
|
||||
We've also published version `0.13.0-rc1` of the `react` and `react-tools` packages on npm and the `react` package on bower.
|
||||
|
||||
@@ -39,10 +39,10 @@ We've also published version `0.13.0-rc1` of the `react` and `react-tools` packa
|
||||
|
||||
#### New Features
|
||||
|
||||
* Support for using ES6 classes to build React components; see the [v0.13.0 beta 1 notes](/react/blog/2015/01/27/react-v0.13.0-beta-1.html) for details
|
||||
* Support for using ES6 classes to build React components; see the [v0.13.0 beta 1 notes](http://facebook.github.io/react/blog/2015/01/27/react-v0.13.0-beta-1.html) for details
|
||||
* Added new top-level API `React.findDOMNode(component)`, which should be used in place of `component.getDOMNode()`. The base class for ES6-based components will not have `getDOMNode`. This change will enable some more patterns moving forward.
|
||||
* New `ref` style, allowing a callback to be used in place of a name: `<Photo ref={(c) => this._photo = c} />` allows you to reference the component with `this._photo` (as opposed to `ref="photo"` which gives `this.refs.photo`)
|
||||
* `this.setState()` can now take a function as the first argument for transactional state updates, such as `this.setState((state, props) => ({count: state.count + 1}));` -- this means that you no longer need to use `this._pendingState`, which is now gone.
|
||||
* `this.setState()` can now take a function as the first argument for transactional state updates, such as `this.setState((state, props) => ({count: state.count + 1}));` -- this means that you no longer need to use this._pendingState, which is now gone.
|
||||
* Support for iterators and immutable-js sequences as children
|
||||
|
||||
#### Deprecations
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "Streamlining React Elements"
|
||||
author: sebmarkbage
|
||||
author: Sebastian Markbåge
|
||||
date: 2015-02-24 11:00
|
||||
---
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user