Compare commits

...

3613 Commits

Author SHA1 Message Date
Paul O’Shannessy
06126ad3f4 v0.13.0-rc1 2015-02-22 13:26:13 -08:00
Paul O’Shannessy
4f26cc1414 Update dependencies 2015-02-22 13:26:13 -08:00
Paul O’Shannessy
d83fa6a6bf Merge pull request #3224 from Simek/patch-2
wider Twitter timeline on support page
2015-02-22 13:10:43 -08:00
Paul O’Shannessy
fe16c8292c Merge pull request #3232 from artnez/master
Add vendor/inline-source-map.js to package.json
2015-02-22 13:01:05 -08:00
Paul O’Shannessy
029e64bb56 Merge pull request #3233 from artnez/es6-call-spread
Add support for jstransform es6-call-spread
2015-02-22 12:57:25 -08:00
Artem Nezvigin
0bc4aafb74 Add support for jstransform es6-call-spread 2015-02-22 11:57:06 -08:00
Artem Nezvigin
d7791a7cbb Add vendor/inline-source-map.js to package.json 2015-02-22 11:11:48 -08:00
Bartosz Kaszubowski
087cd7b27a wider Twitter timeline on support page 2015-02-21 23:20:09 +01:00
Paul O’Shannessy
5ab7fdecfe Merge pull request #2994 from chenglou/docs-classset
[Docs] Add note on classSet deprecation
2015-02-20 17:00:36 -08:00
Paul O’Shannessy
4046b92487 Merge pull request #2847 from zpao/jsx-es5
Expose --target=esversion flag on jsx executable
2015-02-20 15:19:37 -08:00
Paul O’Shannessy
d40be68d2c Expose --target flag on jsx executable
Valid values are 'es3' and 'es5'.
es3: perform reserved words quoting, don't use defineProperty
es5: default, don't do the above, class methods non-enumerable
2015-02-20 13:37:42 -08:00
Paul O’Shannessy
821383165f Merge pull request #3212 from denis-sokolov/patch-1
Contributing: cleanup quote style
2015-02-20 08:20:18 -08:00
Denis Sokolov
ae3e85d9e4 Contributing: cleanup quote style
The line above it recommends `'` over `"`, and yet the line in question uses `"`.
2015-02-20 12:06:33 +02:00
Greg Hurrell
531add88c4 Add Relay blog post
closes #3174
2015-02-19 21:27:45 -08:00
Paul O’Shannessy
85baea4404 Merge pull request #3209 from chicoxyzzy/eslint-everywhere
lint from root
2015-02-19 20:59:44 -08:00
Paul O’Shannessy
362e9595c4 Fix long lines in vendor/fbtransform/visitors
I meant to do this with #3206 but forgot to add them.
2015-02-19 18:43:06 -08:00
Paul O’Shannessy
a3ee6a9548 Merge pull request #2993 from chenglou/classset-ded
Put deprecation warning for classSet
2015-02-19 18:36:36 -08:00
Jim
8326a9f11e Merge pull request #2921 from hanski07/updateTransferringPropsDocs
Update transferring props docs
2015-02-19 17:52:02 -08:00
chico
90ce7f67d7 lint vendor/*.js 2015-02-20 04:37:45 +03:00
chico
ed6d02e1a8 fix .eslintignore 2015-02-20 04:31:21 +03:00
Jim
8913a07ada Merge pull request #3161 from koba04/fix-clone-with-props-document
Fix a doc. cloneWithProps clones a ReactElement.
2015-02-19 17:14:53 -08:00
chico
1876bc2432 remove ballmer example 2015-02-20 04:13:07 +03:00
Toru Kobayashi
60e96edce2 Fix a doc. cloneWithProps clones a ReactElement. 2015-02-20 10:08:46 +09:00
chico
466f4faf4e lint from root 2015-02-20 04:06:15 +03:00
Jim
d69329a17c Merge pull request #3208 from jsfb/clonewithprops-jsdocs
Fixed mistake in jsdocs types for cloneWithProps
2015-02-19 17:02:28 -08:00
Jim
bad85fafa1 Fixed mistake in jsdocs types for cloneWithProps 2015-02-19 16:38:25 -08:00
Cheng Lou
835316bc13 Put deprecation warning for classSet
Also removes the one test that used the module.
2015-02-19 19:31:54 -05:00
Paul O’Shannessy
c889f409bf Merge pull request #3191 from zpao/jsxtransformer-use-shared-code
Use same pathways for browser transforms as we use in react-tools
2015-02-19 16:09:41 -08:00
Paul O’Shannessy
cb3e797236 Merge pull request #3206 from zpao/lint-fbtransform
Lint vendor/fbtransform as well
2015-02-19 16:06:38 -08:00
Paul O’Shannessy
e60db7316f Merge pull request #3198 from zpao/jsx-option-parsing
Move option parsing into react-tools proper.
2015-02-19 15:54:11 -08:00
Paul O’Shannessy
0f85884fa4 Merge pull request #3201 from zpao/non-factory-invariant
Warn when using constructor function directly
2015-02-19 15:53:50 -08:00
Sebastian Markbåge
977204991b Merge pull request #3205 from sebmarkbage/warningfixes
More warnings to ReactFragment.create
2015-02-19 15:43:18 -08:00
Paul O’Shannessy
e830cea050 Lint vendor/fbtransform as well 2015-02-19 15:26:27 -08:00
Sebastian Markbage
5a2c80382c More warnings to ReactFragment.create
Apparently I could've used these too because if you accept an arbitrary
node, then these could end up being objects, but those objects might
also be arrays or elements.
2015-02-19 15:11:49 -08:00
Paul O’Shannessy
02d225f26e Merge pull request #3193 from fisherwebdev/remove_lodash
Remove lodash devDependency
2015-02-19 14:22:34 -08:00
Paul O’Shannessy
ad31cfa4dc Warn when using constructor function directly
We no longer support the legacy factory style of calling component constructors
directly. We only support createElement or the wrapping of classes with
createFactory. Instead of letting this fail in a gross way as we try to run,
add a nice warning that shows up before the gross TypeError.
2015-02-19 13:57:48 -08:00
Jim
a2f77208e6 Merge pull request #3180 from cody/https
Using https URLs for embedded fiddles
2015-02-19 13:18:34 -08:00
Paul O’Shannessy
21a9e8b6e8 Merge pull request #3189 from hzoo/more-lint
More lint - remove spaces in object braces / array brackets
2015-02-19 11:42:02 -08:00
Paul O’Shannessy
629d400774 Merge pull request #3165 from oiva/jquery-mobile-example
Change how components are rendered in jQuery Mobile example. Fixes #2880
2015-02-19 10:48:26 -08:00
Paul O’Shannessy
112f7aa249 Move option parsing into react-tools proper.
We were doing some preprocessing for module options in the command line. Since
we also expose the same API via react-tools (and JSXTransformer), we need to do
the same processing from the API. So just move it all to the same place.
2015-02-19 09:46:25 -08:00
fisherwebdev
10d336d4eb Remove lodash devDependency 2015-02-18 22:41:58 -08:00
Steven Luscher
f1288d1055 Added the immutability talk to the React.js Conf update.
(cherry picked from commit de8b3eb9d4)
2015-02-18 21:42:11 -08:00
Paul O’Shannessy
0e0a8f65c5 Use same pathways for browser transforms as we use in react-tools
This makes sure we can use the same options everywhere, even from react-rails,
without having to specify each one separately in JSXTransformer as well.
2015-02-18 21:40:16 -08:00
Henry Zhu
eba5d1365c lint: remove spaces from array brackets 2015-02-19 00:13:36 -05:00
Henry Zhu
07cfd66028 lint: remove spaces from object braces 2015-02-19 00:10:31 -05:00
Timothy Yung
b0789c9582 Merge pull request #3187 from yungsters/shallow
Support unmounting in ReactShallowRenderer
2015-02-18 17:47:12 -08:00
yungsters
e9e33b984f Support unmounting in ReactShallowRenderer
Reviewers: @sebmarkbage, @zpao

Test Plan:

```
$ npm test ReactTestUtils
```
2015-02-18 17:45:42 -08:00
Paul O’Shannessy
6c29eba035 Merge pull request #2821 from zpao/unitless-css-boxflex
Add boxFlex and boxFlexGroup to CSS Unitless Properties
2015-02-18 17:22:56 -08:00
Stefan Dombrowski
8ba3ba49d2 Using https for embedded fiddles
Official announcement from jsfiddle:
https://twitter.com/jsfiddle/status/565041134435852289
2015-02-18 23:07:48 +01:00
Paul O’Shannessy
6f7b9a97bf Merge pull request #3108 from zpao/quadratic-example
Replace Ballmer Peak example with Quadratic Formula
2015-02-18 14:02:17 -08:00
Paul O’Shannessy
1caeda30ea Replace Ballmer Peak example with Quadratic Formula 2015-02-18 13:59:26 -08:00
Steven Luscher
85a6462062 Added special edition round-up for React.js Conf 2015
(cherry picked from commit 233980826c)
2015-02-18 13:30:26 -08:00
Sebastian Markbåge
5499321d63 Merge pull request #3183 from yungsters/master
Support rendering to null in ShallowComponentRenderer
2015-02-18 11:43:07 -08:00
yungsters
e952869ff8 Support rendering to null in ShallowComponentRenderer
Reviewers: @sema, @zpao

Test Plan:
```
$ npm jest
```
2015-02-18 11:31:02 -08:00
Sebastian Markbåge
00a3b9233f Merge pull request #3177 from sebmarkbage/fixbindwarningstring
Forgotten string
2015-02-17 18:26:32 -08:00
Sebastian Markbage
377319b863 Forgotten string
We forgot this `%s` as this was converted.
2015-02-17 18:26:12 -08:00
Sebastian Markbåge
c61207588d Merge pull request #3175 from sebmarkbage/fixhasownorder
Avoid reading the property if hasOwnProperty is false
2015-02-17 16:02:18 -08:00
Sebastian Markbage
67cf95c16d Avoid reading the property if hasOwnProperty is false
Easy with an Object.assign polyfill
2015-02-17 15:59:01 -08:00
Sebastian Markbåge
de3ecabd6c Merge pull request #3148 from hmarr/fix-nan-mutation-warning
Prevent NaN props from triggering warnings
2015-02-17 15:41:18 -08:00
Sebastian Markbåge
cf4bef8bd7 Merge pull request #3171 from sebmarkbage/moarwarnings
Moar Warnings
2015-02-17 15:09:33 -08:00
Oiva Eskola
4c32fb487e Wrap jQuery Mobile example's components with React.createFactory to fix on v0.13.0. Fixes #2880 2015-02-18 00:13:13 +02:00
Jim
f6920ba377 Merge pull request #3170 from adelevie/patch-1
Make tutorial CDN URLs use https
2015-02-17 11:50:54 -08:00
Sebastian Markbage
2490289c4a Warn if getDOMNode or isMounted is accessed in render
This is an anti-pattern that can be easily avoided by putting the logic
in componentDidMount and componentDidUpdate instead.

It creates a dependency on stale data inside render without enforcing
a two-pass render.
2015-02-17 11:49:20 -08:00
Alan deLevie
4980bcb0f3 Make tutorial CDN URLs use https 2015-02-17 14:34:01 -05:00
Sebastian Markbage
91194126d8 Warn if using Maps as children
We're not sure if this is the way we want to support this API. It creates
two ways of doing things.

It is convenient to avoid needing to explicitly redefine the key of Maps.
However, this use case isn't as common as having an iterable where the
key is on the value, not the key.
2015-02-17 11:23:12 -08:00
Paul O’Shannessy
a8d9bff3ca Merge pull request #3168 from briankung/docs-jsx-namespacing
[Docs] Clarify section on namespaced components
2015-02-17 11:10:33 -08:00
Paul O’Shannessy
9e2da7a0ae Merge pull request #3164 from oiva/master
Fix sourcemap filenames when using transformWithDetails. Fixes #3140
2015-02-17 11:07:19 -08:00
Sebastian Markbage
3587460675 Warn if accessing .type on a factory
This was an important convenience as an upgrade path but shouldn't be
necessary if you're using best-practice of calling createFactory in the
consuming component.
2015-02-17 11:06:54 -08:00
Paul O’Shannessy
68a8e4491f Merge pull request #3147 from hzoo/lint-fixes
lint whitespace , trailing comma
2015-02-17 10:58:42 -08:00
Paul O’Shannessy
6cd7ab5254 Merge pull request #3154 from iamdustan/patch-1
s/upate/update
2015-02-17 10:55:42 -08:00
Brian Kung
26e0b1a298 [Docs] Clarify section on namespaced components
While going through the docs, I wasn't sure if the first example was
something I should do or not. This makes the wording a bit more clear.
2015-02-17 06:40:48 -06:00
Ben Alpert
6d97c708a9 Merge pull request #3167 from MichelleTodd/docs-grammar
[Docs] Reword section on React without JSX
2015-02-16 17:26:23 -08:00
Michelle Todd
17f2c26139 [Docs] Reword section on React without JSX
Summary:
This section was confusing. I reworded it from:

"JSX is completely optional. You don't have to use JSX with React.
You can create these trees through `React.createElement`. The first
argument is the tag, pass a properties object as the second
argument and children to the third argument."

to:

"JSX is completely optional; you don't have to use JSX with React.
You can create React elements in plain JavaScript using
`React.createElement`, which takes a tag name or component, a
properties object, and variable number of optional child
arguments."

and additionally added another child element to the example code.

Test Plan:
Read the new paragraph!
2015-02-16 17:12:19 -08:00
Ben Alpert
6729acf370 Merge pull request #3162 from vsiao/mount-element
Fix ReactMount._renderNewRootComponent signature
2015-02-16 16:05:08 -08:00
Oiva Eskola
35e24759f1 fix sourcemap filenames when using transformWithDetails. Fixes #3140 2015-02-16 22:21:51 +02:00
Vincent Siao
96e4e3cbbc Fix ReactMount._renderNewRootComponent signature (ReactComponent -> ReactElement) 2015-02-15 19:25:18 -08:00
Dustan Kasten
dc21dca50e s/upate/update 2015-02-14 22:09:31 -05:00
Henry Zhu
cb49492f88 lint whitespace
- use spaces
- remove space before paren in function
-  remove space before colon in object
2015-02-14 11:12:18 -05:00
Harry Marr
198aabaafb Prevent NaN props from triggering warnings
Previously, `checkAndWarnForMutatedProps` would flag `NaN` props as
having been mutated, because `NaN !== NaN`. This prevents that warning
from being emitted by explicitly checking for `NaN`s.
2015-02-14 10:06:55 +00:00
Henry Zhu
74726f0af5 remove space before round brace in function expressions 2015-02-13 23:41:53 -05:00
Henry Zhu
e2a57920da lint whitespace , trailing comma 2015-02-13 23:13:47 -05:00
Paul O’Shannessy
5126cee0f5 v0.13.0-beta.2 2015-02-13 18:28:03 -08:00
Paul O’Shannessy
432e378687 Remove references to vendor_deprecated 2015-02-13 18:27:22 -08:00
Paul O’Shannessy
ad01f21469 Merge pull request #3145 from jsfb/dedup-is-owner-important
Dedupe owner-is-important warning.
2015-02-13 18:26:49 -08:00
Jim
207b03c56d Dedupe owner-is-important warning. 2015-02-13 18:05:18 -08:00
Paul O’Shannessy
0b5331c155 Update license for jsx_orphaned_brackets_transformer 2015-02-13 15:45:01 -08:00
Paul O’Shannessy
3751f85260 Merge pull request #3139 from brianpchsu/master
Fixed Copyright year for three files and react.js licence to BSD-license
2015-02-13 15:44:03 -08:00
Jeff Morrison
8e803cba23 Merge pull request #3143 from jeffmo/flow_0_3_0
Update jsx binary to latest jstransform + latest flow syntax features
2015-02-13 15:37:41 -08:00
jeffmo
332a782d28 Add --es6module and --non-strict-es6module flags to jsx bin 2015-02-13 17:51:35 -05:00
jeffmo
34bb8e85a2 Bump jstransform version to 9.1.0 to include new flow updates 2015-02-13 17:40:52 -05:00
Jim
5512d0d4d0 Merge pull request #3132 from jsfb/warn-less-for-owner-necessary
Only monitor components that are likely stateful (inputs and composites)
2015-02-13 13:55:06 -08:00
Brian Hsu
7e609c6903 Fixed Copyright year for three files and react.js licence to BSD-license. 2015-02-13 12:15:49 -08:00
Paul O’Shannessy
2a3f43184a Merge pull request #3123 from chicoxyzzy/remove-jshint
ESLint coverage
2015-02-13 11:39:11 -08:00
Paul O’Shannessy
5714510ea4 Merge pull request #3134 from briankung/update-safe_yaml
Fix for the jekyll docs build process
2015-02-13 11:22:47 -08:00
Jim
f18dfdc00d Only monitor components that are likely stateful (inputs and composites) 2015-02-12 17:22:42 -08:00
chico
862f7d6a41 fix linting 2015-02-13 02:45:50 +03:00
chico
96677d5da5 update eslint rules 2015-02-13 02:44:32 +03:00
chico
e02a303e3e .eslint in src is not necessary anymore 2015-02-13 02:44:32 +03:00
chico
1511fff598 eslint 2015-02-13 02:43:42 +03:00
Brian Kung
892200ae38 Bumps safe_yaml to 1.0.4 (was 1.0.3) to fix bug
safe_yaml 1.0.3 has some issues with Ruby 2.2.0:
https://github.com/dtao/safe_yaml/issues/67
2015-02-12 17:40:57 -06:00
Paul O’Shannessy
fffe135931 Merge pull request #3133 from zpao/more-lint
More lint rules, fixes
2015-02-12 15:37:22 -08:00
Paul O’Shannessy
7e5eb4b2b2 Add indent lint rule, fix code 2015-02-12 14:31:55 -08:00
Paul O’Shannessy
52b32d83d0 Remove newline at beginning of file 2015-02-12 14:28:54 -08:00
Paul O’Shannessy
12808e81c1 Fix license header to use BSD 2015-02-12 14:28:32 -08:00
Paul O’Shannessy
af8ad59a5b Add space-before-blocks rules, fix code 2015-02-12 14:28:01 -08:00
Sebastian Markbåge
a411f3e0dc Merge pull request #3130 from sebmarkbage/identifiablewarnings
Moar warnings with solid prefixes!
2015-02-12 13:47:53 -08:00
Sebastian Markbage
f5038829d8 Moar warnings with solid prefixes!
This ensures that we have a prefix that can be easily identified in logs
so that we can filter out warnings based on their prefix.

This also turns the remaining two monitorCodeUse callers into warnings.
We'll probably still use monitorCodeUse until we know if we want to
deprecate but most releases should only have warnings.
2015-02-12 13:37:19 -08:00
Paul O’Shannessy
d2fcdfc7df Merge pull request #3126 from Sourdoughh/patch-1
Update to CLA, CONTRIBUTING.md
2015-02-11 16:46:53 -08:00
Jason Ly
462f3ca245 Update to CLA, CONTRIBUTING.md 2015-02-11 13:56:25 -08:00
Christopher Chedeau
6c549d2899 update image perf 2015-02-11 12:45:58 -08:00
Sebastian Markbåge
032fb6ce11 Merge pull request #3107 from sebmarkbage/fragments
Warn if a non-object value is used in ReactFragment.create
2015-02-11 11:58:46 -08:00
Paul O’Shannessy
c07657fde1 Merge pull request #3114 from chicoxyzzy/master
rename `Id` suffix to `ID` to apply naming conventions
2015-02-11 11:35:17 -08:00
Paul O’Shannessy
ea29768a2b Merge pull request #3118 from rkho/patch-1
Updated CONTRIBUTING.md: Mention of "facebook.com" was not a link
2015-02-11 11:34:48 -08:00
Christopher Chedeau
83e4409a72 Tweaks on Advanced Performance 2015-02-11 11:14:59 -08:00
Christopher Chedeau
ab512af57f Advanced Performance Doc 2015-02-11 10:53:57 -08:00
chico
fbe88c7e46 fix Microdata properties' commentaries 2015-02-11 15:50:59 +03:00
Jim
130a164c8d Merge pull request #3117 from jsfb/use-warning-module
Flip console.warn to use warning module.
2015-02-10 17:08:12 -08:00
Jim
4e5543965d Flip console.warn to use warning module so users can intercept all warnings by shimming the warning module.
The two remaining console.warns are:

/Users/jsproch/react/src/test/mock-modules.js:
   19      return mocks.generateFromMetadata(mocks.getMetadata(exports));
   20    } catch (err) {
   21:     console.warn(err);
   22      return exports;
   23    }

/Users/jsproch/react/src/vendor/core/warning.js:
   39        var argIndex = 0;
   40        var message = 'Warning: ' + format.replace(/%s/g, () => args[argIndex++]);
   41:       console.warn(message);
   42        try {
   43          // --- Welcome to debugging React ---
2015-02-10 15:23:24 -08:00
Richard Kho
9c19135c34 Updated CONTRIBUTING.md: Mention of "facebook.com" was not a link
Updated the mention of "facebook.com" on line 3 of the CONTRIBUTING.md file to link to Facebook. Previously, this mention was just in plain text.

Changed from `facebook.com` to `[facebook.com](https://facebook.com)`

No other content has been changed. Content has not been removed from this file in any way.
2015-02-10 14:44:23 -08:00
chico
58d705110e rename Id suffix to ID to apply naming conventions 2015-02-10 21:40:30 +03:00
Paul O’Shannessy
f6f0bab237 Merge pull request #3103 from zpao/lifecyle-warn-not-throw
Warn when calling setState & other methods at wrong time
2015-02-10 09:58:34 -08:00
Sebastian Markbage
093ab00085 Warn if a non-object value is used in ReactFragment.create
I made this mistake while upgrading a few callers.

I'm leaving this as warning so that it is always safe to wrap any existing
child in React.addons.createFragment without breaking prod.

This makes upgrading easier.
2015-02-10 09:44:14 -08:00
Paul O’Shannessy
01ef83feef Merge pull request #3105 from matiassingers/jasmine-call-count-consistency
Jasmine spies call count property consistency
2015-02-09 18:17:16 -08:00
Matias Singers
b9310a8fa5 Consistently use calls.length instead of callCount for Jasmine spies 2015-02-10 10:11:22 +08:00
Paul O’Shannessy
5967915ec4 Warn when calling setState & other methods at wrong time
Currently we use an invariant to prevent this code pattern. That is really
aggressive for something that doesn't actually put React in a bad state. This
diff replaces invariants with warnings and makes those code paths no-ops.
2015-02-09 17:04:13 -08:00
Sebastian Markbåge
7b0ce2c11f Merge pull request #3100 from sebmarkbage/fragments
Dead code
2015-02-09 14:58:21 -08:00
Sebastian Markbage
18c9a6e54a Dead code
Missed this because lint was off
2015-02-09 14:57:07 -08:00
Sebastian Markbåge
0fdd2a74e2 Merge pull request #3030 from sebmarkbage/fragments
Make keyed object fragments an opaque type
2015-02-09 14:50:46 -08:00
Paul O’Shannessy
d59a039ebd Merge pull request #3097 from zpao/upgrade-eslint
Upgrade to newer eslint, use esprima-fb
2015-02-09 14:32:28 -08:00
Paul O’Shannessy
1455001caa Merge pull request #2998 from rickbeerendonk/docs-conferences
Add Conferences section to the Community Resources on the website
2015-02-09 14:32:04 -08:00
Paul O’Shannessy
dae1dc6292 Upgrade to newer eslint, use esprima-fb
Eslint now allows us to use a different parser, which allows us to use
esprima-fb explicitly. This means we don't have to wait for espree to add
things like rest-param parsing. Though we do need eslint to upgrade its rules
to handle that AST.

I had hoped to enable parsing of our tests but we can't do that until we
change esprima-fb's XJS nodes to JSX.

While I was here, I also enabled the no-unused-vars rule since eslint
understands template strings. I also made the single quote enforcement
actually fail instead of just warn.
2015-02-09 14:27:28 -08:00
Sebastian Markbage
56f51156ba Make keyed object fragments an opaque type
This triggers a warning if you try to pass a keyed object as a child.

You now have to wrap it in React.addons.createFragment(object) which
creates a proxy (in dev) which warns if it is accessed. The purpose of
this is to make these into opaque objects so that nobody relies on its
data structure.

After that we can turn it into a different data structure such as a
ReactFragment node or an iterable of flattened ReactElements.
2015-02-09 14:24:56 -08:00
Rick Beerendonk
1b86246d64 Remove zerowidth space at the beginning of file 2015-02-09 22:17:33 +01:00
Paul O’Shannessy
44634c062a Merge pull request #3082 from hzoo/patch-1
Add React.js Conf Keynote talk (with playlist)
2015-02-09 10:17:37 -08:00
Paul O’Shannessy
358e70cedd Merge pull request #3089 from iamdanfox/fix-markdown-parsing-error-3075
Fix markdown parsing error
2015-02-09 10:12:17 -08:00
Paul O’Shannessy
cb833710af Merge pull request #2968 from ClimbsRocks/patch-5
Reordered 'Using Props' before 'Component Properties'
2015-02-09 10:08:44 -08:00
Paul O’Shannessy
a6a64d1ed4 Merge pull request #2854 from cedrics/add-iframe-component
Adds a composite component for an iframe to handle load events
2015-02-09 09:59:01 -08:00
Dan Fox
462ab93d83 Fix markdown parsing error
closes #3075
2015-02-08 11:31:48 +00:00
Paul O’Shannessy
60c2f56e6e Merge pull request #3074 from noyobo/master
fix Chinese docs typos
2015-02-06 17:17:46 -08:00
Paul O’Shannessy
7853260788 Merge pull request #3080 from zpao/upgrade-internal-modules
Upgrade internal modules
2015-02-06 17:17:00 -08:00
Henry Zhu
bcdf8f2375 Add React.js Conf Keynote talk (with playlist) 2015-02-06 18:31:00 -05:00
Jim
3740c51616 Merge pull request #3078 from vincentriemer/patch-1
Fixed pure-render-mixin documentation
2015-02-06 13:33:06 -08:00
Cheng Lou
b6980ab980 [Docs] Add note on classSet deprecation 2015-02-06 16:25:48 -05:00
Jim
c69a9206a4 Merge pull request #3073 from gsklee/patch-3
Fix typos in animation.md
2015-02-06 13:14:30 -08:00
Paul O’Shannessy
705353fbaf Move keyMirror to vendor to match internal move 2015-02-06 12:09:36 -08:00
Vincent Riemer
0bf88f26a4 Corrected pure-render-mixin documentation
Fixed the PureRenderMixin documentation which was incorrectly importing the base React library instead of ReactWithAddons.
2015-02-06 14:34:09 -05:00
Paul O’Shannessy
3525d01b9b Remove more upstream modules that aren't used
Immutable* hasn't been used... ever?
copyProperties, merge were deprecated as part of 0.12. We've replaced
them with Object.assign.
2015-02-06 09:54:52 -08:00
noyobo
7f6c575d9d Chinese docs Typesetting beautification & relate links 2015-02-06 19:44:14 +08:00
noyobo
9296f15682 Chinese docs typo 2015-02-06 17:31:33 +08:00
YouBao Nong
8197bface7 sync up Chinese docs links 2015-02-06 16:26:43 +08:00
YouBao Nong
7cb1b9bdb2 fix next page link typo
下一页链接错误
2015-02-06 15:53:45 +08:00
Preston Parry
0903120ad1 Update tutorial.md 2015-02-05 22:57:36 -08:00
G. Kay Lee
678ec31e41 Fix typos 2015-02-06 14:47:56 +08:00
Paul O’Shannessy
8ab0ecba13 Sync internal modules
We've actually diverged more with some modules, but we don't want
a cascade of dependencies out here. Mostly, the changes internally that
we don't want are tied to FB infrastructure but otherwise are
functionally equivalent (usually around error reporting, code monitoring).
2015-02-05 16:31:54 -08:00
Sebastian Markbåge
007207bac4 Merge pull request #3068 from sebmarkbage/dedupwarning
Warn only once for each class when accessing .type
2015-02-05 15:36:37 -08:00
Sebastian Markbage
140d9b4192 Warn only once for each class when accessing .type
Currently it is a bit too spammy.
2015-02-05 12:32:15 -08:00
Andreas Svensson
c7e4f55eb0 Merge pull request #3047 from syranide/escbrow2
Drop processAttributeNameAndPrefix and invalid attribute name escaping
2015-02-05 20:53:47 +01:00
Paul O’Shannessy
123d218eaf Merge pull request #3046 from cobbweb/patch-1
Add autoFocus to supported HTML attributes
2015-02-05 10:50:38 -08:00
syranide
6af987c524 Drop processAttributeNameAndPrefix and invalid attribute name escaping 2015-02-05 09:43:26 +01:00
Andreas Svensson
04e6d02e40 Merge pull request #1599 from syranide/escbrow
Split escapeTextForBrowser into escapeTextContentForBrowser and quoteAttributeValueForBrowser
2015-02-05 09:41:36 +01:00
Andrew Cobby
a4c96d6e9c Add autoFocus to supported HTML attributes
It appears to be supported http://jsfiddle.net/9f48wbsa/1/
2015-02-05 16:45:27 +10:00
Paul O’Shannessy
787200631b Merge pull request #3045 from milanlandaverde/removes-validation-msg
remove extraneous argument to createChainableTypeChecker in ReactPropTypes
2015-02-04 19:36:11 -08:00
Marlon Landaverde
876fdd0190 removes loose validation message 2015-02-04 21:13:59 -06:00
Paul O’Shannessy
7e6c820cd2 Merge pull request #3022 from btholt/master
Added itemRef and itemId for complete microdata support.
2015-02-04 16:57:03 -08:00
Paul O’Shannessy
f2cd1a0591 Merge pull request #2969 from gsklee/patch-1
Update thinking-in-react.md
2015-02-04 15:22:37 -08:00
Paul O’Shannessy
ac4b64059e Merge pull request #3013 from akheron/patch-2
Document React.addons.TestUtils.isElement()
2015-02-04 15:19:08 -08:00
Sebastian Markbåge
3abfe00ae7 Merge pull request #3039 from sebmarkbage/fixismounted
Fix isMounted inside of render
2015-02-04 11:53:07 -08:00
Sebastian Markbage
263800e09b Fix isMounted inside of render
This is apparently used to determine if you can access refs.

Bad pattern, but a pattern nonetheless.
2015-02-04 11:50:04 -08:00
Paul O’Shannessy
99a2ef30ae Merge pull request #3032 from germ13/patch-1
Corrected documentation
2015-02-04 11:46:27 -08:00
Paul O’Shannessy
f77e86834b Merge pull request #3036 from jergason/master
Fix list formatting in glossary
2015-02-04 11:45:05 -08:00
Andreas Svensson
6672a7ec62 Merge pull request #2135 from syranide/ie8enctype
IE8 does not have a setter for property "enctype"
2015-02-04 13:47:54 +01:00
Andreas Svensson
8ca058ac4e Split escapeTextForBrowser into escapeTextContentForBrowser and quoteAttributeValueForBrowser 2015-02-04 13:44:38 +01:00
Jamison Dance
d74d0e3215 Fix list formatting in glossary 2015-02-03 23:34:43 -07:00
juan serrano
3a0534e1b8 Corrected documentation 2015-02-03 18:41:47 -08:00
Lee Byron
9174501771 Merge pull request #2991 from leebyron/state-queue
Set state takes a function
2015-02-03 19:52:26 -05:00
Lee Byron
279b956c9b Set state takes a function
This diff enables setState to accept a function in addition to a state partial. If you provide a function, it will be called with the up-to-date `state, props, context` as arguments.

This enables some nicer syntax for complex setState patterns:

If setState is doing an increment and wants to guarantee atomicy, you need a function:

```
this.setState(state => ({ number: state.number + 1 }));
```

This atomicy is particularly important if setState is called multiple times in a single frame of execution as the result of complex user actions. It's a tricky bug to chase down and difficult to determine how to fix when you find it. The current pattern of reaching into _pendingState relies on an implementation detail.

In this example: props.doAction() may result in your ancestor re-rendering and providing you with new props. If setState is called directly with an object literal referencing `this.props`, it will use the *old* version of props, not the new value. Using a function solves for this case:

```
this.props.doAction();
this.setState((state, props) => ({ number: state.number * props.multiplier }));
```
2015-02-03 19:49:17 -05:00
Paul O’Shannessy
3f60a99cd9 Merge pull request #3016 from hnordt/patch-1
Removing unnecessary returns
2015-02-03 10:46:21 -08:00
Jeff Morrison
acca4b3993 Merge pull request #3020 from syranide/jsxbracketcodemod
Added jsx_orphaned_brackets_transformer for breaking JSX parser change
2015-02-03 09:56:28 -08:00
Héliton Nordt
62213e08df Fix highlighting 2015-02-03 08:38:16 -02:00
Sebastian Markbåge
c8833daf53 Merge pull request #3026 from sebmarkbage/fixdependency
Hot fix cyclic dependency
2015-02-02 23:57:46 -08:00
Sebastian Markbage
e3f95ea293 Hot fix cyclic dependency
We accidentally created an unfortunate cyclic dependency because of the
auto-wrapper hack that uses ReactClass.

Making it injected instead.
2015-02-02 23:55:34 -08:00
Sebastian Markbåge
50c38bbc75 Merge pull request #3023 from sebmarkbage/devtoolsfix
Expose ReactReconciler
2015-02-02 22:07:28 -08:00
Sebastian Markbåge
1172f636cb Merge pull request #3025 from sebmarkbage/fixrendercallback
Always trigger an update when a callback is enqueued.
2015-02-02 22:07:13 -08:00
Brian Holt
7b92d71744 Changed itemId to itemID and added clarity to the comments of where it is specified. 2015-02-02 21:58:00 -08:00
Sebastian Markbage
2702281a13 Always trigger an update when a callback is enqueued.
enqueueCallbackInternal forgot to schedule an update.

We could rely on the implicit contract of enqueueElement to do it. However,
if we're currently outside a transaction, it'll flush synchronously. Before
we enqueue the callback. We could also enqueueCallback before we
enqueueElement, but that causes a fragile relationship between them. E.g.
enqueueElement should not need to schedule an update if it is the same
element.
2015-02-02 20:42:15 -08:00
Sebastian Markbage
e67ff7ee78 Expose ReactReconciler
This can be used by devtools to monkey patch the reconciler and therefore
get notified whenever any internal instance is updated.
2015-02-02 18:15:31 -08:00
Brian Holt
ea67a1d436 Added itemRef and itemId for complete microdata support. 2015-02-02 17:17:04 -08:00
syranide
f3271ad53b Added jsx_orphaned_brackets_transformer for breaking JSX parser change 2015-02-02 23:24:15 +01:00
Andreas Svensson
63c3461af7 Merge pull request #1864 from syranide/ie8text2
Newlines handled incorrectly by innerText in IE8
2015-02-02 21:33:48 +01:00
Andreas Svensson
c371709d23 Newlines handled incorrectly in innerText in IE8 2015-02-02 21:27:27 +01:00
Andreas Svensson
8d6c8a7793 Merge pull request #3017 from syranide/trydefine
Try/catch property deprecation warnings to support IE8
2015-02-02 21:26:18 +01:00
Jim
381a01a19b Merge pull request #3018 from jsfb/assert-not-throw
Expecting transform not to throw.  Removed meaningless comment.
2015-02-02 12:21:05 -08:00
Jim
b207b8698c Expecting transform not to throw. Removed meaningless comment. 2015-02-02 12:19:47 -08:00
Andreas Svensson
387adae3de Merge pull request #3000 from syranide/openbool
Set HTML DOM property "open" to HAS_BOOLEAN_VALUE
2015-02-02 21:11:10 +01:00
syranide
0a1cd56ead Try/catch property deprecation warnings to support IE8 2015-02-02 21:00:04 +01:00
Paul O’Shannessy
6c36b528e2 Merge pull request #2997 from rickbeerendonk/2943-jsx-build-tool-documentation
Documents that JSX tool is transforming files with .js extension (and no...
2015-02-02 11:25:32 -08:00
Paul O’Shannessy
f922664e86 Merge pull request #3007 from JoelOtter/patch-2
Add note linking to up-to-date doc on Flux website
2015-02-02 11:22:45 -08:00
Sebastian Markbåge
534d23d903 Merge pull request #3012 from sebmarkbage/typescript
Use TypeScript Compiler API Directly
2015-02-02 11:21:40 -08:00
Héliton Nordt
8fc4f23cdb Removing unnecessary returns 2015-02-02 17:20:38 -02:00
Paul O’Shannessy
bab94bf2af Merge pull request #3011 from koba04/fix-coponent-api-doc
Fix consistency of component api document
2015-02-02 11:18:10 -08:00
Paul O’Shannessy
8b1cd7509d Merge pull request #3001 from rgarcia/patch-1
remove extraneous comma in tutorial
2015-02-02 11:16:28 -08:00
Paul O’Shannessy
2aeb8a2a6b Merge pull request #2995 from rickbeerendonk/copyright-2015
Update copyright headers for 2015
2015-02-02 11:15:30 -08:00
Paul O’Shannessy
e04bdd8c9b Merge pull request #2999 from sedovsek/master
Changed unit to pixels due to inconsistent font-size rendering of code elements.
2015-02-02 11:05:35 -08:00
Petri Lehtinen
2e232f83bc Document React.addons.TestUtils.isElement() 2015-02-02 10:22:52 +02:00
Sebastian Markbage
f6fd4a8506 Use TypeScript Compiler API Directly
In 1.4.0 we can use the TypeScript API directly to preprocess our files.
This lets us get rid of a dependency.

https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API

We can also use this to provide our default libraries so that we don't
need to keep the references in the test file.
2015-02-01 22:41:00 -08:00
Toru Kobayashi
b7860b7da4 Fix consistency of component api document 2015-02-02 09:52:08 +09:00
Joel Auterson
344d07d7de Add note linking to up-to-date doc on Flux website 2015-02-01 15:26:29 +00:00
Rafael
246fdebf82 remove extraneous comma in tutorial 2015-01-31 12:31:14 -10:00
syranide
aa9edc2a9c Set HTML DOM property "open" to HAS_BOOLEAN_VALUE 2015-01-31 23:11:08 +01:00
Robert Sedovsek
ea94ec8c0e Changed unit to pixels due to inconsitent font-size rendering of code elements. 2015-01-31 22:53:21 +01:00
Rick Beerendonk
f1bd869350 Add Conferences section to the Community Resources on the website 2015-01-31 22:46:03 +01:00
Rick Beerendonk
2de44cf668 Documents that JSX tool is transforming files with .js extension (and not .jsx) by default 2015-01-31 20:59:18 +01:00
Rick Beerendonk
3e0750a4ad Update copyright headers for 2015 2015-01-31 20:18:25 +01:00
Andreas Svensson
905bfcec60 Merge pull request #1912 from syranide/safereuse
Warn if mounting into node with dirty rendered markup
2015-01-31 19:56:34 +01:00
Andreas Svensson
c460ad660b Warn if mounting into node with dirty rendered markup 2015-01-31 19:36:12 +01:00
Andreas Svensson
a170629128 Merge pull request #1568 from syranide/dompurge
Only purgeID on ReactDOMComponent and ReactDOMTextComponent unmount
2015-01-31 18:21:22 +01:00
Lee Byron
508b625313 Merge pull request #2990 from jeffkole/patch-1
Documents that `classSet` concatenates its arguments
2015-01-30 21:45:54 -05:00
Jeff Kolesky
b7530e19eb Documents that classSet concatenates its arguments
Just wanted it to be noted that `classSet` operates in two ways, both of which are valuable.
2015-01-30 16:47:44 -08:00
syranide
a7f0fb7c4f Only purgeID on ReactDOMComponent and ReactDOMTextComponent unmount 2015-01-30 21:32:58 +01:00
Paul O’Shannessy
9f9d833065 Merge pull request #2987 from jsfb/fix-markdown-output-wrap
Fixed linewrap issue on markdown output css.  Fixes #2986
2015-01-30 12:22:44 -08:00
Jim
2ea00ea772 Fixed linewrap issue on markdown output css. Fixes #2986 2015-01-30 12:19:18 -08:00
Jim
ddb1c7470e Merge pull request #2960 from jsfb/add-detectable-prefix-to-reactelement-warning
Add detectable prefix to ReactElement proptype warning.
2015-01-30 12:14:33 -08:00
Paul O’Shannessy
bab59cd090 Pull in 0.13 beta blog post from 0.12-stable branch 2015-01-30 11:49:40 -08:00
Jim
b2f77e6de3 Add detectable prefix to ReactElement proptype warning. 2015-01-30 11:43:57 -08:00
G. Kay Lee
140627b1b2 Update thinking-in-react.md
Make style consistent with `tutorial.md`
2015-01-28 16:59:03 +08:00
Paul O’Shannessy
5bd078508a v0.13.0-beta.1 2015-01-27 21:13:35 -08:00
Paul O’Shannessy
bd56b731de Merge pull request #2967 from zpao/jest-match-internal
[jest] Use persistModuleRegistryBetweenSpecs
2015-01-27 20:54:19 -08:00
Paul O’Shannessy
657e30771a Merge pull request #2966 from zpao/grunt-jest
Run jest with grunt, add to travis
2015-01-27 20:51:39 -08:00
Paul O’Shannessy
e2d3370aa9 Merge pull request #2964 from zertosh/no-derequire-when-minifying
Remove "derequire" from minified bundles
2015-01-27 20:51:08 -08:00
Preston Parry
5776dc7918 Update tutorial.md 2015-01-27 20:27:16 -08:00
Paul O’Shannessy
14d88d4e38 [jest] Use persistModuleRegistryBetweenSpecs
This more closely matches how we have jest configured at FB, so when we
pull in and run internally we will have fewer things to waste time on.
2015-01-27 19:17:31 -08:00
Paul O’Shannessy
49eb84efdd Run jest with grunt, add to travis
This is to make sure we don't end up with differences in our different
testing methods. We may switch out the failure allowances later (maybe
just jest will be good enough and we can let phantom fail for a little
bit).
2015-01-27 18:04:58 -08:00
Paul O’Shannessy
dbdeb078ce [testing] dump the cache when depending on warning messages
It's possible to configure Jest to not dump the module cache between
specs. This makes it tricky when we silence warnings one a 2nd call.

In this case, the same message was getting logged so when we expected
the count of warning calls to increment, it didn't.
2015-01-27 16:02:00 -08:00
Jim
2ea1f51fe8 Merge pull request #2965 from ClimbsRocks/patch-4
Docs wording tweak: subject verb agreement
2015-01-27 14:45:15 -08:00
Preston Parry
e4352efc21 Update 04-multiple-components.md 2015-01-27 14:34:35 -08:00
Andres Suarez
5c5fc5e316 Remove "derequire" from minified bundles 2015-01-27 16:53:18 -05:00
Paul O’Shannessy
9801f2d8ab Merge pull request #2940 from kevinold/2749-consistent-use-of-spys-or-mocks
update to use spyOn for console.warn #2749
2015-01-27 13:38:56 -08:00
Ben Alpert
513433b370 Merge pull request #2962 from ClimbsRocks/patch-3
Docs wording tweak for clarity
2015-01-27 11:59:00 -08:00
Ben Alpert
8174262135 Merge pull request #2961 from ClimbsRocks/patch-1
Rewording for clarity
2015-01-27 11:58:36 -08:00
Preston Parry
33ecec07cb Update 02.1-jsx-in-depth.md 2015-01-27 11:22:21 -08:00
Preston Parry
cadbe1d27e Rewording for clarity 2015-01-27 11:04:21 -08:00
Sebastian Markbåge
8bbaa95a49 Merge pull request #2948 from jergason/master
do not validate propTypes in production
2015-01-27 10:55:14 -08:00
Sebastian Markbåge
61c4497d58 Merge pull request #2959 from sebmarkbage/createmixin
We don't currently have a way to trace the origin of a mixin
2015-01-27 10:39:25 -08:00
Sebastian Markbåge
b3f96d97f9 Merge pull request #2957 from sebmarkbage/renamecomponent
Rename ReactComponentBase -> ReactComponent
2015-01-27 10:39:07 -08:00
Sebastian Markbage
295ef0063b We don't currently have a way to trace the origin of a mixin
This makes it more difficult to find bugs in mixins both dynamically
and using a static type system.

We also don't have a way to find these to be upgraded to a new mixin
syntax if we needed to.

This hook is currently an optional noop but could be made required to
create a mixin class.
2015-01-27 09:36:14 -08:00
Sebastian Markbage
c3c98084b9 Rename ReactComponentBase -> ReactComponent
We freed up this internal name by removing the internal base class.
We're now free to use this name as it was intended.

ReactDOMComponent and ReactCompositeComponent are still confusing as
they're internal but we'll rename them later.
2015-01-27 09:22:07 -08:00
Jamison Dance
f61ca8d307 don't validate propTypes in production
Switch to warnings so code execution doesn't differ between prod and
dev.
2015-01-27 09:45:20 -07:00
Sebastian Markbåge
16a56afada Merge pull request #2936 from sebmarkbage/refactorlifecycles
Use Singleton LifeCycle State
2015-01-27 01:26:30 -08:00
Sebastian Markbage
bebc568ceb Use Singleton LifeCycle State
All entry points are for reconciliation are within batching strategies.

Since we don't have any batching strategies with synchronous updates,
there can't be more than one life-cycle method on the stack at any given
time.

Therefore, it's safe to move the composite life cycle flag to a singleton.
This saves us some memory management.

I think that we can get rid of these life cycle states completely in the
future.
2015-01-27 01:19:31 -08:00
Sebastian Markbåge
7e6251887f Merge pull request #2935 from sebmarkbage/batchupdates
Batch updates in initial render
2015-01-27 01:06:56 -08:00
Sebastian Markbage
9811b10aaa Batch updates in initial render
Currently, the first setState that happens during initial render will
start a new batch. Any subsequent updates will be batched. That means that
the first setState is synchronous but any subsequent setStates are
asynchronous.

This commit makes it so that the batching starts at the root. That way all
the setStates that happen within life-cycle methods are asynchronous.
2015-01-27 01:00:59 -08:00
Sebastian Markbåge
b3df7cabb7 Merge pull request #2930 from sebmarkbage/updatequeue
Extract setState, setProps etc into ReactUpdateQueue
2015-01-27 00:57:44 -08:00
Sebastian Markbage
ed7332c749 Extract setState, setProps etc into ReactUpdateQueue
I originally did this work so that we could allow setState to be called
before the internal ReactCompositeComponent was constructed. It's unlikely
that we'll go down that route now but this still seems like a better
abstraction. It communicates that this is not immediately updating an
object oriented class. It's just a queue which a minor optimization.
It also avoids bloating the ReactCompositeComponent file.

Since they both depend on the life cycle I break that out into a common
shared dependency. In a follow up I'll refactor the life-cycle management.
2015-01-27 00:55:25 -08:00
Sebastian Markbage
103bf101ae Fix broken jest test
jest accidentally picked up this .d.ts file as a test.

I'll just move it out to fix it.
2015-01-26 23:37:30 -08:00
Sebastian Markbåge
9b23807cfd Merge pull request #2953 from sebmarkbage/callbacktests
Add Tests to Callbacks of the Life Cycles
2015-01-26 23:30:14 -08:00
Sebastian Markbage
fd077d7492 Add Tests to Callbacks of the Life Cycles
This adds some much needed tests of the callbacks to setState, setProps
and render.
2015-01-26 23:26:24 -08:00
Jim
61ee74b562 Merge pull request #2941 from kevinold/2870-update-warning-calls
Update warning calls to use %s #2870
2015-01-26 22:06:42 -08:00
Kevin Old
f0ea2b5979 update to use spyOn for console.warn #2749 2015-01-26 21:51:42 -06:00
Kevin Old
e8ef06783a Update warning calls to use %s #2870 2015-01-26 21:39:43 -06:00
Paul O’Shannessy
c6d1904f24 Merge pull request #2951 from mzabriskie/semicolon
Provide warning when using styles containing a semicolon
2015-01-26 18:32:57 -08:00
Jim
c3522b80a5 Merge pull request #2920 from jsfb/move-proptype-validation
Move propType validation to element instead of class.
2015-01-26 17:21:01 -08:00
Sebastian Markbåge
46ae2f4e55 Merge pull request #2952 from sebmarkbage/typescript
Add Basic TypeScript Class Test
2015-01-26 17:19:18 -08:00
Jim
6ee5299b4a Move propType validation to element instead of class.
Conflicts:
	src/classic/element/ReactElementValidator.js
2015-01-26 17:16:49 -08:00
Sebastian Markbage
f837cc289e Move component class instantiation into ReactCompositeComponent
We need to move instantiation into the mount phase for context purposes.

To do this I moved the shallow rendering stuff into ReactTestUtils and
reused more of the existing code for it by instantiating a noop child.

Everywhere we refer to the "type" we should pass it to ReactNativeComponent
to resolve any string value into the underlying composite.
2015-01-26 17:16:21 -08:00
mzabriskie
ae5a124745 Using %s in warning message 2015-01-26 18:09:21 -07:00
mzabriskie
fca0fdc115 Better tests 2015-01-26 18:08:51 -07:00
Sebastian Markbage
6c145c31f5 Add Basic TypeScript Class Test
As part of the new class effort it is now possible to define React
Components using any type of generic JavaScript class syntax.

This includes TypeScript classes. This test ensures that we don't regress
that support, and also serves as an example for using React in TypeScript.
TypeScript provides a good demo of where we think property initializers
are going.

We don't have any official *type* support for TypeScript yet.

This test trails the ReactES6Class-test file. Some manual tweaking is
required when converting tests.
2015-01-26 16:59:11 -08:00
mzabriskie
b6edbae3fc Renaming assertValidStyle to warnValidStyle 2015-01-26 17:50:35 -07:00
mzabriskie
94fb463c06 Moar tests 2015-01-26 17:45:51 -07:00
mzabriskie
05e2bc6b5c Fixing lint failures 2015-01-26 17:41:54 -07:00
mzabriskie
4054bb13cd Provide warning when using styles containing a semicolon 2015-01-26 17:33:44 -07:00
Paul O’Shannessy
96058a10ee Merge pull request #2939 from patlaughlin/patch-1
Update 06-transferring-props.md
2015-01-26 16:32:09 -08:00
Sebastian Markbåge
d750cf7401 Merge pull request #2942 from sebmarkbage/metamatchers
Add Meta Matchers for Testing Tests
2015-01-26 16:05:40 -08:00
Sebastian Markbage
3bbf6ce1a5 Add Meta Matchers for Testing Tests
This adds a matcher called toEqualSpecsIn which executes two test suites,
without reporting the result. It then compares the specs and the number
of expects executed by each spec.

This will be used to ensure that tests written in other languages test the
same thing as the base line, ES6 classes.

Sets up CoffeeScript equivalence test.
2015-01-26 15:50:57 -08:00
Sebastian Markbåge
e6672a3a03 Merge pull request #2944 from sebmarkbage/coffeescript
Add CoffeeScript Class Test
2015-01-26 11:10:18 -08:00
Sebastian Markbage
5f150822e6 Add CoffeeScript Class Test
As part of the new class effort it is now possible to define React
Components using any type of generic JavaScript class syntax.

This includes CoffeeScript. This test ensures that we don't regress that
support, and also serves as an example for using React in CoffeeScript.

This test fail trails the ReactES6Class-test file. Some manual tweaking is
required when converting tests.
2015-01-26 02:19:35 -08:00
Patrick Laughlin
51e0610a62 Update 06-transferring-props.md 2015-01-25 22:03:57 -05:00
Sebastian Markbåge
4486a17c24 Merge pull request #2933 from sebmarkbage/pendingcontext
Remove _pendingContext
2015-01-24 21:54:36 -08:00
Sebastian Markbage
adabfe2f49 Remove _pendingContext
There is no way to queue an update to a context so there is no need for
this field. The only way to get a new context is from above.

Soon _pendingElement will get the same treatment. Once _setPropsInternal
can be removed.
2015-01-24 20:09:14 -08:00
Sebastian Markbåge
1c90efbf7c Merge pull request #2923 from sebmarkbage/dropcomponentmixin
Replace ReactComponentMixin with ReactReconciler
2015-01-23 18:06:50 -08:00
Sebastian Markbage
690409a912 Replace ReactComponentMixin with ReactReconciler
Instead of putting the shared code in a base class method, we use a wrapper
call around all invokations. That way they're free to add code before AND
after the non-shared code.

That way we ensure that component extensions don't need to implement
ReactComponentMixin and do super() calls into it. This helps to create a
tighter API for custom component extensions.

This provides the first step towards moving these methods to static
methods which allows to use a different dispatch mechanism instead of
virtual method calls. E.g. pattern matching.
2015-01-23 17:27:42 -08:00
Ben Alpert
ac7677bb11 Update .mailmap for me 2015-01-23 11:10:22 -08:00
Sebastian Markbåge
0e108b180a Merge pull request #2918 from sebmarkbage/fixcontexts
Move Component Class Instantiation into ReactCompositeComponent
2015-01-23 10:41:47 -08:00
Sebastian Markbage
9abd1133c9 Pass context to the constructor
This should reenable reading this.context from getInitialState.

Added a bunch of tests for this too.
2015-01-23 10:09:45 -08:00
Sebastian Markbage
766a79c695 Move component class instantiation into ReactCompositeComponent
We need to move instantiation into the mount phase for context purposes.

To do this I moved the shallow rendering stuff into ReactTestUtils and
reused more of the existing code for it by instantiating a noop child.

Everywhere we refer to the "type" we should pass it to ReactNativeComponent
to resolve any string value into the underlying composite.
2015-01-23 10:09:45 -08:00
Kirk Steven Hansen
3d37c95533 Typo in first commit. 2015-01-22 23:34:14 -06:00
Kirk Steven Hansen
b4007e85b8 Updated tutorial to be more clear about the dependence on the --harmony flag. 2015-01-22 23:30:02 -06:00
Sebastian Markbåge
8616a6f60e Merge pull request #2919 from sebmarkbage/removecreateref
Remove React.createRef API
2015-01-22 19:13:55 -08:00
Sebastian Markbage
a3a464c8fc Remove React.createRef API
This API was removed so this won't work.
2015-01-22 19:11:11 -08:00
Ben Alpert
f9821de909 Merge pull request #2917 from spicyj/ref-composite
Switch first-class refs to use functions
2015-01-22 18:19:05 -08:00
Ben Alpert
322bde6eb0 Switch first-class refs to use functions
Closes #1373.

Test Plan: jest
2015-01-22 18:10:25 -08:00
Jim
734aedb977 Merge pull request #2892 from jsfb/fbme-url-for-dangerouslySetInnerHtml
Added fb.me url to error message.
2015-01-22 17:07:28 -08:00
Ben Alpert
a534264c1e Merge pull request #2916 from spicyj/ref-composite
Move ref code to ReactCompositeComponent
2015-01-22 16:01:51 -08:00
Ben Alpert
9c3d6b8881 Move ref code to ReactCompositeComponent
You can only get a ref to a ReactCompositeComponent, so move the ref code here which gives us more flexibility to put it at the correct time in the lifecycle.

There should be no behavior change in this commit.

Test Plan: jest
2015-01-22 15:36:59 -08:00
Paul O’Shannessy
3d109aa11b Merge pull request #2915 from zpao/lint-fixup
Fix a couple small lint issues
2015-01-22 14:56:25 -08:00
Paul O’Shannessy
c33d443c0b Fix a couple small lint issues
These aren't caught by eslint yet :(
2015-01-22 14:39:08 -08:00
Sebastian Markbåge
8a5c5ba69d Merge pull request #2913 from sebmarkbage/typewarning
Add warning when accessing .type on a component class
2015-01-22 13:39:07 -08:00
Sebastian Markbage
1ed1d7a158 Add warning when accessing .type on a component class
Since we removed the wrapper factory around classes, the class is just
the class now so there is no need for this indirection property.
2015-01-22 13:26:34 -08:00
Paul O’Shannessy
6588a84a0f Merge pull request #2765 from zpao/jsxtransformerlinenumber
Check for lineNumber support before using it
2015-01-22 12:58:51 -08:00
Jim
b94adc9724 Added fb.me url to error message. 2015-01-22 12:56:52 -08:00
Paul O’Shannessy
f8a214137a Merge pull request #2903 from tendant/merge-conflicts-in-translation
Update documents for Chinese translation
2015-01-22 12:55:53 -08:00
Paul O’Shannessy
92e361709c [docs] Use current date in copyright footer
This will be based on the site generation time, making doc generation
slightly less deterministic but that's ok. Now we won't depend on
helpful community members updating it for us (#2874) when we forget,
it'll just happen naturally the next time the site is generated.
2015-01-22 12:50:52 -08:00
Jim
54b565de93 Merge pull request #2518 from jsfb/documentation-for-dangerouslySetInnerHtml
Document justification for dangerouslySetInnerHTML, fixes #2256
2015-01-22 10:52:47 -08:00
Ben Alpert
76e1d5a542 Merge pull request #2902 from swestwood/patch-2
Correctly highlight changed line in tutorial.
2015-01-22 08:27:29 -08:00
Lei
943c2aa77a Add Chinese translation of reusable-components 2015-01-21 19:43:24 -08:00
Lei
833fcb6593 Add Chinese translation of multiple-components 2015-01-21 19:34:40 -08:00
Paul O’Shannessy
6247f30103 Merge pull request #2890 from amykyta/patch-1
Update 02.1-jsx-in-depth.md
2015-01-21 19:07:01 -08:00
Timothy Yung
b403af192d Merge pull request #2900 from wincent/test-desc-fix
Fix inaccurate spec description
2015-01-21 18:56:33 -08:00
Paul O’Shannessy
4b2e89dd99 Add npm run build
It's a "shortcut" to `grunt build`
2015-01-21 17:23:36 -08:00
Sophia Westwood
a19966f2ea Correctly highlight changed line in tutorial.
This excerpt adds the onSubmit handler to the form element, but the line was not highlighted as having been modified.
2015-01-21 17:15:31 -08:00
Greg Hurrell
76fe572a97 Fix inaccurate spec description
The string here was initially accurate, but got out of sync with reality
when the commit was revised (as 892e357fd5).
2015-01-21 17:07:29 -08:00
Timothy Yung
892e357fd5 Merge pull request #2894 from yungsters/local-event-trap-mixin
Fix LocalEventTrapMixin for Bad Tree State
2015-01-21 15:34:32 -08:00
yungsters
a7aca51f1e Throw for Misue of LocalEventTrapMixin
Summary:
If `getDOMNode()` returns null in `LocalEventTrapMixin`, `listener` will also be null and `accumulateInto` will throw. This changes `LocalEventTrapMixin` to throw a more helpful error message.

Test Plan:
Ran unit test successfully:

```
npm test LocalEventTrapMixin-test.js
```
2015-01-21 15:30:04 -08:00
Jim
6f44f6049e Document justification for dangerouslySetInnerHTML, fixes #2256
Conflicts:
	docs/_data/nav_tips.yml
	docs/tips/17-children-undefined.md
2015-01-21 12:47:36 -08:00
Isaac Salier-Hellendag
972befe0b6 Merge pull request #2889 from salier/react-default-perf
Repair ReactDefaultPerf
2015-01-21 13:28:53 -06:00
amykyta
b8f3c7f7fb Update 02.1-jsx-in-depth.md 2015-01-21 12:22:29 -05:00
Isaac Salier-Hellendag
de54d84051 Repair ReactDefaultPerf
Update ReactDefaultPerf to properly record component names.
2015-01-21 10:52:43 -06:00
Cedric Sohrauer
5f837074f9 adds a composite component for an iframe to handle load events
This is basically a copy of ReactDOMImg
2015-01-21 10:33:34 +01:00
Paul O’Shannessy
ce5346f2ce Merge pull request #2884 from chenglou/fix-ex-source-map
Temporarily comment out bundle-collapser for JSXTransformer
2015-01-20 18:55:39 -08:00
Paul O’Shannessy
f9c393f4fb Fix strict mode violoation in test 2015-01-20 18:26:51 -08:00
Cheng Lou
51d74ca36c Temporarily comment out bundle-collapser for JSXTransformer
This will at least make the examples run while we fix the issue.
2015-01-20 20:27:59 -05:00
Paul O’Shannessy
06de3f31f0 Merge pull request #2875 from kchia/patch-2
Update 03-interactivity-and-dynamic-uis.md: correct typo
2015-01-20 16:42:27 -08:00
Paul O’Shannessy
0a62a04909 Merge pull request #2881 from camsong/master
Add Chinese translation to several pages.
2015-01-20 16:41:58 -08:00
Sebastian Markbage
a5657d213c Fix lint 2015-01-20 14:40:19 -08:00
Paul O’Shannessy
c778e61da0 Fix ES6Class test so it runs in browsers
document.createElement throws an error if you don't pass it any
arguments. Neither PhantomJS nor jest (via jsdom at version jest is
using) behave as browsers do now so this went unnoticed.
2015-01-20 14:30:33 -08:00
Sebastian Markbåge
2d75b11097 Merge pull request #2808 from sebmarkbage/modernclasses
New class instantiation and initialization process
2015-01-20 14:28:40 -08:00
Sebastian Markbage
291a92c4a6 New class instantiation and initialization process
This allows state to be set up in the constructor instead of through
getInitialState. getInitialState is now considered part of "classic".
Therefore, they move into ReactClass's constructor.

As a consequence of this, we no longer have a mapping between the internal
representation and the public instance during the mounting process.
Because the constructor hasn't returned yet.

We used to have a special case for calling setState in getInitialState
which was just ignored. This makes that throw and the component is
considered unmounted during the construction phase.
2015-01-20 14:27:28 -08:00
Jim
f92967c886 Merge pull request #2853 from jsfb/warn-only-on-read
Eliminate context warnings when component isn't reading the conflicting context variable
2015-01-20 11:57:30 -08:00
Cam Song
1694aff89e Add Chinese translation to 7 more pages.
Translate 'Note' to '注意' instead of '提示' to make it more sensible.
2015-01-20 00:15:16 +08:00
Hou Chia
9f18ccdce9 Update 03-interactivity-and-dynamic-uis.md: correct typo
My file change corrects a typo in the document.

Best, 
Hou
2015-01-18 00:35:27 -08:00
Paul O’Shannessy
c6686768eb Merge pull request #2874 from Carlsson87/patch-1
Update footer with correct year
2015-01-17 12:21:21 -08:00
Daniel Carlsson
4ffdbefaa2 Friends don't let friends look foolish on the internet
Updated your footer =)
2015-01-17 20:16:24 +01:00
Paul O’Shannessy
f656f1966e Merge pull request #2297 from pedronauck/docs-namespace-in-jsx
Add a section at 'jsx-in-depth' talking about namespaced components
2015-01-16 16:21:22 -08:00
Paul O’Shannessy
4f50071de0 Merge pull request #2675 from af/topLevelAPIDocs
Top level api docs for createFactory
2015-01-16 13:18:28 -08:00
Paul O’Shannessy
d6aa588dfc Merge pull request #2360 from beausmith/patch-1
Highlighted changed lines in examples
2015-01-16 13:10:00 -08:00
Paul O’Shannessy
31002e0cc1 Merge pull request #2707 from camsong/master
More Chinese Doc Translation
2015-01-16 13:06:40 -08:00
Paul O’Shannessy
1b85e611ad Merge pull request #2734 from Minwe/master
add Forms and Event System docs Chinese translation
2015-01-16 13:06:12 -08:00
Paul O’Shannessy
d471fb4c0b Merge pull request #2795 from chenglou/tips-lib
[Docs] Tip on integration with other libraries
2015-01-16 13:05:43 -08:00
Paul O’Shannessy
69d40d1be3 Merge pull request #2824 from zpao/docs-tutorial-server
[docs] Talk about running a server in tutorial
2015-01-16 13:05:19 -08:00
Ben Alpert
1428ea7823 Merge pull request #2502 from fabiomcosta/patch-4
Removing unecessary resize listener
2015-01-16 12:08:34 -08:00
Paul O’Shannessy
deae575dae v0.13.0-alpha.2 2015-01-16 10:33:42 -08:00
Paul O’Shannessy
588032da51 Update package deps 2015-01-16 10:33:42 -08:00
Paul O’Shannessy
2de1545eae Merge pull request #2867 from zpao/no-warn-mock-methods
Don't warn about plain classes when in mocked components
2015-01-15 16:45:05 -08:00
Paul O’Shannessy
069aec1d42 Don't warn about plain classes when in mocked components
Mocking both doesn't copy properties that start with an underscore, nor
does it copy values, only nested objects.
2015-01-15 16:39:57 -08:00
Sebastian Markbåge
c01507fd11 Merge pull request #2866 from sebmarkbage/fixbindwarning
Don't bind callbacks to setState, setProps etc.
2015-01-15 15:36:50 -08:00
Paul O’Shannessy
45c0747a17 Merge pull request #2851 from jsfb/unique-key-in-dev-only
The unique key warning should only happen in dev.
2015-01-15 15:08:43 -08:00
Sebastian Markbage
d7d3ea5560 Don't bind callbacks to setState, setProps etc.
We added a bind to the public instance, but instead we can just pass the
public instance as the context when we execute.

This avoids a warning that fires when we call bind on auto-bound methods.
2015-01-15 14:00:45 -08:00
Paul O’Shannessy
8e6e98b387 Merge pull request #2865 from zpao/revert-jasmine-helper
Revert "Merge pull request #2814 from jsfb/testutils-consolemock"
2015-01-15 13:47:34 -08:00
Paul O’Shannessy
967435b249 Revert "Merge pull request #2814 from jsfb/testutils-consolemock"
This reverts commit 9514861d93, reversing
changes made to cdec83732d.
2015-01-15 13:35:57 -08:00
Cheng Lou
251d31a515 Merge pull request #2859 from javawizard/patch-1
ref-08-reconciliation.md: grammar/punctuation fixes
2015-01-15 14:36:27 -05:00
Alex Boyd
941cba679e ref-08-reconciliation.md: grammar/punctuation fixes 2015-01-14 22:40:29 -07:00
Ben Alpert
8d5838af72 Merge pull request #2540 from spicyj/no-mutate-props
Warn when mutating props on a ReactElement
2015-01-14 11:37:43 -08:00
Paul O’Shannessy
892f0a59fe Fix lint on travis
PR #2852 was not quite correct
2015-01-13 16:55:10 -08:00
Paul O’Shannessy
29ca22c2ff Merge pull request #2852 from zpao/lint-fail-travis
Add eslint grunt task, fail travis for it
2015-01-13 16:12:15 -08:00
Paul O’Shannessy
84c83dca2d Add eslint grunt task, fail travis for it
This is it...
2015-01-13 16:11:42 -08:00
Jim
8aa6171fd6 Eliminate context warnings when component isn't reading the conflicting context variable. 2015-01-13 15:34:46 -08:00
Paul O’Shannessy
54c82da15f Merge pull request #2751 from zpao/eslint-fixup
Eslint fixup
2015-01-13 15:27:54 -08:00
Paul O’Shannessy
47ee780caf [lint] fix consistent-returns 2015-01-13 15:26:33 -08:00
Paul O’Shannessy
2126600c37 [lint] disable a couple rules since rest args aren't processed right 2015-01-13 15:26:33 -08:00
Paul O’Shannessy
847357e42e [lint] Fix reasonable lines to 80
I don't agree with 80 on principal but it's what we have for now.

This fixes the reasonable cases. Most of the long lines are in docblocks
with long type information or containing links.
2015-01-13 15:26:33 -08:00
Paul O’Shannessy
e27da99731 [lint] Fix majority of issues eslint found 2015-01-13 15:26:33 -08:00
Paul O’Shannessy
df2ddc5dfa [lint] convert to single quotes 2015-01-13 15:26:33 -08:00
Paul O’Shannessy
df64a67b7f codemod "use strict" to 'use strict' for better linting 2015-01-13 15:26:32 -08:00
Jim
fa40eefa00 Merge pull request #2818 from jsfb/unmasked-context-in-performContextUpdate
Context warning should fire on update, not just initial mount.
Renamed a couple instances of context
2015-01-13 15:05:45 -08:00
Paul O’Shannessy
aeffbef21f Merge pull request #2662 from zpao/eslint
Use eslint
2015-01-13 14:03:16 -08:00
Jim
6b5b1b3f17 The unique key warning should only happen in dev. 2015-01-13 14:03:00 -08:00
Paul O’Shannessy
3f8d4eaa63 Use eslint
These rules are very close to what we have internally. We may still miss
a couple things (jsdoc params being a big one) but it's good enough.
This is also more restrictive than what we enforce internally, but it's
for the best.
2015-01-13 14:01:34 -08:00
Sebastian Markbåge
7a3083af36 Merge pull request #2806 from sebmarkbage/baseclass
Warn when defined methods are used in plain JS classes
2015-01-13 11:40:52 -08:00
Sebastian Markbage
2330962d25 Warn when defined methods are used in plain JS classes
In ReactClass we use early validation to warn you if a accidentally defined
propTypes in the wrong place or if you mispelled componentShouldUpdate.

For plain JS classes there is no early validation process. Therefore, we
wait to do this validation until the component is mounted before we issue
the warning.

This should bring us to warning-parity with ReactClass.
2015-01-13 11:29:28 -08:00
Sebastian Markbåge
d138f9a35b Merge pull request #2805 from sebmarkbage/baseclass1
Introducing ReactComponentBase base class
2015-01-13 11:00:56 -08:00
Sebastian Markbage
ff032dc857 Introducing ReactComponentBase base class
This is the base class that will be used by ES6 classes.

I'm only moving setState and forceUpdate to this base class and the other
functions are disabled for modern classes as we're intending to deprecate
them. The base classes only have getters that warn if accessed. It's as if
they didn't exist.

ReactClass now extends ReactComponentBase but also adds the deprecated
methods. They are not yet fully deprecated on the ReactClass API.

I added some extra tests to composite component which we weren't testing
to avoid regressions.

I also added some test for ES6 classes. These are not testing the new
state initialization process. That's coming in a follow up.
2015-01-13 10:54:19 -08:00
Jim
e4842b4ae2 Context warning should fire on update, not just initial mount.
Renamed a couple instances of context to make it clear if it was masked/unmasked
2015-01-12 16:40:08 -08:00
Ben Alpert
90053da7bd Merge pull request #2844 from kchia/patch-1
Update README.md insert comma
2015-01-12 09:45:52 -10:00
Hou Chia
08c7c556de Update README.md insert comma
The file change inserts a missing comma.

Best,
Hou
2015-01-12 11:29:17 -08:00
Jim
d94acc0363 Merge pull request #2830 from jsfb/remove-tag-warning
Removed unknown tag warning/whitelist.
2015-01-12 10:42:44 -08:00
Ben Alpert
a5aacb947f Warn when mutating props on a ReactElement
Test Plan: jest. Also used ballmer-peak in IE8 to verify that it still works.
2015-01-11 10:45:37 -10:00
Christopher Chedeau
f50da7ec63 Merge pull request #2832 from kikyous/patch-1
Update 07-forms.md
2015-01-10 13:54:05 -08:00
Jim
61f7a5613b Removed unknown tag warning/whitelist. 2015-01-09 11:46:47 -08:00
chen
bb52715f1c Update 07-forms.md 2015-01-09 10:19:42 +08:00
Paul O’Shannessy
8babd0ada3 [docs] Talk about running a server in tutorial
We've talked about this a few times and even half done it. This is for
real.
2015-01-07 17:26:54 -08:00
Paul O’Shannessy
5394acdb4b Merge pull request #2799 from stkb/master
Wrap setInnerHTML in Windows 8 apps (Fixes #441)
2015-01-07 16:47:32 -08:00
Paul O’Shannessy
4772967e29 Remove period from findDOMNode test filename 2015-01-07 15:16:31 -08:00
Paul O’Shannessy
6204aeec7d Merge pull request #2822 from zpao/rm-immutable
Remove LegacyImmutableObject
2015-01-07 13:27:21 -08:00
Jim
9514861d93 Merge pull request #2814 from jsfb/testutils-consolemock
Added jasmine matcher that expects calls to console.warn.
2015-01-07 13:10:53 -08:00
Paul O’Shannessy
7863175cd9 Remove LegacyImmutableObject
We don't use it and it's not part of the build so nobody else is using
it. You should probably use immutable instead anyway.
2015-01-07 11:37:52 -08:00
Paul O’Shannessy
52e8ba4a40 Add boxFlex and boxFlexGroup to CSS Unitless Properties
Fixes #2812
2015-01-07 11:27:43 -08:00
Jason Bonta
cdec83732d suggesting the use of immutable js for comparisons 2015-01-07 10:46:50 -08:00
Jim
bd4aff062d Added jasmine matcher that expects calls to console.warn. 2015-01-06 14:05:37 -08:00
Paul O’Shannessy
a45472e050 Merge pull request #2793 from huang47/improve/use-bundle-collapser-to-reduce-file-size
use bundle-collapser to reduce browserified file size
2015-01-05 15:43:04 -08:00
Paul O’Shannessy
680bfd54a6 Merge pull request #2807 from JoshSGman/patch-1
Fix Outdated Copyright Year
2015-01-05 15:42:12 -08:00
Jim
e5b3f9aefa Merge pull request #2520 from jsfb/warn-for-dangerouslySetInnerHtml
Added checks for incorrect usage of innerHTML. Fixes #1370
2015-01-05 13:39:16 -08:00
Jim
158e0dd35a Merge pull request #2614 from jsfb/monitor-should-update-owner-is-useful
Find cases where shouldUpdateReactComponent is det
2015-01-05 13:32:43 -08:00
Jim
2a28189bea Merge pull request #2800 from jsfb/getDOMNode-becomes-findDOMNode
Minor updates to findDOMNode, as per additional post-commit CR feedback.
2015-01-05 13:29:14 -08:00
Jim
f507ba3c2b Minor updates to findDOMNode, as per additional post-commit CR feedback. 2015-01-05 13:26:35 -08:00
ShihChi Huang
9bc1961936 apply browserify bundle collapser to all build type 2015-01-05 13:15:16 -08:00
Joshua Goldberg
e926d4ff54 Fix Outdated Copyright Year
Fix outdated copyright year (update to 2015)
The copyright year was out of date. Copyright notices must reflect the current year. This commit updates the listed year to 2015.
2015-01-05 13:52:20 -05:00
Paul O’Shannessy
a7028c467f Merge pull request #2801 from jsfb/componentDidUpdate-docs
Update docs to indicate that componentDDidUpdate is fired after changes are flushed to the DOM.  Fix
2015-01-05 09:34:38 -08:00
Steve Baker
9c55b961d3 code formatting fixes 2015-01-05 18:21:53 +01:00
Paul O’Shannessy
26636e501d Merge pull request #2791 from rickbeerendonk/patch-1
Update ref-09-glossary.md
2015-01-05 09:05:46 -08:00
Paul O’Shannessy
7295f36b0f Merge pull request #2788 from mihaip/master
SyntheticEvent.timeStamp is a number, not a Date
2015-01-05 09:05:19 -08:00
Jim
08c5e42649 Update docs to indicate that componentDDidUpdate is fired after changes are flushed to the DOM. Fixes #2796 2015-01-02 14:02:44 -08:00
Steve Baker
3287ea52fe Wrap setInnerHTML in Windows 8 apps 2015-01-02 20:28:58 +01:00
Cheng Lou
d0f2e7db5f [Docs] Tip on integration with other libraries
Chose this title because it's more eye-catchy than "third-party integration".
2015-01-01 16:09:45 -05:00
ShihChi Huang
f214776a97 use bundle-collapser to reduce browserified file size 2014-12-30 23:16:04 -08:00
Rick Beerendonk
717b6d6249 Update ref-09-glossary.md
Minor grammatical fix.
2014-12-30 23:42:38 -05:00
Mihai Parparita
c0e33e8e76 SyntheticEvent.timeStamp is a number, not a Date
Also makes the a few other attribute types use lowercase (primitive) naming, to be consistent.
2014-12-30 12:06:49 -08:00
Paul O’Shannessy
ebf4cb4fab Merge pull request #2785 from c-das/patch-1
Update 02-displaying-data.md
2014-12-30 06:45:18 -08:00
Chitharanjan Das
b25e2e70d8 Update 02-displaying-data.md
Just a couple of minor grammatical fixes.
2014-12-30 10:49:44 +00:00
Sebastian Markbåge
82a30268a3 Merge pull request #2767 from sebmarkbage/moderntypevalidation
Add late class validation warnings for statics
2014-12-29 12:45:49 -05:00
Sebastian Markbage
82d15c8fd5 Add late class validation warnings for statics
ES6 classes won't have an early validation step. Therefore I added some
extra validation later on in the process. These would've normally have
been caught by createClass in classic React.
2014-12-29 12:43:40 -05:00
Sebastian Markbåge
9cd290a8c8 Merge pull request #2783 from dylanharrington/master
Fix typo in warning for invalid reused markup
2014-12-29 12:14:22 -05:00
Sebastian Markbåge
bd5a91a55c Merge pull request #2768 from sebmarkbage/duplicatetests
Removed some duplicate tests
2014-12-29 09:10:26 -08:00
Dylan Harrington
159ba54b8c Fix typo in warning message for invalid reused markup 2014-12-29 01:55:16 -08:00
Sebastian Markbåge
11f83c1fa0 Merge pull request #2769 from sebmarkbage/breakonwarning
Throw a caught error in the default warning module
2014-12-25 14:47:34 -08:00
Paul O’Shannessy
b98facd76e Merge pull request #2773 from vanesyan/patch-1
Update ref-01-top-level-api.md
2014-12-25 10:42:47 -08:00
Roman Vanesyan
172dec8351 Update ref-01-top-level-api.md
React isn't framework, it's library for UI!?
2014-12-24 14:39:37 +05:00
Paul O’Shannessy
6ca8bf82f5 Merge pull request #2772 from zpao/fixjsdoc
Fixup jsdoc for findDOMNode
2014-12-23 15:58:59 -08:00
Paul O’Shannessy
20c43d4ec8 Fixup jsdoc for findDOMNode 2014-12-23 15:56:05 -08:00
Paul O’Shannessy
41b919bb81 Merge pull request #2771 from zpao/temp-fix-empty-component
Temporarily fix EmptyComponents
2014-12-23 15:43:00 -08:00
Paul O’Shannessy
b2bf83ec85 Temporarily fix EmptyComponents
This a workaround for the problem described in #2770. It should be
temporary because this is really just working around the real problem.
2014-12-23 15:33:53 -08:00
Sebastian Markbage
f1bab136d0 Throw a caught error in the default warning module
This throws an error that is immediately caught. This allows you to use the
debugger's "break on caught exception" feature to break on warnings.

This should help with tracking down these warnings using the stack.

However, it could also add more noise to other debugging pattern.
2014-12-23 14:21:04 -08:00
Sebastian Markbage
8864692237 Removed some duplicate tests
These tests are duplicates of the same test in the same file. Copy/paste
fail.
2014-12-23 13:59:11 -08:00
Paul O’Shannessy
3fec78638d v0.13.0-alpha.1
Bumping version numbers so we can push to npm.
2014-12-23 12:04:23 -08:00
Paul O’Shannessy
343cda72d9 Merge pull request #2760 from alextsg/patch-3
Update 14-communicate-between-components.md for grammatical changes
2014-12-22 13:56:44 -08:00
Paul O’Shannessy
fe1edb60eb Merge pull request #2759 from alextsg/patch-2
Update 05-maximum-number-of-jsx-root-nodes.md for capitalization
2014-12-22 13:56:10 -08:00
Paul O’Shannessy
f0f431e428 Check for lineNumber support before using it 2014-12-22 13:43:59 -08:00
Jim
e0725341cf Merge pull request #2646 from jsfb/getDOMNode-becomes-findDOMNode
Added findDOMNode, as we move toward deprecating getDOMNode
2014-12-22 13:05:49 -08:00
Alexander Tseung
92c37ffb3d Update 14-communicate-between-components.md 2014-12-21 00:14:34 -08:00
Alexander Tseung
3fd6ac56c1 Update 05-maximum-number-of-jsx-root-nodes.md 2014-12-20 23:59:34 -08:00
Paul O’Shannessy
f7166d0c97 Merge pull request #2754 from songawee/fix_version_typo
Fix version typo in grunt task
2014-12-20 15:00:37 -08:00
Dennis Johnson
5216460246 Fix version typo in grunt task 2014-12-20 12:29:06 -07:00
Paul O’Shannessy
7ed36c30b1 Merge pull request #2752 from peterblazejewicz/fix/blog-typo
Fix conference year typo in blog post content
2014-12-19 14:30:06 -08:00
Peter Blazejewicz
ef4e75b031 Fix conference year typo in blog post content 2014-12-19 23:06:24 +01:00
Paul O’Shannessy
b7734a7000 Diversity Scholarship blog post 2014-12-19 13:22:23 -08:00
Sebastian Markbåge
6c6ffdb064 Merge pull request #2748 from sebmarkbage/modern
Separate createElement and JSX tests
2014-12-18 18:16:06 -08:00
Sebastian Markbage
cea2c38733 Separate createElement and JSX tests
This essentially copies all classic element creation tests to the modern
JSX tests. The classic tests doesn't use JSX and modern tests do.

The idea is that the JSX tests can start dropping dynamic checks once
we have Flow support for those features. JSX won't be necessary for
dropping dynamic checks. Plain object will also work. Flow will also not
be necessary for JSX. However, the tests should test for the suggested
combination (JSX + Flow).

This also moves some misplaced tests to ReactDOM and Validator.

Note that the modern tests uses ES6 classes. I will add separate tests for
those. However, these are not guaranteed to have .displayName so all our
error messages should check .name if available instead. This should be
better abstracted but I just adhoc fix this for now.
2014-12-18 16:13:29 -08:00
Sebastian Markbåge
60b2241ad4 Merge pull request #2745 from sebmarkbage/types
Add placeholders for static prop type tests
2014-12-18 15:13:36 -08:00
Jim
a463191bb2 Find cases where shouldUpdateReactComponent is determined by the owner. 2014-12-18 14:24:09 -08:00
Paul O’Shannessy
c63de4b79b Merge pull request #2586 from RileyTomasek/master
Fix typo in comment of jquery-bootstrap example
2014-12-18 14:15:30 -08:00
Jim
b46a6ce4bb Added findDOMNode, as we move toward deprecating getDOMNode 2014-12-18 13:55:44 -08:00
Sebastian Markbage
e31f23fc2a Add placeholders for static prop type tests
This is where tests of static prop types should go when we have the
infrastructure set up to handle it.
2014-12-18 13:52:56 -08:00
Sebastian Markbåge
435aac26af Merge pull request #2744 from sebmarkbage/types
Renamed classic/propTypes to classic/types
2014-12-18 13:42:45 -08:00
Sebastian Markbage
019028bec4 Renamed classic/propTypes to classic/types
I want to create a parallel folder for static type checking in the
"modern" folder so lets use the generic "types" name.
2014-12-18 13:40:32 -08:00
Paul O’Shannessy
d488f534ae 0.12.2 starter kit
(cherry picked from commit 6c5cb72cdc)
2014-12-18 12:47:33 -08:00
Paul O’Shannessy
378112f380 v0.12.2 blog post
(cherry picked from commit 2f6a95d5a2)
2014-12-18 12:47:32 -08:00
Paul O’Shannessy
2eb6cf6dd0 Readme + Changelog for 0.12.2
(cherry picked from commit 7468f092ae)
2014-12-18 12:47:32 -08:00
Paul O’Shannessy
3c2fc6440e update docs for 0.12.2 changes
(cherry picked from commit e6e60c4fa8)
2014-12-18 12:47:32 -08:00
Sebastian Markbåge
702eef0bf0 Merge pull request #2740 from facebook/revert-2613-monitor-cloneWithProps
Revert "Monitoring code use of cloneWithProps"
2014-12-18 12:13:34 -08:00
Sebastian Markbåge
7354a699ff Revert "Monitoring code use of cloneWithProps" 2014-12-18 12:13:09 -08:00
Riley Tomasek
84a93fbacf Improve comment in example code
This should make it more clear that even though `$` is used in 4 methods, only 2 of them are crucial for integrating the modal into the components lifecycle methods and the other 2 are just helpers.
2014-12-18 10:05:25 -05:00
minwe
309507955b add Event System doc Chinese translation 2014-12-18 13:10:02 +08:00
minwe
60ffe1e22e add Forms doc Chinese translation 2014-12-18 12:27:28 +08:00
Paul O’Shannessy
11785db573 Merge pull request #2727 from zpao/update-npm-deps
Update NPM dependencies
2014-12-17 16:56:14 -08:00
Paul O’Shannessy
c17ea85483 Merge pull request #2732 from zpao/travis-container
Use containers on TravisCI
2014-12-17 16:54:12 -08:00
Paul O’Shannessy
2620161d93 Merge pull request #2733 from morenoh149/patch-1
Added note for proper example display
2014-12-17 16:17:50 -08:00
Harry Moreno
9adb4447cd Added note for proper example display
jsfiddles weren't showing up for me. Upon further investigation I found that changing to http fixes the embedding.
2014-12-17 12:52:49 -08:00
Paul O’Shannessy
626023fc52 Merge pull request #2726 from zpao/createElement-undefined-null
Protect better against createElement(null/undefined)
2014-12-17 10:46:49 -08:00
Paul O’Shannessy
1bd8990fb2 Use containers on TravisCI
This *should* enabled the caching of node_modules for faster builds. We
may need to tweak this later to make sure node_modules gets updated

See http://blog.travis-ci.com/2014-12-17-faster-builds-with-container-based-infrastructure/
2014-12-17 10:44:07 -08:00
Paul O’Shannessy
50a0d69961 Protect better against createElement(null/undefined)
This adds a warning to React.createElement in __DEV__ about using null
or undefined. This is technically valid since element creation can be
considered safe and usable in multiple rendering environments. But
rendering in a DOM environment with an element with null/undefined type
is not safe.
2014-12-17 10:38:02 -08:00
Paul O’Shannessy
401d4dd108 Update NPM dependencies
This was mostly to update Jest, but the others were the safe ones from
`npm outdated --depth=0`
2014-12-16 14:17:10 -08:00
Paul O’Shannessy
5f4d759a2b Merge pull request #2718 from alextsg/patch-1
Update tutorial.md for grammatical changes
2014-12-16 09:48:23 -08:00
Paul O’Shannessy
558afae61a Changelog, Readme updates for v0.12.1
(cherry picked from commit a067fc0fee)
2014-12-16 09:44:00 -08:00
jeffmo
849e79fef4 Include 0.12.1 starter kit
(cherry picked from commit e9dde65341)
2014-12-16 09:44:00 -08:00
Alexander Tseung
a53270267f Update tutorial.md for grammatical changes
Update tutorial.md to improve grammatical parallelism in features list. Also added periods to follow first item's syntax.

BEFORE: "Live updates: as other users comment we'll pop them into the comment view in real time"
AFTER: "Live updates: other users' comments are popped into the comment view in real time."

BEFORE: "Markdown formatting: users can use Markdown to format their text"
AFTER: "Markdown formatting: users can use Markdown to format their text."
2014-12-15 23:43:26 -08:00
Paul O’Shannessy
f13b4641bb Merge pull request #2716 from RichardLitt/patch-2
Delete extraneous period
2014-12-15 13:16:38 -08:00
Richard Littauer
4f7b37f73a Delete extraneous period 2014-12-15 13:14:00 -08:00
Paul O’Shannessy
6abb1c9e84 Merge pull request #2710 from zpao/lint-fix-again
Fix lint
2014-12-14 22:12:43 -08:00
Aaron Franks
a5ae126630 Docs: ReactComponent -> ReactClass in a few places 2014-12-14 17:03:02 -08:00
Paul O’Shannessy
63d8e0c144 Fix lint 2014-12-14 15:22:24 -08:00
Paul O’Shannessy
0b0fa760cc Merge pull request #2647 from zpao/text-component-expect
Add toBeTextComponentWithValue to reactComponentExpect
2014-12-14 14:33:37 -08:00
Paul O’Shannessy
42ae61d065 Merge pull request #2655 from zpao/rm-deprecated
Remove deprecated methods since 0.12 shipped
2014-12-14 14:33:16 -08:00
Paul O’Shannessy
c46dadea55 Remove deprecated methods since 0.12 shipped 2014-12-14 14:19:44 -08:00
Paul O’Shannessy
c9fb5b258e Add toBeTextComponentWithValue to reactComponentExpect
This was previously possible by looking at renderedChildren and props
but this feels better.
2014-12-14 14:12:29 -08:00
Paul O’Shannessy
ca5d93ca0a Merge pull request #2708 from zpao/strip-types
Enable strip-types transform for internal code
2014-12-14 13:08:34 -08:00
Paul O’Shannessy
a818097a60 Merge pull request #2705 from Swader/patch-1
Update 02-displaying-data.md
2014-12-14 13:00:51 -08:00
Paul O’Shannessy
9016665c0e Enable strip-types transform for internal code
Flow is coming so we need to be ready.
2014-12-14 12:51:39 -08:00
Cam Song
09e0dee307 Sync up previous Chinese documents and several minor updates on formats. 2014-12-14 15:30:10 +08:00
Cam Song
db569f0c0a Add Chinese translation of interactivity-and-dynamic-uis 2014-12-14 15:30:00 +08:00
Bruno Škvorc
e507dc08d5 Update 02-displaying-data.md
Typo fix
2014-12-14 08:03:35 +01:00
Cam Song
f84ede6d34 Add Chinese translation of jsx-gotchas 2014-12-14 04:28:57 +08:00
Sebastian Markbåge
6bb77b5d4d Merge pull request #2700 from sebmarkbage/classic
Move ReactClass, ReactElement and ReactPropTypes into "classic"
2014-12-12 19:53:28 -08:00
Sebastian Markbage
801e953334 Move ReactClass, ReactElement and ReactPropTypes into "traditional"
This moves ReactClass, ReactElement and ReactPropTypes into a legacy folder
but since it's not quite legacy yet, I call it "classic".

These are "classic" because they are decoupled and can be replaced by
ES6 classes, JSX and Flow respectively.

This also extracts unit tests from ReactCompositeComponent, which was
terribly overloaded, into the new corresponding test suites.

There is one weird case for ReactContextValidator. This actually happens in
core, and technically belongs to ReactCompositeComponent. I'm not sure
we will be able to statically validate contexts so this might be a case
for dynamic checks even in the future. Leaving the unit tests in classic
until we can figure out what to do with them.
2014-12-12 17:54:35 -08:00
Paul O’Shannessy
d1ab4cda4b Merge pull request #2694 from camsong/master
Add Chinese translation of js-spread
2014-12-12 09:47:07 -08:00
Cam Song
9c7dc5f3b8 Add Chinese translation of js-spread 2014-12-12 09:33:01 +08:00
Paul O’Shannessy
80ed4d870a Merge pull request #2690 from salier/before-input
Combine BeforeInput and Composition event plugins
2014-12-11 17:08:26 -08:00
Jim
df81c9916b Merge pull request #2695 from jsfb/fix-scry2
Fixed ReactTestUtils scry for TextComponents.  Fix
2014-12-11 16:54:55 -08:00
Jim
74f5b21758 Fixed ReactTestUtils scry for TextComponents. Fixes issue #2654. 2014-12-11 13:12:35 -08:00
Paul O’Shannessy
91eb2e2f99 Merge pull request #2689 from camsong/master
Add Chinese translation of jsx-in-depth
2014-12-10 15:12:55 -08:00
Isaac Salier-Hellendag
9ad0e1d846 Update BeforeInputEventPlugin.js 2014-12-10 11:36:39 -05:00
Isaac Salier-Hellendag
ddaf215b03 Combine BeforeInput and Composition event plugins
In order to improve support for Chinese and Japanese IME input in
Internet Explorer, use a fallback composition state to determine
inserted text. IE composition events are mostly okay, except for
certain punctuation characters that are ignored. Using the fallback, we
can detect these characters.

The fallback is also useful for emitting `beforeInput` events, so it
makes sense to simply combine these plugins.

This change also incorporates a recent change to the Google Input Tools
browser extension that exposes a `data` field via the `detail` object
on the custom composition events it emits.
2014-12-10 11:32:53 -05:00
Cam Song
8621b4d338 Add Chinese translation of jsx-in-depth 2014-12-11 00:19:15 +08:00
Paul O’Shannessy
ed1803dc16 Merge pull request #2679 from tschaub/patch-1
Add missing verb in docs
2014-12-09 14:04:57 -08:00
Tim Schaub
877d00d9ba Add missing verb
This adds a missing verb in JSX-in-depth doc.
2014-12-08 15:08:57 -08:00
Paul O’Shannessy
ba95ce7b6f Merge pull request #2677 from zpao/lint-internal
Fix new lint errors
2014-12-08 12:22:06 -08:00
Paul O’Shannessy
739baa9092 Fix new lint errors
We'll get to lint parity soon and then not need to do this.
2014-12-08 12:18:41 -08:00
Aaron Franks
93ce334368 Add top-level API docs for React.createFactory. 2014-12-08 07:54:13 -08:00
Aaron Franks
09cfe453b8 Add type signature info to top-level API docs. 2014-12-07 23:17:27 -08:00
Ben Alpert
b97bb21ea2 Merge pull request #2672 from cookfront/master
The same problem in issue #2648
2014-12-06 23:50:43 -08:00
cookfront
7fad8fddf1 The same problem in issue #2648 2014-12-07 15:42:51 +08:00
Cheng Lou
cfe97641ce Merge pull request #2671 from benkeen/patch-1
Update 10.6-update.md
2014-12-06 20:12:21 -05:00
Benjamin Keen
2ee870e253 Update 10.6-update.md
Spelling fix.
2014-12-06 15:49:22 -08:00
Paul O’Shannessy
5c1589b81e Merge pull request #2658 from ianobermiller/margin-attrs
Support marginHeight and marginWidth attributes
2014-12-04 19:02:34 -08:00
Paul O’Shannessy
dd844bffc0 Merge pull request #2489 from cody/form
Add Attributes formAction, formEncType, formMethod and formTarget
2014-12-04 19:01:32 -08:00
Ian Obermiller
9d7467e225 Don't need MUST_USE_ATTRIBUTE for margin(Width|Height) 2014-12-04 11:02:35 -08:00
Ian Obermiller
96bd155cbd Support marginHeight and marginWidth attributes
marginHeight and marginWidth are used on iframes to set the default body margin inside the iframe.
2014-12-04 07:35:17 -08:00
Isaac Salier-Hellendag
0e1185cdbf Merge pull request #2653 from salier/ie-selection
Use getSelection in IE where available
2014-12-03 14:19:49 -08:00
Isaac Salier-Hellendag
6b46e80bb9 Use getSelection in IE where available
IE9+ has support for window.getSelection, but we’re still using
document.selection for IE9/10. Only use the old IE selection API if the
modern one is unavailable.
2014-12-03 14:03:26 -08:00
Paul O’Shannessy
3144485cb9 Merge pull request #2635 from zpao/docs/props-state-clarification
[docs] Clarify when state may duplicate props
2014-12-03 11:24:21 -08:00
Paul O’Shannessy
b3cd299ed7 Merge pull request #2639 from zpao/own-jsfiddle
Own our fiddles so we can update them more easily
2014-12-03 11:24:08 -08:00
Paul O’Shannessy
b1971a7e27 Merge pull request #2649 from cookfront/master
In `Transferring Props` guide, `Manual Transfer` section will lead an er...
2014-12-03 11:13:40 -08:00
Paul O’Shannessy
a66430aec3 Merge pull request #2651 from arnihermann/use-charat-not-string-index-markup-diff
Use String.charAt to lookup string characters by index
2014-12-03 10:57:30 -08:00
Árni Hermann Reynisson
fdffec73c3 Use String.charAt for character by index lookup
Using object property accessor for string character lookup breaks in
non-modern browsers.
2014-12-03 14:49:55 +00:00
张敏
218a9ae74d In Transferring Props guide, Manual Transfer section will lead an error
```c
var FancyCheckbox = React.createClass({
  render: function() {
    var fancyClass = this.props.checked ? 'FancyChecked' : 'FancyUnchecked';
    return (
      <div className={fancyClass} onClick={this.props.onClick}>
        {this.props.children}
      </div>
    );
  }
});
React.render(
  <FancyCheckbox checked={true} onClick={console.log}>
    Hello world!
  </FancyCheckbox>,
  document.body
);
```

When click `Hello world!` will lead a `Uncaught TypeError: Illegal invocation` error
2014-12-03 17:28:55 +08:00
Paul O’Shannessy
bd6b10887a Remove unused require from ReactDOM-test
This happened internally in a codemod
2014-12-02 14:39:19 -08:00
Paul O’Shannessy
1bcf6ad77b Merge pull request #2615 from af/createElement-docs
Add top-level API docs section for React.createElement.
2014-12-02 11:19:26 -08:00
Paul O’Shannessy
9021423be9 Merge pull request #2636 from zpao/docs/spread-assign-update
[docs] Remove generic spread, Object.assign  mentions
2014-12-02 11:10:33 -08:00
Paul O’Shannessy
45bddda0f9 Merge pull request #2622 from rafd/patch-1
add note re: handling events in capture phase
2014-12-02 11:10:20 -08:00
Paul O’Shannessy
a76ffd56b7 Merge pull request #2623 from jbhatab/patch-1
Screencast interfacing react + backbone
2014-12-02 10:54:05 -08:00
Blaine Hatab
e1be9c0ad8 Screencast interfacing react + backbone 2014-12-02 10:49:16 -06:00
Paul O’Shannessy
2c2cac00f9 Own our fiddles so we can update them more easily 2014-12-01 19:33:43 -08:00
Paul O’Shannessy
e347e2975f Merge pull request #2616 from christianalfoni/patch-3
Adding link to wiki
2014-12-01 16:03:16 -08:00
Paul O’Shannessy
fc91d2fd72 [docs] Remove generic spread, Object.assign mentions 2014-12-01 13:54:26 -08:00
Paul O’Shannessy
0a3a85bf52 [docs] Clarify when state may duplicate props 2014-12-01 13:46:59 -08:00
Rafal Dittwald
b3438c5f4b Update ref-05-events.md
use backticks and change example into its own sentence
2014-12-01 15:36:01 -05:00
Paul O’Shannessy
4cc2993a01 Merge pull request #2633 from koba04/fix-addons-document
Fix addons documentation of development only part
2014-12-01 12:13:30 -08:00
Jim
aef7c4d1a1 Added checks for incorrect usage of innerHTML. Fixes #1370 2014-12-01 11:10:52 -08:00
Toru Kobayashi
a9115134b5 Fix addons documentation of development only part 2014-12-01 23:17:53 +09:00
Christopher Chedeau
f5a9ea8e03 Merge pull request #2629 from arnihermann/diff-msg-on-checksum-fail
Give context aware message if markup reuse fails
2014-12-01 10:16:40 +00:00
Árni Hermann Reynisson
a352b94f57 Give context aware message if markup reuse fails
The context is an extra message with comparison of where server and
client markup started to differ.
2014-12-01 10:15:07 +00:00
Paul O’Shannessy
5daffbb2c3 Merge pull request #2630 from shamrin/patch-1
fix typo in addons.update() $splice command help
2014-11-30 10:48:24 -08:00
Alexey Shamrin
92862ed601 fix typo in addons.update() $splice command help 2014-11-30 20:20:34 +03:00
Rafal Dittwald
4bc7c46c62 add note re: handling events in capture phase 2014-11-28 15:38:15 -05:00
Christian Alfoni
f09a39d963 Adding link to wiki
Based on conversation in https://github.com/facebook/react/pull/2501. A good place to guide people further in finding the complete set of tools needed to build an application.
2014-11-27 08:48:16 +01:00
Aaron Franks
5e7e07b6d8 Add top-level API docs section for React.createElement. 2014-11-26 23:18:10 -08:00
Jim
5bd0b249b7 Merge pull request #2613 from jsfb/monitor-cloneWithProps
Monitoring code use of cloneWithProps
2014-11-26 16:37:00 -08:00
Jim
d42b285b0c Monitoring code use of cloneWithProps 2014-11-26 16:29:09 -08:00
Paul O’Shannessy
bb97482729 Merge pull request #2610 from zpao/update-commonjs-example
Update commonjs example for 0.12
2014-11-26 13:08:24 -08:00
Paul O’Shannessy
e2dcc4a863 Update commonjs example for 0.12 2014-11-26 13:08:08 -08:00
Paul O’Shannessy
45a19a290c Merge pull request #2553 from mhuggins/headers-attribute
Permit th `headers` attribute
2014-11-26 11:15:21 -08:00
Paul O’Shannessy
c48b877253 Merge pull request #2596 from sebmarkbage/rce
reactComponentExpect expects itself
2014-11-26 11:10:00 -08:00
Paul O’Shannessy
84e35615d2 Merge pull request #2600 from zpao/npm-test
Use jest for `npm test`
2014-11-26 11:09:39 -08:00
Jim
aee73cc463 Merge pull request #2602 from jsfb/context-tripple-equals
Warn if context values differ, related to issue #2
2014-11-25 16:52:09 -08:00
Jim
90d75ab099 Warn if context values differ, related to issue #2112 2014-11-25 16:44:09 -08:00
Paul O’Shannessy
b2ace55d9d Merge pull request #2603 from facebook/revert-2601-rm-fbtransform-syntax
Revert "Remove fbtransform/syntax.js"
2014-11-25 16:43:46 -08:00
Paul O’Shannessy
f7f3df3acc Revert "Remove fbtransform/syntax.js" 2014-11-25 16:42:20 -08:00
Paul O’Shannessy
ce699e4a32 Merge pull request #2601 from zpao/rm-fbtransform-syntax
Remove fbtransform/syntax.js
2014-11-25 15:42:13 -08:00
Jim
3a8fb5fc1e Merge pull request #2597 from jsfb/render-into-document
Replaced document.createElement with ReactTestUtil
2014-11-25 15:35:26 -08:00
Paul O’Shannessy
2a540b3fb7 Remove fbtransform/syntax.js
This was a file we probably never should have synced out in the first
place. We don't use it and it provides the same basic functionality that
bin/jsx provides.
2014-11-25 15:34:28 -08:00
Paul O’Shannessy
fd3f8e70e2 Merge pull request #2566 from zpao/style-fixup
Fix lint warnings, style fixups
2014-11-25 15:11:27 -08:00
Paul O’Shannessy
3ce88d7c17 Use jest for npm test
I've given in and this is easier than `npm run jest`. `grunt test` still
exists and is used by Travis so this has no CI implications.
2014-11-25 15:07:46 -08:00
Paul O’Shannessy
b7b74b7efe Fix lint warnings, style fixups
Followup work for recent PRs
2014-11-25 15:06:30 -08:00
Jim
89fafad255 Replaced document.createElement with ReactTestUtils.renderIntoDocument where container was not subsequently utilized.
Fixes #1250
2014-11-25 12:06:22 -08:00
Steven Luscher
e18d87b53b Merge pull request #2594 from steveluscher/community-round-up-24
Wrote Community Roundup #24
2014-11-25 10:24:47 -08:00
Sebastian Markbage
a530f1c379 reactComponentExpect expects itself
This was a bug when reactComponentExpectInternal was separated from
the normal reactComponentExpect flow.
2014-11-24 18:48:41 -08:00
Steven Luscher
0f488bfe71 Community #24: New Carousel link, spelled react-prism correctly, and removed the whale-speak. 2014-11-24 18:24:52 -08:00
Steven Luscher
c94a48be4f Wrote Community Roundup #24 2014-11-24 18:12:59 -08:00
Sebastian Markbåge
47e18c3ce6 Merge pull request #2593 from sebmarkbage/mountImage
Add additional field for ART reconciler
2014-11-24 17:08:13 -08:00
Sebastian Markbage
61349eb5a6 Add additional field for ART reconciler
ART, just like MultiChild adds an expando property to manage it's diffing
state. This is ugly and bad. We should be moving this state outside the
component for use by the diffing algorithm. This state is not needed by
components nested in composites, and varies by diffing algorithm.

It sucks that I have to add it to every component just to support ART,
but that's the quickest solution, other than disabling preventExtensions.

At least now we know that it sucks.
2014-11-24 17:02:11 -08:00
Jim
e7f4badf4a Merge pull request #2579 from jsfb/context-to-warning-module
Use warning module for context warning instead of invoking console.warn ...
2014-11-24 14:42:23 -08:00
Jim
9f7901fe1d Use warning module for context warning instead of invoking console.warn and monitorCodeUse directly. Depends on https://phabricator.fb.com/D1695279 2014-11-24 13:24:56 -08:00
Christopher Chedeau
f8aee772ce Mention that talks will be recorded 2014-11-24 11:28:42 +00:00
Christopher Chedeau
c32cf03d0b better wording thanks to @jwalke 2014-11-24 10:33:23 +00:00
Christopher Chedeau
fb2be69e9c react.js conf updates 2014-11-24 09:26:00 +00:00
Ben Alpert
582bc932e5 Merge pull request #2583 from spicyj/style-example
Add example for how to use `style` properly
2014-11-21 14:27:32 -08:00
Ben Alpert
1c5443175c Add example for how to use style properly
Test Plan: jest
2014-11-21 12:10:59 -08:00
Ben Alpert
c6ed9df7f3 Merge pull request #2582 from spicyj/rendercomponent
Finish renaming renderComponent -> render
2014-11-21 11:54:36 -08:00
Ben Alpert
23effb7034 Merge pull request #2581 from spicyj/rm-elt-docs
Update variable name and doc type to be accurate
2014-11-21 11:54:26 -08:00
Riley Tomasek
08b6b28902 Fix typo in comment of jquery-bootstrap example 2014-11-21 12:05:39 -05:00
Ben Alpert
d4e32a7b2c Finish renaming renderComponent -> render
Test Plan: jest
2014-11-20 23:07:58 -08:00
Ben Alpert
c4b9b938cf Update variable name and doc type to be accurate
Test Plan: Crossed fingers.
2014-11-20 23:03:03 -08:00
Sebastian Markbåge
68ba3b6d18 Merge pull request #2567 from sebmarkbage/childrenreconciler
Separate Child Reconciliation Step from Diffing
2014-11-20 11:48:54 -08:00
Sebastian Markbage
26ea341870 Separate Child Reconciliation Step from Diffing
This separates the reconciliation step of children into a separate module.
This is the first step towards prerendering.

The stateful instances are reconciled and put into a "rendered children"
set. Updates creates a new of these sets. These two sets are then diffed
to create insert/move/remove operations on the set.

The next step is to move the ReactChildReconciler step to before the
native DOM component. That way it's possible to rely on child
reconciliation without relying on diffing.
2014-11-20 11:45:02 -08:00
Jim
6ec952977e Merge pull request #2565 from jsfb/fixwhitespace
Removed context paremeter to renderToString/renderToStaticMarkup.
2014-11-19 15:49:33 -08:00
Jim
7768d91363 Removed context paremeter to renderToString/renderToStaticMarkup. 2014-11-19 15:16:23 -08:00
Timothy Yung
006bc28633 Merge pull request #2571 from yungsters/cleanup
Replace `mountDepth` with `isTopLevel`
2014-11-19 13:43:50 -08:00
yungsters
fc7cf2ff63 Replace mountDepth with isTopLevel
Summary:
After #2570, `mountDepth` is only used to enforce that `setProps` and `replaceProps` is only invoked on the top-level component. This replaces `mountDepth` with a simpler `isTopLevel` boolean set by `ReactMount` which reduces the surface area of the internal API and removes the need to thread `mountDepth` throughout React core.

Reviewers: @sebmarkbage @zpao

Test Plan:
Ran unit tests successfully:

```
npm run jest
```
2014-11-19 13:13:08 -08:00
Timothy Yung
70b1426ef0 Merge pull request #2570 from yungsters/updates
Update Dirty Components in Mount Ordering
2014-11-19 13:12:43 -08:00
yungsters
c7fd626b1f Summary:
Currently, `ReactUpdates` updates dirty components in increasing order of mount depth. However, mount depth is only relative to the component passed into `React.render`. This breaks down for components that invoke `React.render` as an implementation detail because the child components will be updated before the parent component.

This fixes the problem by using the order in which components are mounted (instead of their depth). The mount order transcends component trees (rooted at `React.render` calls).

Reviewers: @sebmarkbage @zpao

Test Plan:
Ran unit tests successfully:

```
npm run jest
```
2014-11-19 12:51:55 -08:00
Paul O’Shannessy
3a0f30480d Merge pull request #2544 from mjul/patch-1
Update 10.4-test-utils.md
2014-11-19 07:16:07 -08:00
Paul O’Shannessy
a07ab60ec0 Merge pull request #2554 from samccone/patch-1
Update tutorial language to be more explicit.
2014-11-19 06:15:35 -08:00
Cheng Lou
93bbb3ea5b Merge pull request #2555 from mfunkie/patch-1
Animation documentation for ReactTransitionGroup
2014-11-18 22:33:48 -05:00
Sebastian Markbåge
b0f6f5449c Merge pull request #2552 from sebmarkbage/cleanupinternals
Remove some unnecessary code in ReactComponents
2014-11-18 13:51:39 -08:00
Sebastian Markbage
13ed0317fa Remove some invariants and deadcode
These are not necessary if we enable type checks. Static or dynamic.

They're distracting my greppability.

Also, some dead code in shallow rendering.
2014-11-18 13:04:56 -08:00
Timothy Yung
df87ea1fa6 Merge pull request #2465 from yungsters/perf
Preserve Implicit Method Names
2014-11-18 12:51:08 -08:00
yungsters
bda199de04 Preserve Implicit Method Names
Summary:
Changes the way we instrument methods for `ReactPerf` so that developer tools can assign implicit method names to measured functions.

Reviewers: @zpao @sebmarkbage
2014-11-18 12:48:58 -08:00
Mark Funk
5b2ffde48d Animation documentation for ReactTransitionGroup
Update to the animation documentation for ReactTransitionGroup to clear the air on where one can use it.

If someone tries to use it off of React.addons.ReactTransitionGroup, which is undefined, instead of its real location, React.addons.TransitionGroup, they get a vague error about being unable to set defaultProps of undefined in the React createElement body.
2014-11-18 13:49:23 -05:00
Timothy Yung
ef35585468 Merge pull request #2464 from yungsters/immutable
Stop Mutating Merged Lifecycle Results
2014-11-18 10:02:07 -08:00
yungsters
8e15046283 Stop Mutating Merged Lifecycle Results
Summary:
Currently, `ReactClass` mutates values returned by `getDefaultProps`, `getInitialState`, and `getChildContext`. This is bad because the objects may, for example, be cached and re-used across instances of a React component.

This changes `ReactClass` to instead create a new object. In return for allocating a new object, I've replaced `mapObject` with a `for ... in` so that we are no longer allocating an unused object.

Fair trade, IMO.

Test Plan:
Ran unit tests successfully:

```
npm run jest
```

Conflicts:
	src/core/ReactCompositeComponent.js

Conflicts:
	src/class/ReactClass.js
2014-11-18 10:00:22 -08:00
Sam Saccone
8e47082fb6 Update tutorial language to be more explicit.
The word "Friends" does establish a relationship however it does not fit in the vernacular of react. 
This change makes the phrase more explicit and more familiar.
2014-11-18 12:36:20 -05:00
Matt Huggins
9a472ca8f1 Permit th attribute 2014-11-18 07:52:25 -07:00
Sebastian Markbåge
e3e0bf5de2 Merge pull request #2550 from sebmarkbage/cleanupinternals
Move ComponentEnvironment out of ReactComponent
2014-11-17 17:41:32 -08:00
Jim
ef3b348bef Merge pull request #2508 from jsfb/monitor-with-context
Start monitoring uses of withContext, related to issue #2112
2014-11-17 17:23:39 -08:00
Sebastian Markbage
5951a131db Move ComponentEnvironment out of ReactComponent
We currently have three DOM specific hooks that get injected. I move those
out to ReactComponentEnvironment. The idea is to eventually remove this
injection as the reconciler gets refactored.

There is also a BackendIDOperation which is specific to the DOM component
itself so I move this injection to be more specific to the DOMComponent.

E.g. it makes sense for it to be injectable for cross-worker DOM operations
but it doesn't make sense for ART components.
2014-11-17 17:21:41 -08:00
Jim
46bff98a3f Fixed 'imports' to resolve merge conflict 2014-11-17 17:14:00 -08:00
Jim
89aaf73ae8 Merge pull request #2509 from jsfb/use-parent-context
Initial implementation of issue #2112
2014-11-17 17:08:18 -08:00
Jim
081feeb2dd Added warning if owner-based and parent-based contexts differ. 2014-11-17 17:02:20 -08:00
Sebastian Markbåge
fba8be3b98 Merge pull request #2546 from sebmarkbage/cleanupinternals
Move more stuff out of ReactComponent
2014-11-17 14:47:34 -08:00
Sebastian Markbage
6dddd60e33 Unused variables 2014-11-17 13:31:19 -08:00
Sebastian Markbage
fb17e8ca56 Ensure that all internal instances have consistent properties
Use preventExtensions so that we can't add expando properties to internal
instances. This ensures that the hidden class is kept more consistent.
2014-11-17 12:54:21 -08:00
Sebastian Markbage
bc4dd411b0 Move _pendingX into ReactCompositeComponent
Since setProps can no longer be called on anything but composites, we can
move this complexity into ReactCompositeComponent.
2014-11-17 12:54:21 -08:00
Sebastian Markbage
974a4c84ce Move mountComponentIntoNode and setProps out of ReactComponent
This is part of moving more logic out of the base classes.

setProps, replaceProps etc. are not accessible from anything other than
ReactClass so we can safely move it to ReactCompositeComponent.

mountComponentIntoNode is tightly coupled to ReactMount. It's part of the
outer abstraction, the mount point, not the individual component.
2014-11-17 12:54:21 -08:00
Scott Feeney
d75512f211 Merge pull request #2497 from graue/2393-v1
Basic shallow rendering support (#2393)
2014-11-17 11:07:05 -08:00
Scott Feeney
bfadafe5d0 Shallow rendering support (#2393)
Now handles updating. Haven't looked at refs yet.
2014-11-17 10:47:18 -08:00
Martin Jul
50db9feb28 Update 10.4-test-utils.md
This adds minimal valid event data to the Simulate.change example for a text input field.
2014-11-17 13:14:11 +01:00
Sebastian Markbåge
e4218cb7dc Merge pull request #2539 from sebmarkbage/cleanupinternals
Clean up a bunch of internal methods and fields that are now unnecessary
2014-11-16 21:13:07 -08:00
Sebastian Markbage
63644d5e71 Add test for warning in ReactElementValidator
I previously had a mistake here, so I'm adding a unit test to ensure that I
don't make the same mistake again.
2014-11-16 21:07:31 -08:00
Sebastian Markbage
dac59d1032 Drop the _owner and _lifeCycle field on internal instances
The _owner field is unnecessary since it's reachable from _currentElement.

The _lifeCycle field is unnecessary because an internal component should
not even need to exist at all if it's unmounted. It should be dereferenced
internally, and never exposed externally.

The only case where it's important is for batching updates where we
currently avoid calling performUpdateIfNecessary if it's mounted. However,
this function is already only executed "if necessary" so we just make sure
that it's not necessary after unmount by resetting all the pending fields.
2014-11-16 21:05:12 -08:00
Sebastian Markbage
03ae0a906b Drop ReactOwner.Mixin
This is not used anywhere else. To avoid overabstraction we should just
inline this.
2014-11-16 21:04:07 -08:00
Sebastian Markbage
519ee322ca Drop this.props 2014-11-16 21:04:04 -08:00
Sebastian Markbage
8181272fe8 Drop inaccessible methods
These are no longer accessible and the isOwnedBy check is only used in
a method that is not accessible.
2014-11-16 21:02:40 -08:00
Ben Alpert
a194e51af0 Move logic for null to instantiateReactComponent
This cleans up the code a bit and also brings us closer to allowing any ReactNode to be rendered at the top level.

Test Plan: jest
2014-11-16 17:41:54 -08:00
Ben Alpert
c96ea9abf2 Remove transferPropsTo
I'd like to outlaw prop mutation altogether, and now seems like a fine time to remove transferPropsTo.

Test Plan: jest
2014-11-16 17:41:07 -08:00
Ben Alpert
f391b7b3ca Don't mutate .props.style in ReactDOMComponent
We currently make a copy of .style because we support mutating the style object in place. Instead of storing it back on props, store it separately on the component instance so that we don't mutate props anywhere. This is gross but should all be cleaned up after #2008 is resolved.

Test Plan: jest
2014-11-16 17:39:00 -08:00
Ben Alpert
505bc7595b Fix up variable names and types to be correct
Test Plan: jest
2014-11-16 17:37:40 -08:00
Sebastian Markbåge
3aa56039c6 Merge pull request #2537 from sebmarkbage/hidedomcomponentinternals
Wrap every DOM node in a Composite Component
2014-11-16 15:35:04 -08:00
Ben Alpert
e619d25d03 Inject browser mixin before full-page components
createFullPageComponent doesn't reference ReactBrowserComponentMixin directly so the mixin should get injected before the components are created. Previously, this test failed because getDOMNode wasn't present on the component instance.

Test Plan: jest
2014-11-16 12:59:44 -08:00
Sebastian Markbage
9c3e2d833d Wrap every DOM node in a Composite Component
...unless they already have a wrapper. Also, add tagName to every wrapper.

This ensures that refs are consistent. They always look like composite
components. This effectively hides the internal implementation details of
real DOM components since you can no longer get a ref to one.

In the future we might want to drop this wrapper and have refs refer
directly to the DOM node.

I currently use a hacky way of auto-wrapping inside of ReactNativeComponent
so that any given string can be wrapped. Better suggestions are welcome.
2014-11-16 10:32:46 -08:00
Christopher Chedeau
e8e79472aa Merge pull request #2527 from gabelevi/master
Update stripTypes transform to use fixed up jstransform transform
2014-11-15 16:57:25 -08:00
Ben Alpert
795290d1b0 Fix problems with empty component ID registration
Fixes #2493, also closes #2353 as it incorporates a variant of that fix.

- Instead of having getEmptyComponent return `<noscript />` directly, wrap it in a class that we can easily identify later as being an empty component
- Cache the empty component element instead of recreating one each time
- Avoid touching the nullComponentIdsRegistry dictionary at all when not dealing with empty components
- Move empty-component tests to a separate file

Test Plan: jest
2014-11-15 12:35:11 -08:00
Ben Alpert
230115da92 Make ReactTextComponent properly injectable
ReactTextComponent's implementation is DOM-specific; instead of flattenChildren creating the ReactTextComponent instances, ReactNativeComponent now takes care of having ReactTextComponent injected and creating the component instance. I also renamed ReactTextComponent to ReactDOMTextComponent and moved it to browser/ui/ where it belongs. ReactDOMTextComponent no longer inherits directly from ReactComponent and instead implements construct and {mount,receive,unmount}Component directly.

This diff removes `ReactTestUtils.isTextComponent` which should have previously never returned true when using public APIs.

Test Plan: jest, use ballmer-peak example.
2014-11-15 12:30:42 -08:00
Sebastian Markbåge
9b1c3226d0 Merge pull request #2385 from shripadk/bool-fix
Fix: Always return boolean from isNullComponentID
2014-11-15 11:43:27 -08:00
Gabe Levi
0d308add09 Update stripTypes transform to use fixed up jstransform transform 2014-11-14 18:25:11 -08:00
Ben Alpert
903db8bd14 Stop treating key={null} as an unspecified key
This reverts commit dd92786fb0, which was intended to be temporary for the 0.12 release.

Fixes #2394.
2014-11-14 16:52:43 -08:00
Ben Alpert
22da7b6fa5 Warn when casing CSS vendor prefixes incorrectly
Fixes #2487.

Test Plan: jest
2014-11-14 16:51:55 -08:00
Cheng Lou
0db323e42a Merge pull request #2514 from jvalente/patch-1
Update ref-09-glossary.md
2014-11-13 13:45:35 -05:00
Lee Byron
81d4d7bf24 Merge pull request #2512 from leebyron/transition-appear
Adding "appear" phase to ReactTransitionGroup and ReactCSSTransitionGroup
2014-11-13 13:44:56 -05:00
João Valente
485d84fb9b Update ref-09-glossary.md 2014-11-13 12:06:51 +00:00
Lee Byron
8760a70e73 Adding "appear" phase to ReactTransitionGroup and ReactCSSTransitionGroup.
"appear" differs from "enter" in that all children of a transition group at mount time will "appear" but will not "enter". All children later added to an existing transition group will "enter" but not "appear".

This extra transition phase allows for animation-on-mount effects.

A mirroring "appear" prop has been added to ReactCSSTransitionGroup, however for reverse-compatibility (and because "appear" is less common) it defaults to false.

Thanks to @afa for his work investigating the possible ways to implement this.
2014-11-12 21:30:56 -05:00
Fabio M. Costa
f6dd6ef772 Removing unecessary resize listener
monitorScrollValue is only called with `ViewportMetrics.refreshScrollValues` (https://github.com/facebook/react/blob/master/src/browser/ReactBrowserEventEmitter.js#L333-L334) and the window scroll properties (scrollTop and scrollLeft) don't change on resize (from my testings), so there is no need to listen for window resizes.
I also tried to see why the resize listener was added from the history but it was introduced on the initial commits.
I created a simple page that shows that http://jsbin.com/nuhice, open the console.
2014-11-12 00:08:30 -08:00
Paul O’Shannessy
06bf89db8e Merge pull request #2498 from ikr/patch-1
There's no isComponentOfType() anymore
2014-11-11 13:25:33 -08:00
Ivan Krechetov
13311639cc There's no isComponentOfType() anymore 2014-11-11 09:25:33 +01:00
Stefan Dombrowski
1bb29cab7c Add Attributes formAction, formEncType, formMethod and formTarget
This resolves #2425.
2014-11-11 06:37:26 +01:00
Ben Alpert
7a162ce731 Merge pull request #2482 from BinaryMuse/bkt/fix-stroke-opacity
Add strokeOpacity to unitless CSS properties
2014-11-07 22:26:03 -08:00
Brandon Tilley
96126e9ff4 Add strokeOpacity to unitless CSS properties 2014-11-07 21:20:01 -08:00
Paul O’Shannessy
78ec2501cf Merge pull request #2481 from mjul/fix-typos
Fix some minor typos in doc comments / code comments.
2014-11-07 16:58:49 -08:00
Paul O’Shannessy
b243f1eec6 Merge pull request #2480 from spicyj/text-stability
Test that text spans aren't remounted needlessly
2014-11-07 16:56:58 -08:00
Paul O’Shannessy
14d0a22ae8 Merge pull request #2479 from spicyj/nitfix
Fix odd formatting in ReactDOMComponent-test
2014-11-07 16:55:06 -08:00
Martin Jul
042c6c794c Fix some minor typos in doc comments / code comments. 2014-11-07 18:07:07 +01:00
Ben Alpert
ba418c6014 Test that text spans aren't remounted needlessly
While working on #2382, I accidentally broke this behavior (causing text components to get unmounted and remounted for any update) but we didn't have any unit test for it. Now we do.

Test Plan: jest TextComponent
2014-11-06 23:19:48 -08:00
Ben Alpert
a1dcdf1a64 Fix odd formatting in ReactDOMComponent-test
Test Plan: Crossed fingers.
2014-11-06 23:10:17 -08:00
Sebastian Markbåge
c10a39e82b Merge pull request #2445 from sebmarkbage/classes
Separate React Composite and Class
2014-11-06 19:53:10 -08:00
Sebastian Markbage
27c482a2b8 Separate React Composite and Class
ReactClass is now composed by ReactCompositeComponent rather than
inherit from it.

The state transition functions currently use ReactInstanceMap to map an
instance back to an internal representation.

I updated some tests to use public APIs. Other unit tests still reach into
internals but now we can find them using ReactInstanceMap.

I will do more cleanup in follow ups. The purpose of this diff is to
preserve semantics and most of the existing code.

This effectively enables support for ES6 classes. All you would need to
expose is ReactClassMixin.
2014-11-06 19:49:33 -08:00
Ben Alpert
bd02e17fec Merge pull request #2476 from jsfb/patch-1
Using semicolon instead of "and" conjunction
2014-11-06 15:15:39 -08:00
Jim
dbe16a357b Using semicolon instead of "and" conjunction
The use of the conjunction "and" leads to an improper assertion about what should/shouldn't be done.  Using a semicolon resolves this by indicating the contrasting alternative.
2014-11-06 14:50:35 -08:00
Paul O’Shannessy
cbada1e55a Merge pull request #2473 from zertosh/docs-ssr-at-sc
Add React at SoundCloud talk
2014-11-06 14:05:10 -08:00
Paul O’Shannessy
df24852ca1 Merge pull request #2475 from jsfb/master
Use adjective "too" instead of "to"
2014-11-06 14:04:33 -08:00
jsfb
7f37074c33 Use adjective "too" instead of "to"
The author clearly intended to use the adjective "too" to mean "excessively" instead of the preposition "to".
2014-11-06 13:42:19 -08:00
Paul O’Shannessy
d12ae9d5bb Merge pull request #2241 from syranide/selectvalue
ReactDOMSelect makeover, fix edge-case inconsistencies and remove state
2014-11-06 12:40:15 -08:00
Andres Suarez
d5810e46f9 Add SSR at SoundCloud talk 2014-11-06 10:54:05 -05:00
Ben Alpert
9edc6260a7 Initial implementation of new-style refs
cf. #1373

This implementation can be used in any situation that refs can currently be used (and can also be used without an owner, which is a plus).
2014-11-05 19:28:12 -08:00
Pedro Nauck
1adbc22fde bugfix: remove conflict comment 2014-11-06 01:23:51 -02:00
Paul O’Shannessy
dca7ffbe21 Merge pull request #2446 from enaqx/master
Add 'use strict' to statisfy linter rules
2014-11-05 16:25:38 -08:00
Paul O’Shannessy
3e60195bd4 Merge pull request #2408 from Peeja/patch-1
TodoMVC live demos have moved.
2014-11-05 13:49:23 -08:00
Paul O’Shannessy
462f8ea9f6 Merge pull request #2452 from Shahor/master
Trailing commas break old IE versions
2014-11-05 11:00:12 -08:00
Paul O’Shannessy
a3509e5b42 Fixing some newline-preserving issues
Done internally as part of
f9836a3912
2014-11-05 10:36:22 -08:00
Pedro Nauck
a7f157ebb1 update namespaced component to adapt with the v0.12 2014-11-05 12:32:16 -02:00
Pedro Nauck
b5bcaba77f Merge branch 'master' into docs-namespace-in-jsx
* master: (113 commits)
  Remove esprima-fb and use Syntax from jstransform
  Update React.renderToString argument type in docs
  [traverseAllChildren] fix out-of-scope var use.
  Use double quote for transformed `displayName` and `data-*`
  Remove unrelated comment
  Fix typo in If/Else JSX doc.
  Cleanup a couple unused variables
  Use dump cache and remove factory from ReactElement-test
  Update deprecated propTypes
  Bring in jsfiddle integration script, add harmony
  Extending period in which click events are ignored
  React.renderComponent --> React.render
  Followup fix for React.PropTypes.node
  Add comma for readability in tutorial
  Drop internal uses of .type on the class
  Drop Legacy Factories Around Classes
  Drop ReactDOM from internal DOM extensions
  Added comma to increase readability.
  Add 0.12 starter kit
  Change the date and the link url to match the proper roundup
  ...

Conflicts:
	docs/docs/02.1-jsx-in-depth.md
2014-11-05 12:30:37 -02:00
Paul O’Shannessy
1fd187b994 Merge pull request #2224 from zertosh/remove-esprima-fb-dep
Remove esprima-fb and use Syntax from jstransform
2014-11-04 14:38:09 -08:00
Paul O’Shannessy
4ba53e1839 Merge pull request #1708 from chenglou/displayName
Use double quote for transformed `displayName`
2014-11-04 14:36:19 -08:00
Andres Suarez
bf0a857a92 Remove esprima-fb and use Syntax from jstransform 2014-11-04 17:10:12 -05:00
Paul O’Shannessy
984055c2f5 Merge pull request #2463 from fson/render-to-string-docs
Update React.renderToString argument type in docs
2014-11-04 09:37:12 -08:00
Ville Immonen
9c3357eef5 Update React.renderToString argument type in docs
renderToString and renderToStaticMarkup now take a ReactElement.
Update the documentation to reflect this recent change.
2014-11-04 17:02:00 +02:00
Lee Byron
d4ac1229a6 Merge pull request #2458 from leebyron/fix-iterable
[traverseAllChildren] fix out-of-scope var use.
2014-11-03 21:25:01 -05:00
Lee Byron
a3608d27ab [traverseAllChildren] fix out-of-scope var use.
Dear ES6 gods, bring us `let` soon.

This fixes an issue where non-keyed iterables are used as children and the value of `i` would be undefined because its used out of scope. This adds a separately scoped iteration index value and appropriately increments it as iteration continues. Doi.

While I'm in there, make the usage of falsey `nameSoFar` more obvious and more consistent with the existing usage on L115

Test plan: first wrote a test covering this previously untested path. Saw an identical issue as was experienced in development environment. Then ensured test passed after this diff.
2014-11-03 21:19:28 -05:00
Andreas Svensson
2601b6a0b0 ReactDOMSelect makeover, fix edge-case inconsistencies and remove state 2014-11-03 23:19:01 +01:00
Alexandre Gaudencio
6379342b71 Trailing commas break old IE versions 2014-11-03 02:54:23 +01:00
Nick Raienko
bea9fbbf62 Add 'use strict' to statisfy linter rules 2014-11-01 07:05:46 +02:00
Cheng Lou
eddbb0cfef Use double quote for transformed displayName and data-*
JSX currently transforms everything to double quote except these two. This way, it's at least consistent and will satisfy half of the people who do put a strict quotation linting on their project.

Test: `jest`, check the double quoted transformed `data-bla="something"`.
2014-10-31 15:49:24 -04:00
Sebastian Markbåge
cb50a8698b Remove unrelated comment
This is no longer unwrapping a legacy factory (which are gone).
2014-10-31 12:39:38 -07:00
Paul O’Shannessy
1666661a06 Merge pull request #2433 from zpao/fiddle-integration
Bring in jsfiddle integration script, add harmony
2014-10-31 11:22:57 -07:00
Paul O’Shannessy
1abe716358 Merge pull request #2443 from kruppel/kurt/minor-tip-typo
Fix typo in If/Else JSX doc.
2014-10-31 10:11:32 -07:00
Kurt Ruppel
4b3b32e418 Fix typo in If/Else JSX doc. 2014-10-31 09:52:44 -07:00
Sebastian Markbåge
881c9b5be8 Merge pull request #2435 from sebmarkbage/fixretest
Use dump cache and remove factory from ReactElement-test
2014-10-30 12:06:21 -07:00
Paul O’Shannessy
d8ed3e5cf9 Merge pull request #2437 from zpao/lint-cleanup
Cleanup a couple unused variables
2014-10-30 12:05:38 -07:00
Paul O’Shannessy
295c1e3652 Cleanup a couple unused variables 2014-10-30 11:38:53 -07:00
Paul O’Shannessy
bf99ab1c89 Merge pull request #2434 from Shraymonks/propTypes-docs
Update deprecated propTypes
2014-10-30 09:43:02 -07:00
Sebastian Markbage
7f7b7f386a Use dump cache and remove factory from ReactElement-test
We need to use dump cache because we don't enable it by default internally.

While I'm at it, I might as well kill the ComponentFactory variable which
is now just an alias.
2014-10-30 02:50:28 -07:00
Raymond Ha
92d171a4fc Update deprecated propTypes 2014-10-29 21:00:32 -07:00
Paul O’Shannessy
0f5368341f Bring in jsfiddle integration script, add harmony 2014-10-29 19:35:27 -07:00
Paul O’Shannessy
7071d1c316 Merge pull request #2419 from johnheroy/patch-1
Add comma for readability in tutorial.md
2014-10-29 18:03:48 -07:00
Paul O’Shannessy
eb7f806566 Merge pull request #2431 from wassil/master
Extending period in which click events are ignored
2014-10-29 18:02:44 -07:00
Juraj Dudak
c563e19739 Extending period in which click events are ignored 2014-10-29 14:06:37 -07:00
Paul O’Shannessy
b2b8e5c08a Merge pull request #2428 from cody/fixes
React.renderComponent --> React.render
2014-10-29 11:44:35 -07:00
Stefan Dombrowski
93ac4d09a1 React.renderComponent --> React.render
Also fixed a spelling mistake.
2014-10-29 19:05:16 +01:00
Paul O’Shannessy
ce1b394529 Followup fix for React.PropTypes.node
This should have gone in as a part of #2343
2014-10-28 22:49:25 -07:00
Sebastian Markbåge
a54ed49eb0 Merge pull request #2375 from sebmarkbage/droplegacyfactories
Drop Legacy Factories
2014-10-28 18:00:32 -07:00
John Heroy
129d66a62e Add comma for readability in tutorial 2014-10-28 15:22:40 -07:00
Sebastian Markbage
9b36b04d75 Drop internal uses of .type on the class 2014-10-28 15:08:52 -07:00
Sebastian Markbage
199a7d6903 Drop Legacy Factories Around Classes
Classes are now pure classes without a legacy factory around them.

Since classes will become just any function that returns a valid instance,
let's drop isValidClass.

There's some hacks in here for auto-mocking frameworks (jest) that mock the
prototype of these classes. These hacks allow these classes to be mounted.
2014-10-28 15:08:52 -07:00
Sebastian Markbage
531c2bc4c9 Drop ReactDOM from internal DOM extensions
These used to be exposed as strings on the legacy factories but are now
gone.
2014-10-28 15:08:52 -07:00
Paul O’Shannessy
581085ea1b Merge pull request #2416 from zachasme/update-jstransform
Update jstransform version to 7.0
2014-10-28 15:01:57 -07:00
Paul O’Shannessy
22ffb57a93 Merge pull request #2415 from zpao/sync-internal
Sync internal
2014-10-28 14:30:06 -07:00
Cheng Lou
86336997cd Merge pull request #2418 from spencer48/patch-1
(docs) Added commas to increase readability.
2014-10-28 17:26:18 -04:00
Spencer Handley
a55a3f77a1 Added comma to increase readability.
When thumbing through the docs, I noticed a few missing commas. I inserted two commas and did not alter any source code.
2014-10-28 13:56:14 -07:00
Paul O’Shannessy
17b190bee2 Add 0.12 starter kit 2014-10-28 11:48:53 -07:00
Christopher Chedeau
26c8a70c1d Change the date and the link url to match the proper roundup 2014-10-28 11:36:12 -07:00
Paul O’Shannessy
9e895bc360 Correct changes from 0.12-stable merge 2014-10-28 11:20:33 -07:00
Paul O’Shannessy
8b041eaa5a Merge branch '0.12-stable' 2014-10-28 11:18:02 -07:00
Paul O’Shannessy
f2947a0ca1 Merge pull request #2399 from zpao/0.12-docs
Docs updates for 0.12
2014-10-28 11:17:25 -07:00
Paul O’Shannessy
fa2597a3b3 0.12 blog post 2014-10-28 11:16:29 -07:00
Paul O’Shannessy
8ef1f96850 0.12 CHANGELOG 2014-10-28 11:16:28 -07:00
Paul O’Shannessy
3eb8222c22 Update cdnjs link, include jsdelivr in readme 2014-10-28 11:06:32 -07:00
Paul O’Shannessy
fcd4be3933 Update version references in the readme 2014-10-28 11:06:32 -07:00
Paul O’Shannessy
0b8454724e Update Authors & Acknowledgements for 0.12 2014-10-28 11:06:32 -07:00
Christopher Chedeau
081115609c React.js Conf blog post
Closes #2412
2014-10-28 11:06:31 -07:00
Cheng Lou
539db8e9c8 Merge pull request #2414 from benleiken/patch-1
Moved key requirement note into 'getting started'
2014-10-28 11:06:31 -07:00
Paul O’Shannessy
4d47ff36b2 Merge pull request #2413 from LeonFedotov/patch-1
Changing api documentation for jsx transformer
2014-10-28 11:06:31 -07:00
Sebastian Markbage
98bf80254f Update Docs Navigation 2014-10-28 11:06:31 -07:00
Sebastian Markbage
1cb3f25e78 More Descriptor -> Element renames 2014-10-28 11:06:31 -07:00
Sebastian Markbage
b7a548c4bf Replace transferPropsTo with transferring props patterns 2014-10-28 11:06:30 -07:00
Sebastian Markbage
9b1ee4de46 Updated Docs for new JSX Changes
Moved non-JSX explanation to Displaying Data.
Overhauled JSX in Depth.
Added JSX Spread Section.
2014-10-28 11:06:30 -07:00
Paul O’Shannessy
0dd942b121 Update Animation docs for createElement 2014-10-28 11:06:30 -07:00
Paul O’Shannessy
eb2827ec6a Update React.DOM -> React.createElement through docs 2014-10-28 11:06:30 -07:00
Paul O’Shannessy
0344aaf18d Use --harmomy in docs examples for cleaner code 2014-10-28 11:06:30 -07:00
Zacharias
c260c45db3 Update jstransform version to ^7.0.0 2014-10-28 13:48:48 +01:00
Tienchai Wirojsaksaree
ff12423d63 Fixing touch/mouse issues with TapEventPlugin
On ios device, browser simulates mouse events, but does that with
a delay, because of double tap gesture. The problem is that
TapEventPlugins listens to both types of events, so it fires twice

Everytime there is a touch event, we should ignore mouse events that
follow it.  This way, we still respond to both mouse and touch events,
just ignore the device generated ones.
2014-10-27 17:02:03 -07:00
Paul O’Shannessy
1c241b3ebc Ensure PropTypes test works when warning module is replaced
For example, warning might be replaced with a module that throws errors,
as is the case internally when running tests. Previously we were
whitelisting this test to provide time to update callsites. Now we
aren't and it fails.
2014-10-27 16:58:54 -07:00
Paul O’Shannessy
85930e63db Merge pull request #2413 from LeonFedotov/patch-1
Changing api documentation for jsx transformer
2014-10-27 16:32:07 -07:00
Cheng Lou
18066a301e Merge pull request #2414 from benleiken/patch-1
Moved key requirement note into 'getting started'
2014-10-27 18:47:24 -04:00
Benjamin Leiken
bb0c7b4ca9 Moved key requirement note into 'getting started'
It's an important note and it was buried too far down the page. Now it's more prominent and harder for people to miss (like I did).
2014-10-27 10:22:57 -07:00
Leon Fedotov
a29d496443 Changing api documentation for jsx transformer
Hi in chrome debugger, the files that use sourcemaps from the transformer get "null" as the filename during debug, https://github.com/facebook/react/blob/master/main.js#L15 "sourceFilename" is used instead of "filename" to specify the filename in the sourcemap.
2014-10-27 19:18:22 +02:00
Christopher Chedeau
64a5355444 React.js Conf blog post
Closes #2412
2014-10-27 10:12:09 -07:00
Paul O’Shannessy
d63aa0f113 Move Object.assign file to align with internal 2014-10-26 17:14:00 -07:00
Paul O’Shannessy
076a8285f7 Merge pull request #2409 from enaqx/master
Remove obsolete jshint options
2014-10-26 11:12:20 -07:00
Nick Raienko
eb3337b018 Remove obsolete jshint options 2014-10-26 12:18:24 +02:00
Peter Jaros
411a6a1f0c TodoMVC live demos have moved. 2014-10-24 09:57:27 -04:00
Paul O’Shannessy
d36d26a574 [docs] Glossary
Pulled in https://gist.github.com/sebmarkbage/fcb1b6ab493b0c77d589
mostly verbatim
2014-10-23 20:51:11 -07:00
Paul O’Shannessy
4e5f5df4f6 Remove @jsx from examples 2014-10-23 20:51:11 -07:00
Paul O’Shannessy
4cfd8c6204 Update server servering example
It's referencing packages that aren't published yet but it *probably*
works...
2014-10-23 20:51:11 -07:00
Paul O’Shannessy
f53854bd93 React.renderComponent -> React.render
This covers most everything. The perf suite still needs work for the
Element updates. And the server rendering example needs to be done
wholesale.
2014-10-23 20:51:11 -07:00
Paul O’Shannessy
a90b4c9b3e Update properties/elements 2014-10-23 20:51:11 -07:00
Sebastian Markbåge
ae8771fe2e Merge pull request #2084 from kimagure/unmount-comp-error
Error when unmountComponentAtNode receives non-node
2014-10-23 12:53:40 -07:00
Sebastian Markbåge
29bcda463e Merge pull request #2387 from fabiomcosta/avoid_double_scrollread
avoid reading the scroll position twice
2014-10-23 12:51:23 -07:00
Sebastian Markbåge
b7cd3e7d1d Merge pull request #2396 from sebmarkbage/classmodule
Move Class Creation Concerns into a ReactClass Module
2014-10-23 12:50:17 -07:00
Sebastian Markbage
7ce8c844bd Hide ReactElement constructor
This prevents feature tests like:

var ReactElement = React.createElement(...).constructor;

if (element.constructor === ReactElement)

This is intentional so that we have the option to make these plain objects.
E.g. for direct inlining or replacing them with value types.
2014-10-23 12:08:14 -07:00
Sebastian Markbåge
4aee2a9c28 Merge pull request #2405 from sebmarkbage/hideelementconstructor
Hide ReactElement constructor
2014-10-23 12:06:16 -07:00
Paul O’Shannessy
8de03c47dd Merge pull request #2397 from mjul/fix-gruntfile
Added missing semicolon after statement.
2014-10-23 12:01:55 -07:00
Sebastian Markbage
20af6b0a14 Hide ReactElement constructor
This prevents feature tests like:

var ReactElement = React.createElement(...).constructor;

if (element.constructor === ReactElement)

This is intentional so that we have the option to make these plain objects.
E.g. for direct inlining or replacing them with value types.
2014-10-23 10:53:57 -07:00
Martin Jul
994fc7d8a7 Merge remote-tracking branch 'upstream/master' into fix-gruntfile 2014-10-23 09:55:43 +02:00
Martin Jul
c9fb57feb3 Added missing semicolons identified by using grunt jshint:project. 2014-10-23 09:54:13 +02:00
Ben Alpert
32630cd8cf Fix typo in 0.12 RC blog post 2014-10-23 00:45:33 -07:00
Sebastian Markbage
d9fe40e147 Move Class Creation Concerns to ReactClass
This moves logic responsible for class creation and mixins into
the ReactClass module. This currently creates a class that extends
the ReactCompositeBase but in the future, this will be decoupled as
ReactCompositeComponent will compose these classes.

This is just a cut/paste.
2014-10-22 21:25:20 -07:00
Sebastian Markbage
c7bb936566 Introduce React Class as an alias for Composite Component
This is in preparation for the separation of Composite Component internals
from the Class abstraction.
2014-10-22 18:35:10 -07:00
Lee Byron
d545238fd9 Merge pull request #2376 from leebyron/iterable
Allow iterables in traverseAllChildren
2014-10-22 18:18:08 -07:00
Ben Alpert
de1dacdb28 Refactor composite component update flow
Fixes #1392.

Previously, ReactComponent.updateComponent set the new props and owner and updated the component's refs. Because it did the actual props assignment, it had to be called by ReactCompositeComponent between componentWillMount and componentDidMount, meaning that it was skipped if shouldComponentUpdate returned false. Now, updateComponent takes the old and new descriptors and only updates refs, allowing a subclass to call updateComponent at a convenient time (specifically, it can be before `this._descriptor` is updated if the subclass also overrides performUpdateIfNecessary).

The new update cycle for composites is:

- receiveComponent is called which stores `this._pendingDescriptor` and calls performUpdateIfNecessary directly or a state update is enqueued, in which case ReactUpdates will call performUpdateIfNecessary
- performUpdateIfNecessary ensures that an update is still pending (which might no longer be the case if an update is queued for a subcomponent that was updated through a parent's reconciliation) and calls updateComponent with the old and new descriptors
- updateComponent calls super to update refs, then calls componentWillReceiveProps (if applicable) and shouldComponentUpdate -- if shouldComponentUpdate returns false, `this._descriptor`, `this.props`, and `this.state` are updated and the update is skipped; else, _performComponentUpdate is called
- _performComponentUpdate calls componentWillUpdate and _updateRenderedComponent, and enqueues the componentDidUpdate call (in that order)
- _updateRenderedComponent calls render and updates the rendered component appropriately

For DOM components (essentially unchanged):

- receiveComponent is called which does a short-circuit check for descriptor equality and delegates to super (which stores `this._pendingDescriptor` and calls performUpdateIfNecessary)
- performUpdateIfNecessary (not overridden) sets new values for `this.props`, etc. and calls updateComponent
- updateComponent does the DOM property and children updates (some synchronously, some queued for the transaction close)

For text and ART components (unchanged):

- receiveComponent updates the DOM or ART directly based on the new props
- updateComponent is never called

Notable changes:

- When shouldComponentUpdate returns false, refs are still updated
- ReactDefaultPerf now includes lifecycle methods in component timings
- updateComponent's signature changed (technically this is part of the public API, though we've never documented it)

Test Plan: jest
2014-10-22 17:59:58 -07:00
Ben Alpert
9c2125599c Add \n after <textarea> to fix missing linebreaks
Same for <pre> and <listing>. Browsers are crazy.

Test Plan: jest, verify in Chrome that starting textareas with a value starting with two newlines renders both newlines instead of one newline, as it did before.
2014-10-22 17:24:24 -07:00
Martin Jul
70fdd5a287 Added missing semicolon after statement. 2014-10-22 23:46:54 +02:00
Paul O’Shannessy
b78fe39b60 Bump version to 0.13.0-alpha 2014-10-22 14:19:54 -07:00
Paul O’Shannessy
5ffcec7552 Update travis-ci badge for 0.12-stable branch 2014-10-22 14:17:11 -07:00
Ben Alpert
5e2d926d65 Merge pull request #2372 from spicyj/docs012-1
Update docs to align with 0.12 better
2014-10-22 14:02:35 -07:00
Ben Alpert
52494f9d72 Update docs to align with 0.12 better
- Rename React.renderComponent -> React.render
- Remove most references to transferPropsTo
2014-10-22 14:01:54 -07:00
Paul O’Shannessy
85a98d4c8e Merge pull request #2322 from zpao/update-licenses-docs-examples
Update docs/examples with licenses
2014-10-22 13:13:56 -07:00
Paul O’Shannessy
7dc0e3d746 Update licenses for docs and examples
Docs are now CC licensed
Examples are under a separate license
2014-10-22 12:35:08 -07:00
Lee Byron
c07ea0ba34 Allow iterables in traverseAllChildren
This lets you use any kind of iterable as a container of react child elements. It also preserves keys when possible if the iterable is keyed.

 * Use an ES6 Map or Set to hold children.
 * Use an Immutable-js collection to hold children.
 * Use a function* which yields children.

Concretely, this removes the necessary conversion to JS objects if you're mapping over Immutable-js collections to get children, i.e.:

```
<div>
  {myImmutable.map(val => <span>{val}</span>).toJS()
</div>
```

Now we can remove the `toJS()` and the intermediate allocation along with it.

This also cleans up the traverseAllChildrenImpl method.
2014-10-21 15:18:53 -07:00
Ben Alpert
631b6a097c Merge pull request #2388 from spicyj/null-key
Support but warn on key={null}
2014-10-21 14:20:16 -07:00
Paul O’Shannessy
ac3e9b55e0 Merge pull request #2370 from chenglou/rm-school
[Docs] Remove most of @jsx
2014-10-21 14:11:22 -07:00
Ben Alpert
dd92786fb0 Support but warn on key={null}
Fixes #2386.

Test Plan: jest
2014-10-20 17:19:48 -07:00
Sebastian Markbåge
2bdad81955 Merge pull request #2384 from sebmarkbage/deprecateisvalidclass
Deprecate isValidClass
2014-10-20 17:17:56 -07:00
Fabio M. Costa
dafaf1a42e avoid reading the scroll position twice 2014-10-20 13:30:02 -07:00
Shripad K
edab4814da Fix: Always return boolean from isNullComponentID 2014-10-21 00:43:04 +05:30
Cheng Lou
1b3b432d64 [Docs] Remove most of @jsx
I kept some places intact (search for @jsx) because they require other bigger changes:

- ref-01-top-level-api.md
- grunt/tasks/npm.js
- old blog posts (don't change those)
- examples/ folder, as they have their own package.json that rely on old dependencies (node-jsx, reactify) that haven't upgraded to 0.12
2014-10-20 14:44:07 -04:00
Paul O’Shannessy
be468c2c22 Merge pull request #2373 from genbit/docs-animation-props
Update 09.1-animation.md
2014-10-20 11:01:36 -07:00
Paul O’Shannessy
a94bfd7888 Merge pull request #2381 from shripadk/jsdoc-fix
Fix JSDoc tag in ReactElement.js
2014-10-20 10:56:46 -07:00
Sebastian Markbage
ef971014bc Deprecate isValidClass
Fixes #2374
2014-10-19 23:55:57 -07:00
Shripad K
621bb09cd7 Fix JSDoc tag in ReactElement.js 2014-10-19 21:01:45 +05:30
Sergey Generalov
3031c6591e Update 09.1-animation.md
Add note about ReactTransitionGroup, that any additional, user-defined, properties will be become properties of the rendered component.
And example how to render a `<ul>` with css class.
2014-10-17 20:18:45 -07:00
Ben Alpert
daf4182707 Merge pull request #2368 from spicyj/use-the-string
Fix warning message for using React.DOM.* as type
2014-10-17 12:01:17 -07:00
Christopher Chedeau
dec41bbbca Merge pull request #2356 from vjeux/roundup_23
Community round-up #23
2014-10-17 07:58:40 -07:00
Christopher Chedeau
6470920125 Community round-up #23 2014-10-17 07:56:28 -07:00
Ben Alpert
810582d114 Fix warning message for using React.DOM.* as type
Previously, this said 'Use the string "function() { [native code] }" instead.'.
2014-10-16 18:22:37 -07:00
Paul O’Shannessy
56e84d8cf3 Merge pull request #2364 from zpao/0.12rc-blog-post
0.12 rc1 release materials
2014-10-16 15:34:11 -07:00
Paul O’Shannessy
aca264e399 0.12 rc1 release materials
* blog post
* starter kit
2014-10-16 15:31:52 -07:00
Paul O’Shannessy
2b4e35870b v0.12.0-rc1 2014-10-16 14:56:50 -07:00
Sebastian Markbåge
22903a57e8 Merge pull request #2363 from sebmarkbage/assign
Use hasOwnProperty checks in Object.assign
2014-10-16 11:52:43 -07:00
Sebastian Markbage
25d63b43ef Use hasOwnProperty checks in Object.assign
Because IE8 polyfills add enumerable properties, this doesn't play nicely.
So for IE8 compatibility we add this check. Slower though. :(
2014-10-16 11:49:50 -07:00
Sebastian Markbåge
828efb798a Merge pull request #2350 from sebmarkbage/assign
Hide Object.assign polyfill behind a module
2014-10-16 09:29:01 -07:00
Sebastian Markbage
8210beeef4 Hide Object.assign polyfill behind a module
Because the JS community's polyfilling infrastructure sucks and we'll
have to fix it for them before we require this.

JSX spread uses React.__spread
(which might get special behavior for key/ref, not sure yet)

This never uses the native implementation and throws for prototype chains.
Once the native implementations are faster, we'll start using them.
2014-10-16 09:21:10 -07:00
Beau Smith
df36c258b3 Highlighted changed lines in examples 2014-10-15 23:01:05 -07:00
Paul O’Shannessy
5263f61c87 Merge pull request #2357 from jimjea/patch-1
Minor grammar change to Thinking in React
2014-10-15 17:01:57 -07:00
Jimmy Jea
43dbd29bb1 minor change to post
Hello,

I was just reading through your post and noticed a minor change. The sentence originally read, "It's scaled very well for us...". I thought it was a little unclear since it's can mean "it has" or "it is", which can make this sentence take on a whole different meaning.
2014-10-15 16:36:30 -07:00
Paul O’Shannessy
4d06df3153 Merge pull request #2359 from zpao/fix-blog-post
[docs] Move React Elements post to right place, fix typo
2014-10-15 16:22:36 -07:00
Paul O’Shannessy
dcbc64ac76 [docs] Move React Elements post to right place, fix typo
The URL already made its way around so we can't just break it. We might
want to just live with it instead of even doing this redirect.

2b225446c0 (commitcomment-8176218)
2014-10-15 16:10:03 -07:00
Paul O’Shannessy
e7f509d3a3 0.11.2 release materials
TODO: starter kit for cherry-pick to master
(cherry picked from commit 732ffad313)
2014-10-15 15:55:12 -07:00
Paul O’Shannessy
bc672c8bc5 Merge pull request #2344 from ThomasCrvsr/master
Use React.createFactory in examples/basic/
2014-10-15 10:48:33 -07:00
Ben Alpert
b8229cc761 Fix typo in blog post 2014-10-15 10:09:23 -07:00
ThomasCrvsr
e3734e2b43 #2315 : Use of React.createFactory in example basic/ 2014-10-15 09:20:25 +02:00
Paul O’Shannessy
efc7829e91 Merge pull request #2330 from alexeyraspopov/patch-1
use function composition instead of mutable state
2014-10-14 23:48:55 -07:00
Paul O’Shannessy
7853affd4f Merge pull request #2343 from zpao/proptypes-deprecation
Update PropTypes for ReactElement & ReactNode
2014-10-14 23:23:57 -07:00
Paul O’Shannessy
58165dfbcd Merge pull request #2349 from zpao/update-deps
Update npm dependencies, fix browserify task
2014-10-14 23:21:01 -07:00
Paul O’Shannessy
d03d49101b browserify update 2014-10-14 22:40:28 -07:00
Paul O’Shannessy
770b579aa2 Update PropTypes for ReactElement & ReactNode 2014-10-14 21:35:48 -07:00
Paul O’Shannessy
67307ce850 Update dependencies, removed unused ones
Also picked up a bit of JSON reformatting, presumably from npm >= 2

Test plan: build, run tests
2014-10-14 16:18:20 -07:00
Paul O’Shannessy
2b225446c0 React Elements blog post 2014-10-14 10:59:15 -07:00
Paul O’Shannessy
27cbd71394 Merge pull request #2317 from zpao/npm-ship-merge
Ship merge, mergeInto, copyProperties to npm
2014-10-14 10:21:51 -07:00
ThomasCrvsr
4f1f8c0605 Use react.createElement in example in basic/ 2014-10-14 10:18:00 +02:00
Paul O’Shannessy
b227837b0c Ship merge to npm
People may have a bad time if they're depending on these but we can
delay that a little bit. Unless they're using directly and not
polyfilling Object.assign.
2014-10-13 14:07:39 -07:00
Paul O’Shannessy
4dcc1161fa Update @emails in react-displayName-test 2014-10-13 12:56:02 -07:00
Sebastian Markbåge
3991d4de6b Merge pull request #2337 from sebmarkbage/devtoolshook
Inject the runtime to a global instead of exposing internals
2014-10-13 12:30:15 -07:00
Sebastian Markbage
ce19af9d30 Inject the runtime to a global instead of exposing internals
See 673de20a4a
2014-10-13 11:59:23 -07:00
Alexey Raspopov
1db3ed0d6d fix: var name 2014-10-12 16:06:53 +03:00
Alexey Raspopov
cc0e7d2a79 ballmer-peak: use composition instead of mutable state 2014-10-12 16:05:58 +03:00
Paul O’Shannessy
5d3b12bb3b Merge pull request #2312 from zpao/license-update
Update Licenses
2014-10-10 16:58:45 -07:00
Paul O’Shannessy
dcf415c2b9 BSD + PATENTS 2014-10-10 13:34:07 -07:00
Paul O’Shannessy
3bbed150ab Merge pull request #2139 from syranide/acceptcharset
Add form "acceptCharset" to HTMLDOMPropertyConfig
2014-10-10 12:40:13 -07:00
Sebastian Markbåge
eef9995093 Merge pull request #2313 from sebmarkbage/sanitizetags
Sanitize the string tag passed to DOM components
2014-10-10 12:33:45 -07:00
Paul O’Shannessy
31faa58c27 Merge pull request #2320 from zpao/jsxtransformer-no-docblock
JSXTransformer: don't look for docblock
2014-10-10 11:46:26 -07:00
Paul O’Shannessy
cf5fea4616 JSXTransformer: don't look for docblock 2014-10-10 11:45:52 -07:00
Paul O’Shannessy
0dccf64c67 Sync upstream modules 2014-10-10 10:40:18 -07:00
Paul O’Shannessy
5d127eaa49 Merge pull request #2316 from zpao/devtoolsmarker
Look for devtools global hook
2014-10-09 17:00:06 -07:00
Paul O’Shannessy
540731b7a8 Merge pull request #2002 from zpao/rename-renderComponent
React.renderComponent -> React.render
2014-10-09 16:41:37 -07:00
Paul O’Shannessy
1c86f5836a Codemod deprecated API usage away 2014-10-09 16:41:03 -07:00
Paul O’Shannessy
9b1fa914fa React.renderComponent -> React.render
Also rename all the associated render methods and adds deprecation
notices.
2014-10-09 16:41:03 -07:00
Sebastian Markbage
a4e923b7fc Sanitize the string tag passed to DOM components
Because we're using innerHTML to generate DOM Elements, we need to make
sure that the tag is sane and doesn't try to do injection.

This wouldn't be an issue if we used document.createElement instead.
2014-10-09 13:55:29 -07:00
Paul O’Shannessy
436c6c2db7 Merge pull request #2310 from tmcw/list-require-attribute
Require list property to be accessed as an attribute
2014-10-09 11:29:59 -07:00
Paul O’Shannessy
6ddf8de5ae Look for devtools global hook
It doesn't exist yet, but it could.

This also ensures we actually do our polyfill checks in *all* browsers,
not just Chrome.
2014-10-09 11:24:48 -07:00
Sebastian Markbåge
36b091bc44 Merge pull request #2308 from sebmarkbage/dropdocblock
Drop the @jsx docblock from unit tests
2014-10-08 15:24:18 -07:00
Tom MacWright
688f64c5c8 Require list property to be accessed as an attribute 2014-10-08 17:49:05 -04:00
Andreas Svensson
70a7506bb9 Add form "acceptCharset" to HTMLDOMPropertyConfig 2014-10-08 22:45:33 +02:00
Paul O’Shannessy
18209a1112 Merge pull request #2304 from zpao/rm-server-rendering-deprecation-notice
Update ReactServerRendering for the modern world
2014-10-08 13:09:01 -07:00
Paul O’Shannessy
8faca765e1 Update ReactServerRendering for the modern world
* ReactComponents aren't really the thing we need, ReactElements are
* Remove the deprecation notice that we've had in there for a long time

Test Plan: build, jest
2014-10-08 12:52:59 -07:00
Paul O’Shannessy
fe32477d97 Merge pull request #2306 from zpao/cleanup-textcomponent-dep
Remove ReactBrowserComponentMixin dependency from ReactTextComponent
2014-10-08 12:48:23 -07:00
Sebastian Markbage
348af57842 Drop the @jsx docblock from unit tests
This is no longer necessary in our transforms.
2014-10-08 12:46:45 -07:00
Sebastian Markbåge
85597bf3aa Merge pull request #2303 from sebmarkbage/dropmerge
Use Object.assign instead of merge, mergeInto, mixInto and copyPropertie...
2014-10-08 12:10:08 -07:00
Sebastian Markbage
096360db03 Use Object.assign instead of merge, mergeInto, mixInto and copyProperties
This makes it easier to contribute without having to learn a bunch of
slightly different helpers and remember their slightly different
signatures and semantics.

We'll probably start using ES7 spread properties instead of merge in the
future when at least one more transpiler supports it.
2014-10-08 11:32:40 -07:00
Paul O’Shannessy
f2f4006ff6 Remove ReactBrowserComponent dependency from ReactTextComponent
It's no longer used as of #1598, which just missed the require.

Test Plan: build, jest
2014-10-08 11:29:45 -07:00
Paul O’Shannessy
c0c90c0050 Merge pull request #2305 from sebmarkbage/missingrename
Rename ReactDescriptor followup
2014-10-08 10:54:57 -07:00
Sebastian Markbage
5541842284 Renamed ReactDescriptor-test
I forgot to rename the test.
2014-10-07 23:44:02 -07:00
Pedro Nauck
8a4b2763dc change note comment about namespaced components 2014-10-08 01:41:48 -03:00
Justin Woo
9c8ddb3316 Error when unmountComponentAtNode receives non-node 2014-10-07 21:12:56 -04:00
Paul O’Shannessy
9ef2b4e5d9 Merge pull request #2252 from syranide/htmlmanifest
Add manifest to HTMLDOMPropertyConfig
2014-10-07 15:29:57 -07:00
Paul O’Shannessy
33d2b5e8ff Merge pull request #2238 from syranide/noclassid
Remove superfluous classID from DOMAttributeNames
2014-10-07 15:26:19 -07:00
Paul O’Shannessy
8883d0f818 Merge pull request #2276 from spicyj/asap
Rename ReactUpdates.setImmediate to 'asap'
2014-10-07 14:27:00 -07:00
Sebastian Markbåge
f48954d8a3 Merge pull request #2300 from sebmarkbage/descriptorstoelements
Renamed Descriptor -> Element
2014-10-07 13:44:44 -07:00
Sebastian Markbage
8f1657bba6 Renamed Descriptor -> Element
We've decided on a new naming convention for ReactDescriptor. It's now
called ReactElement, which is a subset of the ReactNode union type.
2014-10-07 13:41:51 -07:00
Sebastian Markbage
7f9b1d18d1 Start warning when React.DOM.x is passed into JSX
React.DOM is becoming helper factories to generate ReactElements. They're not
classes. It will be ok to call them directly as functions, but not to use them
where a class is expected.
2014-10-07 10:49:18 -07:00
Sebastian Markbage
15a0c8920e Don't use React.DOM
I grepped for uses of React.DOM. This is going to be a set of helper functions
to generate ReactElements without JSX.

They're not classes so they cannot be used where a React class is expected.

Since we always use JSX, we should have no internal use for these helpers.
We can use strings instead.
2014-10-07 10:49:18 -07:00
Sebastian Markbage
b2dbccf9a2 Rename lower case variables in JSX to upper case
We're trying to move to a convention where lower-case variables on JSX are always HTML/SVG tags rather than variables in scope. See:

http://fb.me/react-jsx-lower-case

Therefore, this diff renames existing uses to upper case variables.

This throws an error on all these files, so I manually go rename all the variables. I then run lint to ensure that the rename doesn't leave any undeclared variables.
2014-10-07 10:48:57 -07:00
Sebastian Markbage
c4658c1728 Update React JSX Transforms
* Extract JSXDOM into separate transform
* Rename lower case variables in JSX to upper case
* Drop React.DOM docblock, use string tags instead
2014-10-07 10:48:57 -07:00
Pedro Nauck
fd9ddab532 change the global variable to a new sample component 2014-10-07 13:06:16 -03:00
Pedro Nauck
748a4ef1b2 add a section at 'jsx-in-depth' talking about namespaced components 2014-10-07 03:09:24 -03:00
Sebastian Markbåge
1a1104f56f Merge pull request #2287 from sebmarkbage/stringelements2
Use strings as the type for DOM elements
2014-10-03 10:49:31 -07:00
Sebastian Markbage
3aaccd2dc9 Use strings as the type for DOM elements
This makes ReactDOM a simple helper for creating ReactElements with the string tag as the type. The actual class is internal and created by instantiateReactComponent. Configurable using injection.

There's not a separate class for each tag. There's just a generic ReactDOMComponent which could take any tag name.

Invididual tags can be wrapped. When wrapping happens you can return the same tag again. If the wrapper returns the same string, then we fall back to the generic component. This avoids recursion in a single level wrapper.
2014-10-02 23:05:11 -07:00
Ben Alpert
a8fff93971 Rename ReactUpdates.setImmediate to 'asap'
Per https://github.com/facebook/react/pull/1554#issuecomment-57243842.

Test Plan: jest
2014-09-29 17:37:13 -07:00
Paul O’Shannessy
35764c5ffb [docs] Use subitem in new nav generation
(cherry picked from commit 995d0e588b)
2014-09-29 13:48:25 -07:00
Paul O’Shannessy
57de1b07d0 Merge pull request #2254 from jgable/spellingFix
Spelling fix for "Testing Flux Applications"
2014-09-26 23:11:42 -07:00
Paul O’Shannessy
3888b97433 Merge pull request #2219 from pablolmiranda/master
Creates a getMeasurementsSummaryMap in ReactDefaultPerf
2014-09-26 17:56:07 -07:00
Paul O’Shannessy
a37dcbb8e0 Merge pull request #2208 from wincent/typo-fix-03
Fix a comment typo
2014-09-26 17:55:10 -07:00
Paul O’Shannessy
0383534094 Merge pull request #2202 from syranide/noscroll
Remove non-attribute scrollLeft and scrollTop from HTMLDOMPropertyConfig
2014-09-26 17:54:49 -07:00
Paul O’Shannessy
778ca2f862 Merge pull request #1598 from syranide/nogettext
Un-mixin ReactBrowserComponentMixin from ReactTextComponent
2014-09-26 17:54:32 -07:00
Paul O’Shannessy
c14b3a1b13 Merge pull request #1520 from syranide/ediblechildren
Warn against contentEditable with children props
2014-09-26 17:54:24 -07:00
Jacob Gable
0b3c0ebced Spelling fix
- Puting -> Putting
2014-09-26 12:42:58 -05:00
Andreas Svensson
3de80ec4ba Add manifest to HTMLDOMPropertyConfig 2014-09-26 16:45:33 +02:00
fisherwebdev
65c1834059 Merge branch 'zpao-rm-flux-docs' 2014-09-26 07:05:02 -07:00
fisherwebdev
f45d753486 Merge pull request #2236 from zpao/rm-flux-docs 2014-09-26 07:03:37 -07:00
Paul O’Shannessy
6c19040d24 Point to Flux site for Flux docs
This doesn't actually remove the pages, just the main content. Sidebar
items now link offsite. The pages doesn't automatically redirect, but we
could do that if we really wanted.

Fixes #2229
2014-09-25 12:34:22 -07:00
Bill Fisher
ef327fcb23 Merge pull request #2240 from christianalfoni/patch-1
Update flux-todo-list.md
2014-09-25 08:33:02 -07:00
Bill Fisher
2f30b2648c Merge pull request #2237 from markhovskiy/patch-1
fix typos in "Testing Flux Applications"
2014-09-25 08:29:13 -07:00
Christian Alfoni
1b6a3d5215 Update flux-todo-list.md
You have to instantiate a Dispatcher to use it, not just grab the prototype or it will fail when trying to grab instance properties like: this.$Dispatcher._callbacks.
2014-09-25 11:54:52 +02:00
Andreas Svensson
cac45631c3 Remove superfluous classID from DOMAttributeNames 2014-09-25 10:46:29 +02:00
Oleksii Markhovskyi
5493b63b44 fix typos 2014-09-25 09:54:35 +02:00
Paul O’Shannessy
4f27dc30ad Merge pull request #2228 from XuefengWu/patch-1
add tip for the important jsx convention
2014-09-24 15:35:36 -07:00
Bill Fisher
6f54ed71da Merge pull request #2234 from fisherwebdev/master
[blog] testing flux applications
2014-09-24 13:08:45 -07:00
fisherwebdev
9952a54026 [blog] testing flux applications 2014-09-24 12:35:39 -07:00
Pablo Lacerda de Miranda
792b84c94b fixes ReactDefaultPerf.getMeasurementsSummaryMap format style 2014-09-23 18:50:18 -07:00
XuefengWu
b9f32a8295 Update getting-started.md
fix grammar
2014-09-24 08:26:10 +08:00
Paul O’Shannessy
67eeed601b Merge pull request #2212 from Oleg24/patch-1
Improved readability by removing semicolon
2014-09-23 17:06:53 -07:00
Oleg
86287bffd4 Add space after ellipses 2014-09-23 17:01:23 -07:00
Paul O’Shannessy
7339f8b7b8 Merge pull request #2149 from imcotton/jsx-reduce-warning
Reduce unnecessary warning while including JSX transformer in browser
2014-09-23 13:34:10 -07:00
XuefengWu
f04d648888 Update getting-started.md
merge the warn and explain for the @jsx
2014-09-23 15:22:11 +08:00
Isaac Salier-Hellendag
e7299f6039 Prefer window.getSelection for IE
IE9+ supports `window.getSelection()` but `SelectEventPlugin` gives precedence to `document.selection` instead. `document.selection` is still available in later versions of IE, but the modern Selection object is preferable. Swap the two.
2014-09-22 16:56:22 -07:00
Paul O’Shannessy
176d47319a Merge pull request #2225 from jesseskinner/patch-1
Fix inconsistency in mockComponent argument name
2014-09-22 14:42:38 -07:00
Paul O’Shannessy
9919734df3 Merge pull request #2180 from zpao/fix-2179
Reword Component API intro
2014-09-22 14:41:18 -07:00
Paul O’Shannessy
eafe786aef Reword Component API intro
Fixes #2179
2014-09-22 14:40:22 -07:00
Paul O’Shannessy
bf0fe94561 Merge pull request #2209 from glenjamin/patch-2
[docs] Clarify wording on sub-tree reconciliation
2014-09-22 14:32:18 -07:00
Paul O’Shannessy
8cd460ce24 Move examples from the website to the wiki. 2014-09-22 14:29:39 -07:00
Andreas Svensson
14ba6ee788 Un-mixin ReactBrowserComponentMixin from ReactTextComponent 2014-09-22 23:28:26 +02:00
Paul O’Shannessy
7cf350a5a1 Merge pull request #2223 from cody/stripTypes
Add stripTypes option to npm docs
2014-09-22 13:38:37 -07:00
Paul O’Shannessy
97a41db82c Merge pull request #2218 from fisherwebdev/master
Acknowledge ProjectMoon for allowing us to use the flux name on npm
2014-09-22 13:09:06 -07:00
XuefengWu
0ae09f4c70 add tip for the important jsx convention
I missed the convention and wast hours to figure out what's wrong. 
Add this tip in the document for who would miss the importance comment.
2014-09-22 20:10:34 +08:00
fisherwebdev
0e4e7ea7e1 Acknowledge ProjectMoon for allowing us to use the flux name on npm 2014-09-21 21:10:39 -07:00
Jesse Skinner
3109082144 Fix inconsistency in mockComponent argument name
The second argument of mockComponent was listed as tagName, but referred to in the description as mockTagName. I changed the first one to mockTagName to be consistent.
2014-09-21 23:00:25 -04:00
Stefan Dombrowski
7597cfc5fb Add stripTypes option to npm docs 2014-09-21 19:22:22 +02:00
Pablo Lacerda de Miranda
486c69b6de extracts getMeasurementsSummaryMap from ReactDefaultPerf.printWasted 2014-09-19 16:03:41 -07:00
Oleg
d06018cbac Improved readability by removing semicolon
The first sentence had an unnecessary semicolon which made the whole thing difficult to read.  The new syntax is not only easier to read but also more exciting.
2014-09-18 21:34:47 -07:00
Paul O’Shannessy
9d7e3a7471 Merge pull request #2211 from jacobgreenleaf/master
Fix typo in documentation in Flux Todo List
2014-09-18 18:33:04 -07:00
Jacob Greenleaf
8882f19187 Fix typo in documentation in Flux Todo List 2014-09-18 18:30:57 -07:00
Glen Mailer
cf512bf60d [docs] Clarify wording on sub-tree reconciliation
The previous wording could be interpreted to mean sub-trees moving from
within one sibling to within another, rather than the shuffling of siblings on
a single level as intended
2014-09-18 22:48:35 +01:00
Greg Hurrell
94eac0b8fa Fix a comment typo 2014-09-18 09:47:23 -07:00
Andreas Svensson
802ad0bc00 Remove non-attribute scrollLeft and scrollTop from HTMLDOMPropertyConfig 2014-09-17 14:40:37 +02:00
Paul O’Shannessy
21f601964f Merge pull request #1301 from markijbema/patch-1
Only stop if the transition on this element ended
2014-09-12 17:00:05 -07:00
Christopher Chedeau
aa25eb8e40 Update 2014-09-12-community-round-up-22.md 2014-09-12 11:34:29 -07:00
Christopher Chedeau
05cec04367 Merge pull request #2186 from vjeux/roundup_22
Community roundup #22
2014-09-12 11:06:25 -07:00
Christopher Chedeau
d53a365e77 Community roundup #22 2014-09-12 10:35:30 -07:00
Paul O’Shannessy
af485d928f Merge pull request #2181 from zpao/move-onscroll-detection
Move onscroll detection
2014-09-11 15:59:11 -07:00
Paul O’Shannessy
584e6bd648 Ignore .module-cache from jest [skip ci]
I hit a case where running jest was including files from the module
cache. I don't think that should have happened, but this works.
2014-09-11 15:28:20 -07:00
Paul O’Shannessy
def41dfd8f Move onscroll warning test
This moves it to the appropriate place to accomodate the move of the check.
2014-09-11 15:15:19 -07:00
Paul O’Shannessy
a10436d4ab Merge pull request #2097 from fitzgen/explain-where-to-provide-key
Explain where to provide the key for dynamic children.
2014-09-11 14:14:55 -07:00
Paul O’Shannessy
6daf6d31f3 Merge pull request #2178 from benfoxall/patch-1
Docs grammar tweak
2014-09-11 10:36:32 -07:00
Ben Foxall
fe08888fbb Less -> Fewer
bugs and bytes are countable, so should be fewer
2014-09-11 14:33:16 +01:00
Nick Fitzgerald
18874a6054 Explain where to provide the key for dynamic children. 2014-09-10 14:53:41 -07:00
Andrew Rasmussen
7ae8909504 Move IE8 onscroll check
Rather than checking if document.onscroll exists in EventPluginHub
(which is agnostic of the DOM) do it in ReactDOMComponent
2014-09-10 13:33:23 -07:00
Paul O’Shannessy
76d64812e1 Merge pull request #2170 from undernewmanagement/patch-1
Added extra explanation for require() statements
2014-09-10 13:21:47 -07:00
Sheraz
9e6c442df0 Updated small change with zuggestions from @zpao 2014-09-10 12:29:54 +02:00
Paul O’Shannessy
53be3905f8 Merge pull request #2167 from mhintz/patch-1
Update ref-03-component-specs.md
2014-09-09 16:00:39 -07:00
Paul O’Shannessy
99191046f9 Merge pull request #2113 from BinaryMuse/fix_numeric_properties
Fix DOMProperty bitmask checking
2014-09-09 15:26:38 -07:00
Paul O’Shannessy
0d66ea301e Merge pull request #2165 from DJCordhose/patch-1
Update 09.5-clone-with-props.md
2014-09-09 09:41:51 -07:00
Mark Anderson
e8e50986c5 Added extra explanation for require() statements 2014-09-09 14:39:07 +02:00
Mark Hintz
95def7f829 Update ref-03-component-specs.md
Edit the description of componentDidMount() to make clear that the function is called only once during the lifecycle of the component, after only the initial render() call. The description is now similar to that for componentWillMount(). The existing wording does not make it clear that the function is called only after the initial render. (Granted, it is possible to infer this from descriptions of the component lifecycle found elsewhere in the documentation, but I think explicit is better than implicit in this case).
2014-09-09 11:50:13 +02:00
Oliver Zeigermann
8601a3c27d Update 09.5-clone-with-props.md 2014-09-09 10:52:26 +02:00
Paul O’Shannessy
5d88ebbecb Merge pull request #2144 from zertosh/master
Comment typo
2014-09-08 19:37:00 -07:00
Paul O’Shannessy
79ca0c7fd2 Merge pull request #1848 from fgnass/master
add picture element and related attributes
2014-09-08 16:23:39 -07:00
Paul O’Shannessy
f3c64704ad Merge pull request #1988 from syranide/tacfix
Don't wrap values with ReactTextComponent in traverseAllChildren (cloneWithProps)
2014-09-08 15:36:26 -07:00
Paul O’Shannessy
61c42ccdee Update Bootstrap example to 3.2.0 2014-09-08 14:32:19 -07:00
Isaac Salier-Hellendag
8c9a24983e Remove calls to Range.detach
This method is a no-op, as demonstrated by console warnings in Chrome and https://developer.mozilla.org/en-US/docs/Web/API/range.detach.

Remove callsites.

Fixes #2142
2014-09-08 14:30:53 -07:00
Andreas Svensson
45f8837e35 Don't wrap values with ReactTextComponent in traverseAllChildren 2014-09-08 22:35:25 +02:00
Paul O’Shannessy
adb62c76e5 Merge pull request #2158 from Daniel15/htmltojsx-move
Move htmltojsx.js to React-Magic project.
2014-09-07 18:52:37 -07:00
Daniel Lo Nigro
6ceb47e8bf console.warn when html-jsx-lib.js is loaded 2014-09-07 15:20:42 -07:00
Paul O’Shannessy
4398879c2e Merge pull request #2155 from rickbeerendonk/patch-1
Update video.md with Forward JS 2014 talk
2014-09-07 14:31:03 -07:00
Cheng Lou
90d1aeb1c3 Merge pull request #2156 from simonwelsh/patch-1
Correct highlighted block
2014-09-07 14:51:27 -04:00
Daniel Lo Nigro
1d1b6ed07a Move htmltojsx.js to React-Magic project.
The HTMLtoJSX file is really a part of the React-Magic project, and should belong there rather than here:
 - It doesn't really follow the release cycle of React at all
 - It is totally standalone with no dependency on React
 - The only usage of this script is in React-Magic and on the HTML to JSX page on the React website (http://facebook.github.io/react/html-jsx.html)

I've hotlinked it from the Github site for that project since this was the easiest way to pull it in.

Due to the fact that Github Pages lacks redirects (among other basic web hosting functionality), I've replaced the `html-jsx-lib.js` file with a comment explaining where the file has moved to, just in case anyone was hotlinking it from the React site.
2014-09-06 22:51:52 -07:00
Simon Welsh
611abfbcb7 Correct highlighted block 2014-09-06 20:46:19 +10:00
Rick Beerendonk
34b4ed7316 Update video.md with Forward JS 2014 talk
Added "React and Flux: Building Applications with a Unidirectional Data Flow" by Bill Fisher and Jing Chen.
2014-09-06 11:33:36 +02:00
Paul O’Shannessy
ea76f9bf63 Merge pull request #2116 from spicyj/nl-jsx-spread
Add newline before JSX spread when appropriate
2014-09-05 14:34:54 -07:00
Paul O’Shannessy
6c8c70eea4 Merge pull request #2152 from RReverser/fix-pr-check
Fix check for commit ranges in racing PRs.
2014-09-05 14:13:33 -07:00
Paul O’Shannessy
0ad43aff5e Merge pull request #2153 from jeffmo/jsx_strip_types
Add --strip-types flag to bin/jsx
2014-09-05 14:10:37 -07:00
jeffmo
808730df59 Add support for a --strip-types flag to bin/jsx 2014-09-05 16:28:46 -04:00
jeffmo
bcc291b591 Bump esprima + jstransform versions 2014-09-05 15:42:07 -04:00
Paul O’Shannessy
ce014a00a5 Merge pull request #2148 from nordstrom-innovation/docfix
corrected highlighted/updated line in tutorial example
2014-09-05 10:59:24 -07:00
Ingvar Stepanyan
3b2cd51fa5 Fix check for commit ranges in racing PRs.
See #1768 / #2000 for original issue.
See https://github.com/travis-ci/travis-ci/issues/1719#issuecomment-51705110 for problem description and origin of this fix.
This is still a temporary fix until travis-ci/travis-core#383 is merged.
2014-09-05 15:45:21 +03:00
Paul O’Shannessy
b36c9f6638 Merge pull request #2147 from naman34/patch-2
added the missing **
2014-09-04 16:26:35 -07:00
Cotton Hou
6294d7aacc Reduce unnecessary warning while including JSX transformer in browser 2014-09-05 07:15:39 +08:00
jon madison
3e59977046 corrected highlighted/updated line in tutorial example 2014-09-04 16:07:34 -07:00
Nick Merwin
610b75a5b6 Update Like button example verbiage
Changes text "You unlike this" to "You liked this". Makes a bit more grammatical sense.

Closes #2146.
2014-09-04 15:21:27 -07:00
Naman Goel
815f267700 added the missing **
Missed it the last time. Apologies.
2014-09-05 03:21:30 +05:30
Andres Suarez
4c2f124aa8 Comment typo 2014-09-04 12:00:43 -04:00
Andreas Svensson
05fa75d395 IE8 does not have a setter for property "enctype" 2014-09-04 12:11:01 +02:00
Paul O’Shannessy
00fe66ddec Merge pull request #2106 from subtleGradient/subtleGradient/improve-ReactPerf-debugging
Improve debugging for methods using ReactPerf
2014-09-03 17:46:49 -07:00
Paul O’Shannessy
c707c2568e JSX spec blog post 2014-09-03 15:37:08 -07:00
Paul O’Shannessy
1854e8a912 Merge pull request #2033 from pekim/master
Add support for <dialog> tag.
2014-09-03 14:47:41 -07:00
Paul O’Shannessy
9a89edbb22 Fix broken link in animation docs
Missed in #2068
2014-09-03 11:59:14 -07:00
Paul O’Shannessy
073e1186d7 Merge pull request #2120 from zpao/svg-logo
[docs] SVG logo
2014-09-02 14:05:05 -07:00
Paul O’Shannessy
c406534c26 Merge pull request #2124 from Daniel15/htmltojsx-fixes
Small tweaks to HTML to JSX page
2014-09-02 14:03:21 -07:00
Paul O’Shannessy
f678591ad6 Merge pull request #2101 from jeffchan/patch-1
Fix typo in ReactDefaultPerfAnalysis comment
2014-09-02 11:57:45 -07:00
Brandon Tilley
0e28f5e6d7 Fix DOMProperty bitmask checking 2014-09-02 06:53:58 -07:00
Daniel Lo Nigro
e11b4078bc Small tweaks to HTML to JSX page:
- Remove "Compiled JS" tab since it doesn't make sense
 - Relabelled editor to "Live HTML Editor" rather than "Live JSX Editor"
2014-08-31 21:48:10 -07:00
Mike D Pilsbury
ffa0447177 Add support for <dialog> tag's open attribute. 2014-08-31 12:43:32 +01:00
Paul O’Shannessy
820210fd9e Merge pull request #2091 from julen/docs/LinkedState
Docs: renamed input's state to `inputValue`
2014-08-30 17:25:49 -07:00
Paul O’Shannessy
9f802e7703 Merge pull request #2075 from IvanVergiliev/patch-1
Add 2048-react to open-source demos
2014-08-30 17:24:11 -07:00
Paul O’Shannessy
11a96fd8ce Merge pull request #2119 from naman34/patch-1
added production example
2014-08-30 16:08:58 -07:00
Paul O’Shannessy
9a1236790b SVG logo
I traced the current logo in Illustrator to get a good version. And with
SVG we don't need any 2x magic because it's already vector. I should
probably care about IE8, but I don't.
2014-08-30 16:03:49 -07:00
Naman Goel
3c74626a70 added production example
Addition note: Scribbler.co uses an infinite.js/UITableView like rendering pattern with animations which is only possible because of React.
2014-08-31 03:26:08 +05:30
Paul O’Shannessy
59324ab6d5 Merge pull request #2117 from spicyj/jest-vendor
Include vendor/ when running jest tests
2014-08-30 12:55:20 -07:00
Paul O’Shannessy
87cbde0a40 Merge pull request #2118 from spicyj/es7-spread
Enable ES7 spread transform when using --harmony
2014-08-30 12:54:58 -07:00
Ben Alpert
9f4ae415e2 Enable ES7 spread transform when using --harmony
Test Plan: `echo "var o = {...x};" | bin/jsx --harmony` outputs `var o = Object.assign({},x);`.
2014-08-30 01:10:21 -07:00
Ben Alpert
1ba022b1ea Include vendor/ when running jest tests
Now the two transform tests get run alongside the React core tests.

Test Plan: jest
2014-08-30 01:08:57 -07:00
Ben Alpert
cc9735f889 Add newline before JSX spread when appropriate
Previously, we were losing the newline before a JSX spread attribute which would cause the lines to not match up; this fixes the problem.
2014-08-30 01:04:19 -07:00
Sebastian Markbage
4af98990db Bumping version to help filtering. 2014-08-29 14:35:22 -07:00
Sebastian Markbage
63046277e4 Bumping version to help filtering. 2014-08-29 14:35:12 -07:00
Sebastian Markbage
bad1b7c41a Start warning for JSX on plain functions
Let's also bump the version number for the log so that we can start filtering
out the other logs.
2014-08-29 14:35:07 -07:00
Sebastian Markbage
3c6c437d07 Don't transfer props to mocked empty component
We currently automatically render empty components in place of mocks. However,
we were accidentally transferring the props from the mocked descriptor to the
empty component placeholder. Even children.

This change just cleans that up and should only affect unit tests.
2014-08-29 14:35:01 -07:00
Sebastian Markbage
f5a0d667a5 Add version to legacy factory monitoring 2014-08-29 14:34:58 -07:00
Miorel Palii
335e91df71 Fix console warning in LegacyImmutableObject
It does check `hasOwnProperty`, but *after* accessing the field and therefore triggering enumerable getters in modified prototypes.
2014-08-29 14:32:50 -07:00
Ben Alpert
944f49c264 Merge pull request #2080 from fisherwebdev/master
[docs] Update Flux TodoMVC Tutorial
2014-08-28 12:11:28 -07:00
Thomas Aylott
755cc9671f Combine displayName using underscore 2014-08-28 14:58:59 -04:00
Thomas Aylott
a6116b31e5 Improve debugging for methods using ReactPerf 2014-08-28 13:49:51 -04:00
Jeff Chan
ef9c9c81d0 Fix typo 2014-08-27 21:17:10 -07:00
Cheng Lou
74ff6fb6b8 Merge pull request #2039 from crm416/return-false
Deprecate 'return false' in event handlers
2014-08-27 13:33:40 -07:00
Cheng Lou
95de877dce Merge pull request #2036 from crm416/static-functions
Throw an error when functions on `statics` clash due to duplicate keys
2014-08-27 11:36:53 -07:00
Julen Ruiz Aizpuru
ca66baee83 Docs: renamed input's state to message
Readers might feel confused with the actual input's `value` attribute.
2014-08-27 13:02:00 +02:00
Ben Alpert
f7c7676a98 Merge pull request #2083 from chenglou/docs-retina-icon
[Docs] Make retina react logo work
2014-08-24 23:19:41 -07:00
Cheng Lou
2920473ea1 [Docs] Make retina react logo work
Bourbon now takes *_2x instead of *@2x.
2014-08-23 18:09:20 -07:00
Charles Marsh
eb36b57079 Use warning module 2014-08-23 09:46:32 +08:00
Cheng Lou
174e67564c Merge pull request #2078 from michaelrp/patch-1
Including missing validation check
2014-08-22 11:36:47 -07:00
fisherwebdev
9fe36e591b [docs] remove redundant paragraph 2014-08-22 09:50:05 -07:00
fisherwebdev
149cadd664 [docs] fix nits 2014-08-22 09:46:34 -07:00
Michael Randers-Pehrson
c999785fa0 Adding e.preventDefault() to handleSubmit,
Also added plain `return`, updated text.
2014-08-22 08:27:23 -04:00
fisherwebdev
bc4d935cb0 [docs] Update Flux TodoMVC Tutorial 2014-08-22 02:21:04 -07:00
Charles Marsh
979a93a70a Removed monitorCodeUse call 2014-08-22 13:09:38 +08:00
Michael Randers-Pehrson
6c926094c3 Including missing validation check
The validation check was removed from the update to the CommentForm handleSubmit function.
2014-08-21 23:00:05 -04:00
Felix Gnass
942d358ace use attribute for media, srcSet and sizes 2014-08-22 00:37:32 +02:00
Charles Marsh
f01246d6bb Indentation for eventHandlerName 2014-08-21 09:13:35 +08:00
Cheng Lou
72e690ecfb Merge pull request #2037 from crm416/duplicate-key
More informative error message for mergeObjectsWithNoDuplicateKeys
2014-08-20 17:27:07 -07:00
Cheng Lou
b8ab95aaa7 Merge pull request #2054 from chenglou/accum
[RFC] Use `accumulateInto` to save even more allocation
2014-08-20 13:36:45 -07:00
Cheng Lou
48e901f8ae [RFC] Use accumulateInto to save even more allocation
Trying to make the event a bit more performant for events.

Feel free to reject this because the API inevitably isn't great. It's good for perf though, and since we're only using `accumulate` in very restrained places, I think we're fine.

`accumulateInto` is `accumulate` that mutates more and allocates less. I kept `accumulate` in case we want that in the future.
2014-08-20 13:10:50 -07:00
Paul O’Shannessy
ef47bb753c Merge pull request #2076 from whatasunnyday/master
Add example to if else in JSX.
2014-08-20 12:45:04 -07:00
Sunny Juneja
b9cf0d2bdd Add example to if else in JSX. 2014-08-20 12:29:21 -07:00
Paul O’Shannessy
4d9a2c4a29 Make npm run-script jest available
This is slightly shorter than typing `./node_modules/.bin/jest`.
2014-08-20 11:48:01 -07:00
Paul O’Shannessy
417678310c Update Object.assign polyfill
The spec changed to allow null & undefined sources without throwing.
Now our code depends on this new behavior. The only browser that
implements Object.assign has also updated its native implementation to
this behavior (Firefox Nightly).
2014-08-20 11:44:24 -07:00
IvanVergiliev
f627ddfb74 Add 2048-react to open-source demos
Nothing too complicated, but I think it could be a fun beginner demo.
2014-08-20 15:17:27 +03:00
Paul O’Shannessy
2058ad99be Sync out latest JSX transforms
The biggest change: instead of calling functions directly, we now use
React.createElement to wrap.

The other big change: this removes the need for the @jsx pragma.
Instead we'll parse everything, assume React is in scope,
and only look for the actual XJS parts in the AST (as opposed to only
runing the transform when @jsx was specified in the docblock).

Note: this is actually a series of commits internally and should have
been syned out in pieces over the past several weeks.
2014-08-20 00:27:38 -07:00
Sebastian Markbage
aae31ae24c ReactMount calls a legacy factory use createDescriptor instead
This fixes some log spew since this pattern is deprecated. This doesn't use
the validator in the descriptor creation so there's no prop type checks here.
I guess that's fine because we still have the second prop type checks.

We need to use ReactLegacyDescriptor because the constructor here will be a
legacy factory that we need to unwrap.

constructAndRenderComponent should be deprecated.
2014-08-20 00:15:43 -07:00
Sebastian Markbage
5c51f2fe46 Check if a function has a prototype first
Because somehow someone used a prototype less function with JSX.
2014-08-20 00:15:32 -07:00
Sebastian Markbage
68b7b82145 Start warning when calling a legacy factory
Let's start warning when a legacy factory is called as a plain function call.
2014-08-20 00:15:11 -07:00
Sebastian Markbage
989e6b618e Drop usage of plain functions to create descriptors
Replace plain function calls to legacy factories with createFactory or
createElement. For ReactDOMComponents the type should be replaced with
strings.

Because we don't have easy access to ReactLegacyDescriptor from within
React, we need to use the .type property to extract the real class.
This will go away later and is covered by unit tests.
2014-08-20 00:14:59 -07:00
Sebastian Markbage
c901b1005e Make createDescriptor return a descriptor for components
This moves all logic around legacy descriptors to ReactLegacyDescriptor. This
is responsible for the layer that knows that createClass exports a legacy
factory. When passed one of these classes, it unwraps it to be a real class.

If it is passed a non legacy factory, it is assumed to be a non-react component
that needs to be invoked as a plain function.

The semantic change is that a descriptor is now always returned if passed a
legacy factory. Even if that factory is a mock. A mock would previously return
undefined.

For mocks, I treat the factory as the authoritative function. I call it to extract
the instance or fill it with an empty component placeholder.

Additionally, I make the classes take props as the first argument to the
constructor. This is what the new class system will do.

We currently need to set up some internals by calling the internal construct
method. Instead of doing that automatically in the constructor, I now move that
to a second pass so that mocks can get the plain props.

This means that we can assert that a mock has been called once it's mounted
with it's final props. Instead of the descriptor factory being called.
2014-08-20 00:14:32 -07:00
Paul O’Shannessy
182379305a Update vendored modules 2014-08-20 00:14:28 -07:00
Cheng Lou
25c9d6d578 Merge pull request #2068 from ChrisSki/patch-1
Update 09.1-animation.md
2014-08-19 18:10:31 -07:00
Chris Sciolla
99ed64387d Update 09.1-animation.md 2014-08-19 20:59:13 -04:00
Charles Marsh
0ecc7e5a7f Look on __reactBoundContext for displayName 2014-08-20 08:44:33 +08:00
Chris Sciolla
65e1938708 Update 09.1-animation.md
The reason I chose to submit this is because it was initially unclear from the docs that the transition group needed to already be mounted in order for it to work properly.
2014-08-19 15:11:07 -04:00
Charles Marsh
cf45a40bb8 More info in monitorCodeUse call 2014-08-18 22:57:02 -04:00
Josh Duck
5b4e2be867 Iterate over expectedFeatures correctly
This fails if Array.prototype is extended.
2014-08-18 18:18:05 -07:00
Paul O’Shannessy
326be2faa6 Merge pull request #2053 from zpao/jsx-transformer-optional-sourcemaps
Don't force sourcemaps on for JSXTransformer APIs
2014-08-18 18:10:57 -07:00
Paul O’Shannessy
ea17506f6a Merge pull request #2062 from dmitriiabramov/patch-1
remove doubled whitespace chars in jsDoc
2014-08-18 16:54:06 -07:00
Paul O’Shannessy
32d3f79dc5 Upgrade Commoner
It no longer parses @providesModule directives by default.

Fixes #1145
2014-08-18 15:12:39 -07:00
Dmitrii Abramov
d50278997c remove doubled whitespace chars in jsDoc 2014-08-18 14:26:26 -07:00
Cheng Lou
a43d8c588b Fix bad merge from 04c9820694
Didn't sync out correctly.
2014-08-18 10:37:18 -07:00
Cheng Lou
196030aeb5 Merge pull request #2058 from chantastic/patch-2
docs(flux-todo-list): fix TodoStore syntax
2014-08-17 19:52:54 -07:00
Michael Chan
aaeb107e00 docs(flux-todo-list): fix TodoStore syntax
Add missing semicolon behind `TodoStore#addChangeListener'
2014-08-17 19:37:10 -07:00
Lee Byron
04c9820694 Merge pull request #1601 from gaearon/apply-component-and-mixin-spec-deterministically
Apply component and mixins specs deterministically
2014-08-15 18:08:03 -07:00
Paul O’Shannessy
d9a053d287 Don't force sourcemaps on for JSXTransformer APIs
In case somebody doesn't want sourcemaps (eg, react-rails) or r.js
2014-08-15 17:51:41 -07:00
Charles Marsh
429650a750 Test for both true and false 2014-08-15 19:47:36 -04:00
Charles Marsh
c5be746fda Fixed style and comment nits 2014-08-15 11:52:22 -04:00
Paul O’Shannessy
d970dc45d9 Merge pull request #1826 from syranide/jsxasync
JSXTransformer respects async attribute
2014-08-14 15:13:04 -07:00
Paul O’Shannessy
f479cffdbb Merge pull request #2042 from zpao/update-recast
Update recast to 0.6, update constants.js
2014-08-14 13:59:45 -07:00
Paul O’Shannessy
d7f21d760b Update recast to 0.6, update constants.js
I dropped the part of constants.js that we weren't using (namely the
part where we insert constants) but left it open to do that. It should
be trivial, we just aren't using it.

Fixes #1824
2014-08-14 11:14:20 -07:00
Charles Marsh
a195d3ea1f Re-add with warning and monitorCodeUse 2014-08-14 10:43:00 -04:00
Andreas Svensson
079400c2a6 JSXTransformer respects async attribute
Conflicts:
	vendor/browser-transforms.js
2014-08-14 10:00:27 +02:00
Charles Marsh
45f8b52135 Deprecate 'return false' in event handlers 2014-08-13 22:37:41 -04:00
Ben Alpert
5ca9e193ee Merge pull request #2038 from zpao/update-testutil-docs
TestUtils docs: isComponentOfType -> isDescriptorOfType
2014-08-13 19:29:16 -07:00
Paul O’Shannessy
aa959dcb97 TestUtils docs: isComponentOfType -> isDescriptorOfType
Fixes #1946
2014-08-13 19:23:47 -07:00
Charles Marsh
a70db003db Throw if a reserved property is defined in 'statics' 2014-08-13 21:34:49 -04:00
Paul O’Shannessy
5df9b90c3d Merge pull request #1832 from rayqian/master
Add chinese translation for 02-displaying-data.md
2014-08-13 17:38:44 -07:00
Paul O’Shannessy
d6f5ff0288 Merge pull request #1867 from WickyNilliams/patch-1
Add note about key prop being excluded by cloneWithProps
2014-08-13 17:36:48 -07:00
Paul O’Shannessy
f30e5b5a72 Merge pull request #2007 from janhancic/better-docs-for-select-multiple
Add a 'note' about passing arrays into the `value` attribute
2014-08-13 17:27:26 -07:00
Paul O’Shannessy
91cdd5af24 Merge pull request #2010 from nw/patch-1
Update ref-01-top-level-api.md
2014-08-13 17:26:51 -07:00
Ben Alpert
f982387c6e [docs] Move "| React" to end of OG title
For consistency!
2014-08-13 16:30:43 -07:00
Paul O’Shannessy
6d740448e2 [docs] Move "| React" to end of page title
Looks better in search results
2014-08-13 16:28:50 -07:00
Paul O’Shannessy
eb3ea3f2df Move batchedUpdated to React.addons
This is a followup to #1060, where I did not read closely enough before
merging.
2014-08-13 15:40:40 -07:00
Paul O’Shannessy
938bcbecd5 Merge pull request #1060 from spicyj/gh-906
Add React.batchedUpdates to public API
2014-08-13 15:37:43 -07:00
Paul O’Shannessy
ec6653aa56 Merge pull request #1952 from slorber/master
Update 09.2-form-input-binding-sugar.md -> document checkedLink
2014-08-13 15:32:27 -07:00
Charles Marsh
87607045e4 Abbreviated error message 2014-08-13 18:25:53 -04:00
Paul O’Shannessy
16dfaca66a Merge pull request #2035 from zpao/jekyll-update
[Docs] Update Jekyll + more
2014-08-13 15:23:37 -07:00
Charles Marsh
dcdc35fab6 More informative error message for mergeObjectsWithNoDuplicateKeys 2014-08-13 16:59:40 -04:00
Charles Marsh
71e49adf35 Throw an error when functions on statics clash due to duplicate keys 2014-08-13 16:33:57 -04:00
Karpich Dmitry
a185f09943 Add classid property for <object/> tag
This properties needed to work with ActiveX objects in IE, created by
<object/> tag.

Closes #1526
2014-08-13 13:28:19 -07:00
Paul O’Shannessy
fdf97f42f7 Update README to use bundle exec *
Also, referenced rake release task
2014-08-13 12:38:09 -07:00
Paul O’Shannessy
2cbf609856 Autogenerate acknowledgements 2014-08-13 12:38:09 -07:00
Paul O’Shannessy
51df0efe34 Use jekyll-redirect-from instead of our other redirect method 2014-08-13 12:38:09 -07:00
Paul O’Shannessy
4c7cd13ab3 Set default layout for docs 2014-08-13 11:40:14 -07:00
Paul O’Shannessy
03df215bd2 Default to layout: post for posts
Just a little less boilerplate. This also removes a bit of trailing
whitespace because it shouldn't have been there.
2014-08-13 11:37:19 -07:00
Paul O’Shannessy
b58b9d0b79 Update Bourbon files (4.0.2) 2014-08-13 11:20:00 -07:00
Paul O’Shannessy
8dbdd53e46 Reorder _config for sanity 2014-08-13 11:14:24 -07:00
Paul O’Shannessy
77fa3f35b5 Minimal updates for Jekyll 2.0 2014-08-13 11:10:40 -07:00
Paul O’Shannessy
ed27c89748 Merge pull request #2026 from spicyj/likely-a-bug-in-the-framework
Improve Danger error message to not blame React
2014-08-12 13:23:29 -07:00
Mike D Pilsbury
f035949e73 Add support for <dialog> tag.
fixes #2017
2014-08-12 19:58:10 +01:00
Ben Alpert
26aff787e7 Merge pull request #2028 from andrezsanchez/patch-1
Fix typo
2014-08-11 20:09:28 -07:00
Andre Z Sanchez
6f49827c12 Fix typo 2014-08-11 22:57:33 -04:00
Ben Alpert
e2ac2f326c Improve Danger error message to not blame React 2014-08-11 15:18:07 -07:00
Nathan White
c141a8581f changed type info. added descriptor to descriptions 2014-08-11 15:44:21 -06:00
Ben Alpert
13e60298e1 Merge pull request #2025 from zpao/rm-flux-todomvc
Remove TodoMVC flux example
2014-08-11 13:37:23 -07:00
Paul O’Shannessy
1033c4805f Remove TodoMVC flux example
It lives at https://github.com/facebook/flux/tree/master/examples/flux-todomvc now.
2014-08-11 13:02:12 -07:00
Ben Alpert
f7af58fa0c <noscript /> -> null in todomvc-flux Footer 2014-08-11 12:26:10 -07:00
Paul O’Shannessy
986f5a1a07 Merge pull request #1662 from gaearon/warn-when-using-hyphenated-style-names
Warn when using hyphenated style property names

Closes #1662

Conflicts:
	src/browser/ui/dom/CSSPropertyOperations.js
2014-08-11 10:18:08 -07:00
Paul O’Shannessy
0e5316f12f Merge pull request #2021 from adammark/patch-1
Close <section> tag in sample markup
2014-08-11 10:07:36 -07:00
Adam Mark
8642262aad Copy edit (fix grammar) 2014-08-11 12:19:08 -04:00
Adam Mark
77d7b4928e Close <section> tag in sample markup 2014-08-11 12:13:04 -04:00
Cheng Lou
82da739d9e Merge pull request #2018 from samselikoff/patch-2
Clarify section introducing callbacks
2014-08-10 13:59:20 -07:00
Sam Selikoff
90888debd0 Clarify section introducing callbacks 2014-08-10 16:47:06 -04:00
Cheng Lou
68930ad4a6 Merge pull request #2016 from samselikoff/patch-1
Clarify section introducing `props`
2014-08-09 17:54:15 -07:00
Sam Selikoff
255f238cee Clarify section introducing props 2014-08-09 19:24:40 -04:00
Paul O’Shannessy
c506b44173 Merge pull request #2000 from RReverser/stop-travis-on-docs
Cancelling Travis build on commits with docs updates only.
2014-08-08 13:25:23 -07:00
Nathan White
c53fb8f405 Update ref-01-top-level-api.md
Added docs for `React.isValidClass` and `React.isValidComponent`. 

Still missing top level api:

* `constructAndRenderComponent`
* `constructAndRenderComponentById`
* `withContext`
2014-08-07 12:09:45 -06:00
Jan Hancic
1db8756b8f Remove quotes around the value attribute 2014-08-07 09:22:46 +01:00
Jan Hancic
b25e4368bb Add ={true} so it's aligned with recommended practises 2014-08-07 08:10:55 +01:00
Josh Duck
f71455fb31 Fire onBeforeUpdate for space on Android
We deliberately skip the event, but Android Chrome
doesn't fire the keypress, so this is wrong.
2014-08-06 16:41:56 -07:00
Sebastian Markbage
036d751397 Add createElement alias for createDescriptor 2014-08-06 16:41:47 -07:00
Jan Hancic
b016400bb1 Add a 'note' about passing arrays into the value attribute
This is for #1700
2014-08-06 23:45:37 +01:00
Cheng Lou
aaa8a5ff50 Merge pull request #1990 from syranide/rmctest
Simplified and improved test-cases for ReactMultiChildText-test
2014-08-06 11:20:59 -07:00
Cheng Lou
12ab5e8345 Merge pull request #1974 from jstoja/jquery-tutorial
jQuery note in tutorial
2014-08-05 22:10:58 -07:00
Andreas Svensson
41d5cee44e Simplified and improved test-cases for ReactMultiChildText-test 2014-08-05 23:40:11 +02:00
Ingvar Stepanyan
233af7e2df Cancelling Travis build on commits with docs updates only.
Currently recognized patterns:

* any Markdown files (*.md)
* any files in docs or examples directories.

Closes facebook/react#1768.
2014-08-06 00:39:55 +03:00
Ben Alpert
e39a28c175 [docs] Add parens to defeat ASI in example
Fixes #1996.
2014-08-04 21:48:24 -07:00
Cheng Lou
2d250d44a5 Merge pull request #1993 from spicyj/devtools-warning-2
Slightly more considerate devtools warning
2014-08-04 14:25:16 -07:00
Ben Alpert
3045291417 Slightly more considerate devtools warning
See #953.
2014-08-04 11:16:51 -07:00
Ben Alpert
e2dad02ef2 Wording tweaks to reconciliation docs 2014-08-04 08:36:49 -07:00
Ben Alpert
716742dcd7 Merge pull request #1972 from cutbko/patch-1
Update ref-08-reconciliation.md
2014-08-04 08:35:22 -07:00
Julien Bordellier
46c0bbfb11 Using the markdown's quote syntax and explaining why use include jQuery 2014-08-04 10:42:55 +02:00
Christopher Chedeau
226f45b24d typo "refere" -> "reference" 2014-08-03 18:53:18 +02:00
Christopher Chedeau
5805ab17ed Merge pull request #1976 from vjeux/community_21
Community Roundup #21
2014-08-03 18:22:57 +02:00
Christopher Chedeau
ffef61e407 english + casing + 02 -> 03 2014-08-03 18:20:54 +02:00
Ben Alpert
320d72c735 Merge pull request #1985 from jimobrien/master
Fix typo in test utils documentation
2014-08-03 00:41:49 -07:00
Jim OBrien
0e7526e401 typo 2014-08-02 22:04:37 -07:00
Christopher Chedeau
cd25fe1ef3 Community Roundup #21 2014-08-02 14:44:57 +02:00
Julien Bordellier
5eca8d604f Adding a note just below the jQuery inclusion in the tutorial to inform that jQuery is not mandatory.
It's linked with #603
2014-08-02 11:32:31 +02:00
cutbko
d0494ac85c Update ref-08-reconciliation.md 2014-08-02 02:59:16 +03:00
Paul O’Shannessy
5d288deba5 Merge pull request #1956 from syranide/ffenter
Improve normalization of charCode, fix FF not reporting Enter
2014-07-31 15:11:09 -07:00
Andreas Svensson
b83076468d Improve normalization of charCode, fix FF not reporting Enter 2014-07-31 22:00:23 +02:00
Paul O’Shannessy
ab2406ffec Merge pull request #1885 from syranide/testinnerhtml
Use faster cached regexps for tests in setInnerHTML
2014-07-31 11:44:21 -07:00
Ben Alpert
3acb5f84b3 Merge pull request #1960 from julen/docs/setState
Docs: added note about setState() side-effects
2014-07-31 00:33:53 -07:00
Julen Ruiz Aizpuru
1219663e9a Docs: added note about setState() side-effects 2014-07-31 09:31:01 +02:00
Paul O’Shannessy
db6e07e87d Merge pull request #1827 from syranide/jsxstrict
JSXTransformer, stricter parsing of script type
2014-07-30 21:39:37 -07:00
Paul O’Shannessy
62a336f9ab Update CONTRIBUTING.md 2014-07-30 13:09:23 -07:00
Vjeux
aed0931f9a update background color for image 2014-07-30 21:09:17 +02:00
Vjeux
76c3d7c647 fix spurious ) 2014-07-30 21:09:17 +02:00
Vjeux
9f5403b18c Include image 2014-07-30 19:31:16 +02:00
Vjeux
10bcfdf1f7 Flux blog post about dispatcher 2014-07-30 19:12:21 +02:00
Paul O’Shannessy
61c8b2a6e8 Merge pull request #1961 from knuton/patch-1
Fix typo
2014-07-30 10:04:24 -07:00
Johannes Emerich
52143700e8 Fix typo 2014-07-30 15:38:19 +02:00
Sébastien Lorber
d0d15a3a3c Update 09.2-form-input-binding-sugar.md -> better checkedLink documentation 2014-07-30 11:17:38 +02:00
Paul O’Shannessy
590e5057bc Merge pull request #1759 from spicyj/gh-1698
Use setImmediate to defer value restoration
2014-07-29 20:15:59 -07:00
Paul O’Shannessy
0a1c5dad67 Merge pull request #1758 from spicyj/setimmediate
Add ReactUpdates.setImmediate for async callbacks
2014-07-29 20:15:31 -07:00
Paul O’Shannessy
45c719942e Merge pull request #1854 from syranide/floatfix
cssFloat is only accessible as styleFloat on IE8
2014-07-29 13:00:20 -07:00
Sébastien Lorber
b9a0c27914 Update 09.2-form-input-binding-sugar.md
Add better explanation for 2-way data binding to checkboxes using `checkedLink`. As mentionned here: https://github.com/facebook/react/issues/1930
2014-07-29 16:14:27 +02:00
Andreas Svensson
ffafae5cfe cssFloat is only accessible as styleFloat on IE8 2014-07-29 10:15:01 +02:00
Paul O’Shannessy
90df0ea8bd Merge pull request #1951 from JedWatson/patch-1
Adding "Tutorial" label to Flux Todo List nav item
2014-07-28 21:57:16 -07:00
Jed Watson
bfd0a53d3e Updating "Tutorial" label as per suggestion 2014-07-29 12:20:15 +10:00
Jed Watson
2e6ff6449b Adding "Tutorial" label to Flux Todo List nav item 2014-07-29 10:54:22 +10:00
Christopher Chedeau
2822d63df2 Rename "Ice Lab studio" to "Icelab" 2014-07-28 11:48:25 +02:00
Christopher Chedeau
ba76ba8d4b Merge pull request #1944 from shaneosullivan/patch-3
Fix small language nits
2014-07-28 11:46:55 +02:00
Ben Alpert
8cb2812cff Merge pull request #1941 from divad12/animating-one-or-zero-items-docs
Clarify animating one or zero items in animation docs
2014-07-27 16:05:24 -07:00
Shane O'Sullivan
460ca72abb Update 2014-07-28-community-roundup-20.md 2014-07-27 14:16:59 -07:00
Shane O'Sullivan
b606dac461 Fix small language nits 2014-07-27 13:44:47 -07:00
Ben Alpert
673e228af9 Merge pull request #1943 from shaneosullivan/patch-1
Fix typo for 'fundations'
2014-07-27 13:30:12 -07:00
Shane O'Sullivan
0c4b2728c8 Fix typo for 'fundations' 2014-07-27 13:29:12 -07:00
Ben Alpert
e30b60cc58 Wording tweaks to community roundup 2014-07-27 13:06:20 -07:00
Christopher Chedeau
88d0c81680 Merge pull request #1942 from LoukaN/roundup_20
Community Round-up #20
2014-07-27 14:19:55 +02:00
Vjeux
75ee7d05bb Community Round-up #20 2014-07-27 13:55:20 +02:00
David Hu
721f397303 Clarify animating one or zero items in docs
When I first read these docs, it was not immediately clear to me that I could
use `React.addons.CSSTransitionGroup` to animate a single item coming into view,
or an item replacing an item already there. This was partly due to the example
which rendered a list of items.

This PR adds a blurb about being able to use
`React.addons.CSSTransitionGroup` with one or zero items, provides a code
example, and adds a note blockquote that a `key` attribute must always be
provided on each child of `React.addons.CSSTransitionGroup`. The latter point
was not immediately obvious from the original `TodoList` code example, since it
renders a list which would normally require `key` attributes anyway.

Test Plan:
- Refreshed `http://localhost:4000/react/docs/animation.html`, saw that the
  docs additions rendered correctly.
- Example code not tested (it was extracted from working code).
2014-07-27 00:26:17 -07:00
Sebastian Markbage
c6b2687bbd Partially revert React.createDescriptor
We still have some issues to work out when the type argument is a mock.
2014-07-25 16:48:10 -07:00
Paul O’Shannessy
d526456951 Delete ImmutableObject-test.js
Our syncing doesn't update these tests so just remove them.
2014-07-25 16:47:48 -07:00
Cheng Lou
aed2d86e7b Merge pull request #1929 from zertosh/master
ReactTransitionChildMapping comment typo
2014-07-25 16:38:55 -07:00
Paul O’Shannessy
631705f31d v0.11.1 release materials, update to 0.11.0 release materials
* 0.11.1 blog post, changelog
* Update to 0.11.0 post, changelog
* Update version in site, add starter kit
2014-07-25 12:59:56 -07:00
andres suarez
1961fecf2d ReactTransitionChildMapping comment typo 2014-07-25 09:03:51 -04:00
Cheng Lou
af21aeb59f Merge pull request #1924 from spicyj/autobind-bind
Use .bind when autobinding
2014-07-25 01:34:15 -07:00
Paul O’Shannessy
eb8f766005 [docs] increase base font-weight
Closes #1926
2014-07-24 21:01:20 -07:00
Cheng Lou
7f584f3a49 Merge pull request #1511 from syranide/strsidefx
HAS_SIDE_EFFECTS should compare by type-casting
2014-07-24 13:38:01 -07:00
Paul O’Shannessy
f76d4dd48f Merge pull request #1770 from eins78/master
Also list <form> in error message as possible culprit
2014-07-24 12:53:19 -07:00
Ben Alpert
f1508c4937 Use .bind when autobinding
This eliminates all of the `boundMethod` frames from call stacks when debugging and as far as I know should behave the same otherwise.

Test Plan: jest
2014-07-24 12:11:19 -07:00
Andreas Svensson
3b94abcb3b HAS_SIDE_EFFECTS properties must compare as property type 2014-07-24 11:53:02 +02:00
Paul O’Shannessy
efdc5da097 Merge pull request #1903 from syranide/ie8nmlb
Remove empty TextNode left behind by IE8 setInnerHTML workaround
2014-07-23 18:40:35 -07:00
Cheng Lou
b0945b16cc Merge pull request #1560 from spicyj/simplify-lifecycle
Simplify composite lifecycle state
2014-07-23 18:02:39 -07:00
Andreas Svensson
8a135c0e75 Remove empty TextNode left behind by IE8 setInnerHTML workaround 2014-07-23 21:52:56 +02:00
Paul O’Shannessy
13e2c38a01 Merge pull request #1865 from syranide/modistatefalse
getModifierState should always return a boolean
2014-07-23 10:12:49 -07:00
Andreas Svensson
030071dd8b getModifierState should always return a boolean 2014-07-23 10:01:22 -07:00
Cheng Lou
79076fad9c Merge pull request #1774 from syranide/ie8focusthrow
Fix IE8 potentially throwing during restoreSelection
2014-07-22 16:29:07 -07:00
Paul O’Shannessy
6d02e04672 Merge pull request #1879 from syranide/modistatewrong
getModifierState incorrectly exposed as SyntheticMouseEvent.getEventModifierState
2014-07-22 15:50:15 -07:00
Paul O’Shannessy
2ba254af70 Merge pull request #1909 from zpao/move-react-source
Move react-source gem out of project root
2014-07-22 15:34:50 -07:00
Paul O’Shannessy
520c4f96d4 Move react-source gem out of project root
Now it requires a build step. At least the confusing lib directory is
gone though.
2014-07-21 22:56:32 -07:00
Ben Alpert
354fb44299 Use setImmediate to defer value restoration
Depends on #1758.

Fixes #1698.

Previously, controlled components would update too soon when using something like ReactLayeredComponentMixin (i.e., before the layer's updates could propagate from the parent), causing the cursor to jump even when always updating the new model value to match the DOM state. With this change, we defer the update until after all nested updates have had a chance to finish, which prevents the cursor from misbehaving.

Also cleaned up the logic around updating a bit -- the .value and .checked updates in ReactDOMInput weren't being relied on at all so I removed them and opted for a simple forceUpdate instead. I also got rid of _isChanging which hasn't been necessary since the introduction of update batching.

Test Plan: Tested the example in http://jsfiddle.net/Bobris/ZZtXn/2/ and verified that the cursor didn't jump. Changed the code to filter out numbers and verified that the field prevents typing numbers (attempting to do so still causes the cursor to jump to the end). Also verified that controlled and uncontrolled radio buttons, textareas, and select boxes work.
2014-07-21 22:42:18 -07:00
Ben Alpert
12b532c253 Add ReactUpdates.setImmediate for async callbacks
Callbacks passed to this setImmediate function are called at the end of the current update cycle, which is guaranteed to be asynchronous but in the same event loop (with the default batching strategy).

This is useful for new-style refs (#1373, #1554) and for fixing #1698.

Test Plan: jest
2014-07-21 22:41:00 -07:00
Paul O’Shannessy
520d73d73c Merge pull request #1908 from spicyj/simpler-server-willmount
Simpler way to prevent flushing updates on server
2014-07-21 21:42:07 -07:00
Ben Alpert
6259d88f03 Simpler way to prevent flushing updates on server
Test Plan: Only failing tests in jest are immutable tests that were already failing.
2014-07-21 17:25:52 -07:00
Paul O’Shannessy
04e341936c Include Object.assign polyfill
This isn't a good final solution but it makes React actually usable on
its own.

This also makes tests runnable, though only via jest
(./node_modules/.bin/jest)
2014-07-21 16:18:12 -07:00
Paul O’Shannessy
4bb7b70b28 Merge pull request #1892 from thauburger/patch-1
Remove _addPromise from Dispatcher code example
2014-07-21 15:55:41 -07:00
Cheng Lou
af72d9f37f Merge pull request #1891 from robarnold/patch-1
Fix small issue in ReactContext comment
2014-07-21 14:47:07 -07:00
WickyNilliams
ee325eb5d5 follow docs convention for notes 2014-07-21 17:11:40 +01:00
Cheng Lou
d210269985 Merge pull request #1882 from glenjamin/patch-1
Note how to access Perf in docs
2014-07-20 11:45:24 -07:00
Ben Alpert
76d2ebdf74 Merge pull request #1893 from chenglou/docs-bar
[Docs] Add recent addons to addons.html; tweak wording
2014-07-20 01:16:52 -07:00
Cheng Lou
d95a4ef983 [Docs] Add recent addons to addons.html; tweak wording
Add PureRenderMixin and Perf to this page. Also, I think it's better if the link titles reflect the name used by these addons.
2014-07-20 00:59:19 -07:00
Tom Hauburger
c94bb20cb8 Remove _addPromise from Dispatcher code example
`_addPromise` is not used in the provided Dispatcher example, nor does it exist in Dispatcher.js found here: https://github.com/facebook/react/blob/master/examples/todomvc-flux/js/dispatcher/Dispatcher.js
2014-07-19 19:52:33 -07:00
robarnold
83e5e9bedf Fix small issue in ReactContext comment
Noticed this the other day and meant to fix it.
2014-07-19 19:09:35 -07:00
Andreas Svensson
0efe8ca362 JSXTransformer, stricter parsing of script type 2014-07-20 01:20:30 +02:00
Ben Alpert
93712246c8 Reword sentence in reconciliation docs 2014-07-19 14:44:16 -07:00
Andreas Svensson
6950a8418c Use faster cached regexps for tests in setInnerHTML 2014-07-19 21:00:35 +02:00
Glen Mailer
83fd5583bf Note how to access Perf in docs 2014-07-19 16:14:27 +01:00
Andreas Svensson
6f0db65777 getModifierState incorrectly exposed as SyntheticMouseEvent.getEventModifierState 2014-07-19 10:44:11 +02:00
Sebastian Markbage
c419cce5c9 Move defaultProps resolution to the descriptor factory
Moves the defaultProps resolution to the descriptor factory.
2014-07-18 22:01:36 -07:00
Sebastian Markbage
3a7dbe6b73 Deprecate transferPropsTo 2014-07-18 22:01:36 -07:00
Paul O'Shannessy
de711efcc9 When proxying statics functions, copy properties
Port of 076047012a which went in
externally before ReactLegacyDescriptor happened, so it needed to be
ported.
2014-07-18 22:01:36 -07:00
Ben Newman
23c5332208 Fix ReactTestUtils.mockComponent so that mockTagName is not ignored.
The `mockTagName` parameter was always optional, and so probably was not
used very often. If you tried to use it, it would be shadowed by the
`var mockTagName` declaration in the `render` method, so only
`module.mockTagName` or `"div"` were ever possible values.
2014-07-18 22:01:36 -07:00
Ben Newman
2347abf75c Don't call window.getSelection when it isn't defined.
Sadly, jsdom does not support `window.getSelection` yet, but
`ExecutionEnvironment.canUseDOM` is `true` in a jsdom environment.
2014-07-18 22:01:36 -07:00
Sebastian Markbage
3818656f70 Use Object.assign in merge/mergeInto
Relax the argument type checks. Currently we throw for non-objects and terminals
but Object.assign does a coercion to Object instead. It also allows merging
Arrays as if they are objects.

This also relaxes the check for dependents such as ImmutableObject. This sucks
but it will allow us to use a fast code path to native Object.assign.

We always have the option of adding warnings to Object.assign or static type
checks.

I'm keeping the null check. Object.assign throws for null checks.

We'll also start returning the result of coercions just like Object.assign.
2014-07-18 22:01:36 -07:00
Sebastian Markbage
225d76f772 Drop transferPropsTo usage in React core
These were completely unnecessary uses of transferPropsTo.
2014-07-18 22:01:36 -07:00
Ben Newman
66cdba3dfb Avoid leading spaces when first argument to joinClasses is falsy.
This detail is going to become more important once the idiom
`className={joinClasses(this.props.className, newClass)}` becomes more
common, as it will when we move away from `this.transferPropsTo`.
2014-07-18 22:01:36 -07:00
Sebastian Markbage
5aab0bddaa Move key/ref off props and prepare for new descriptor factories
Breaking changes

- key/ref are no longer accessible on props but they are accessible on the
  descriptors. This means that parents/owners can access it but not the
  component itself.

- Descriptor factories are now plain functions and you can't rely on the
  prototype or constructors of descriptors to identify the component type.

Existing descriptor factories are now wrapped in a legacy factory. Currently it
does nothing but it will give us a hook to track callers to factories that are
not using JSX but just invoking the function directly. It also proxies static
methods/properties to the underlying class. The newer factories don't have this
feature.

ReactTextComponent has it's own little factory because it's props is not an
object. This is a detail and will go away once ReactTextComponent no longer
needs descriptors.
2014-07-18 22:01:36 -07:00
Paul O’Shannessy
06e6313a72 Merge pull request #1876 from petehunt/fix-jsxt2
Fix JSXTransformer
2014-07-18 20:07:49 -07:00
petehunt
e8efa2a1e9 Fix browser-tranforms 2014-07-18 19:02:31 -07:00
Paul O’Shannessy
9929f6de1e Merge pull request #1870 from spicyj/gh-1866
Don't initialize reconcile transaction on server
2014-07-18 16:40:03 -07:00
Paul O’Shannessy
8439deadd0 Merge pull request #1869 from syranide/modistatecase
getModifierState is case sensitive
2014-07-18 16:13:34 -07:00
Ben Alpert
54d91c293d Don't initialize reconcile transaction on server
...when calling setState from within a componentWillMount. Fixes #1866.

Test Plan: jest
2014-07-18 11:03:34 -07:00
Paul O’Shannessy
f367785a78 Merge pull request #1837 from garrensmith/update-todo-example
Update Todo MVC example
2014-07-18 10:56:21 -07:00
Andreas Svensson
495d866a66 getModifierState is case sensitive 2014-07-18 18:24:11 +02:00
Nick Williams
48006b0e63 Add note about key prop being excluded by cloneWithProps
Whilst this is intentional behaviour (see #1274), it is not documented anywhere, so it is worth mentioning.

It would also be nice if React issued a warning to console if a cloned component loses its key (as this will silently break reconciliation?)
2014-07-18 16:14:55 +01:00
Garren Smith
0c4be5a8f9 Update Todo MVC example
A small patch for the Todo MVC example to use React 0.11.0.
This then allows the `MainSection` to return `null` instead of
previous `<noscript/>`.
2014-07-18 10:51:43 +02:00
James Seppi
6d1ede34df fix typo
Closes #1859.
2014-07-17 15:58:33 -07:00
Ben Alpert
9698b54dfe Merge pull request #1860 from KyleAMathews/patch-3
Not a candidate anymore
2014-07-17 15:22:04 -07:00
Ben Alpert
384e8fe195 Fix appearance of video thumbnail 2014-07-17 15:19:58 -07:00
Kyle Mathews
bd5e8aa076 Update 2014-07-17-react-v0.11.md 2014-07-17 15:18:41 -07:00
Ben Alpert
d39b8078a3 Merge pull request #1835 from amm385/patch-1
Update videos.md
2014-07-17 15:15:11 -07:00
Paul O’Shannessy
5bfee601ce Bump version for 0.12.0-alpha
[skip ci]
2014-07-17 14:22:50 -07:00
Paul O’Shannessy
8814ee2065 Release materials for 0.11 2014-07-17 14:18:28 -07:00
Ben Alpert
11e0e5ae44 Performance boost in some cases 2014-07-17 13:43:43 -07:00
Paul O’Shannessy
5f77e6dc51 Upgrade commoner dependency
0.9.5 depended on Node 0.11+, so make sure we don't ever get that.
See https://github.com/reactjs/commoner/pull/65
2014-07-17 12:59:53 -07:00
Ben Alpert
6ee9aa773d Remove stale deprecation note from unmounting docs 2014-07-16 23:22:54 -07:00
Ben Alpert
ba5c7ff507 Add React.Children.count docs 2014-07-16 23:19:45 -07:00
Paul O’Shannessy
0fdd98f0d4 Update authors/acknowledgements [skip ci] 2014-07-16 15:14:49 -07:00
Paul O’Shannessy
c21678f9bc Merge pull request #1818 from chenglou/docs-apply
[Docs] Update addons.update
2014-07-16 14:17:47 -07:00
Paul O’Shannessy
bb6087848d Merge pull request #1821 from chenglou/docs-addons-perf
[Docs] Perf tools
2014-07-16 14:17:30 -07:00
Paul O’Shannessy
62a4ac0f4d Merge pull request #1840 from spicyj/statics-proptypes
When proxying statics functions, copy properties
2014-07-16 13:07:56 -07:00
Ben Alpert
121529bdfd Add "Edit on GitHub" link on docs pages
Ember's docs do this and I rather like the idea of encouraging people to make improvements.
2014-07-16 11:17:00 -07:00
Felix Gnass
5f56f4ac36 add picture to xjs.knownTags 2014-07-16 19:57:19 +02:00
Felix Gnass
33bd509737 add picture element and related attributes 2014-07-16 13:19:55 +02:00
Ben Alpert
dd3167edc9 Reorder reference pages
This order should make more sense; it moves important functions like React.renderComponent up and deprecated/discouraged ones like transferPropsTo and setProps down. No content changes.
2014-07-15 23:03:37 -07:00
Ben Alpert
abb95eed5c Fix comma splice 2014-07-15 22:34:33 -07:00
Paul O’Shannessy
5ea3ff64b6 Merge pull request #1842 from spicyj/jstransform-visitors
Add new jstransform visitors to JSX transform
2014-07-15 16:36:14 -07:00
Ben Alpert
f02264cf83 Add destructuring visitor to JSX harmony transform 2014-07-15 16:34:00 -07:00
Ben Alpert
076047012a When proxying statics functions, copy properties
Test Plan: jest
2014-07-15 15:09:16 -07:00
Cheng Lou
12750ad749 [Docs] Perf tools
Fixes #1814.
@petehunt @joshduck
The images look blurry (taken on retina then shrank down to 50%...)
2014-07-15 11:17:21 -07:00
Paul O’Shannessy
e85e5e9952 Merge pull request #1817 from chenglou/docs-PureRenderMixin
[Docs] Document PureRenderMixin addon
2014-07-15 11:09:16 -07:00
Ben Alpert
76496b3cca Add note about higher/lower-level transition APIs 2014-07-14 21:41:07 -07:00
Cheng Lou
8ebadf1591 [Docs] Update addons.update
Fixes #1815.
Add the new `$apply` command, plus a few examples.

@petehunt
2014-07-14 17:59:22 -07:00
Areeb Malik
28ed79c2ce Update videos.md
reordering to spot #4
2014-07-14 17:31:56 -07:00
Areeb Malik
afe30ad8ee Update videos.md
Adding video for my recent talk in London about using React in large scale applications
2014-07-14 17:16:44 -07:00
Ben Alpert
7b872cd781 Merge pull request #1813 from baddox/patch-2
Verb agreement grammar fix
2014-07-14 17:08:43 -07:00
Ben Alpert
c26c2d42ac Merge pull request #1812 from baddox/patch-1
Add possessive to fix grammar
2014-07-14 17:07:10 -07:00
Mouad Debbar
97dbada03d Up-to-date React.Children
Make sure we actually include `.count`
2014-07-14 15:01:44 -07:00
Andreas Svensson
f8ccc2186f Fix IE8 potentially throwing during restoreSelection 2014-07-14 21:07:56 +02:00
Ray
bea24ca944 fix some translation bug 2014-07-14 20:25:07 +08:00
Ray
8758addb41 add translation for 02-displaying-data.md and change next link in 01-why-react.zh-CN.md 2014-07-14 20:13:33 +08:00
Ben Alpert
65b2232f34 Fix typo-ed "of" 2014-07-13 13:09:50 -07:00
Ben Alpert
4a66260b2c Make code in headers not giant 2014-07-13 13:03:12 -07:00
Paul O’Shannessy
b8cc3f510a 0.11-rc blog post 2014-07-13 12:54:41 -07:00
Paul O’Shannessy
ab690586d3 Consolas > Courier New for monospace docs font [skip ci] 2014-07-13 12:26:28 -07:00
Paul O’Shannessy
0f9cec2e78 0.11.0-rc1 2014-07-12 19:50:45 -07:00
Paul O’Shannessy
ec7de52a8f Merge pull request #1825 from zpao/jsx-sourcemap
Add support for inline sourcemaps in jsx executable
2014-07-12 19:50:01 -07:00
Paul O’Shannessy
fc3a3801de Add support for inline sourcemaps in jsx executable
--source-map-inline
2014-07-12 19:49:11 -07:00
Paul O’Shannessy
87c8e69fca Bump dependencies that are known safe
Most of these would have been installed anyway, just making sure what
got shrinkwrapped is what others would experience.
2014-07-12 19:09:00 -07:00
Cheng Lou
8f909233c9 [Docs] Document PureRenderMixin addon
Fixes #1816
2014-07-12 14:56:43 -07:00
Ben Alpert
92d2dcc25f Revert "Add helpful message about pooled classes"
This reverts commit e65f17b86c. This might have a perf impact so we're not going to go with it for now.
2014-07-11 16:00:58 -07:00
Paul O’Shannessy
4526f627f2 Simplify shouldComponentUpdate example [skip ci] 2014-07-11 15:32:48 -07:00
Ben Alpert
a47a6ab1d1 Rewrap tags/attributes lists 2014-07-11 15:23:51 -07:00
Cheng Lou
b38518ff4d [Docs] Better README for react-tools 2014-07-11 15:09:22 -07:00
Paul O’Shannessy
165cb5f70f Merge pull request #1783 from avanderhoorn/patch-1
Update React-tools to support transform as object
2014-07-11 15:00:04 -07:00
Ben Alpert
b14ae9b615 Update AUTHORS and acknowledgements again 2014-07-11 14:51:56 -07:00
Ben Alpert
7e44894219 Tweak wording a bit on renderComponent note 2014-07-11 14:50:46 -07:00
Ben Alpert
694a952d26 Merge pull request #1799 from julen/patch-1
Added note about `renderComponent()` requirement
2014-07-11 14:48:37 -07:00
Ben Alpert
47d3339e1b Don't copy todomvc-flux into starter kit
Test Plan: Ran `grunt release:starter` and looked in build/starter/ to see all the examples but not todomvc-flux.
2014-07-11 14:35:10 -07:00
Ben Alpert
c64df89ecf Fix up getDefaultProps docs 2014-07-11 14:26:42 -07:00
Ben Alpert
a4374c4f74 Update acknowledgements page from AUTHORS 2014-07-11 14:15:53 -07:00
Ben Alpert
d101e2ef30 Update AUTHORS 2014-07-11 14:10:46 -07:00
Paul O’Shannessy
2b0e51bdba Add String.prototype.trim to polyfill check
Also shortens the URL so it fits on 1 line
2014-07-11 10:36:38 -07:00
Paul O’Shannessy
28d94d2dcf Fix react-dislayName-test
[skip ci]
2014-07-11 10:36:07 -07:00
Anthony van der Hoorn
8c1ce8f9c3 Update sourceMap to return .toJSON() output
This means we get a data object back rather than a SourceMapGenerator
2014-07-11 08:44:02 -04:00
Anthony van der Hoorn
b8582b8d1c Refactor transformAsObject to transformWithDetails
This matches current best thinking.
2014-07-11 08:38:28 -04:00
Thomas Shaddox
0d7184f0db Verb agreement grammar fix 2014-07-11 02:57:21 -07:00
Thomas Shaddox
4477e69d52 Add possessive to fix grammar 2014-07-11 02:52:17 -07:00
Julen Ruiz Aizpuru
e0c0e20b49 Docs: added note about renderComponent() requirement 2014-07-11 08:37:44 +02:00
Ben Alpert
774f5a022e tutorial: Fetch data in componentDidMount instead
In a world where this component was server-rendered, we wouldn't want to call the data-fetching code there so it makes more sense to have it in componentDidMount.
2014-07-10 22:33:09 -07:00
Paul O’Shannessy
cd1adc5303 Merge pull request #1796 from enguerran/footer
fix the disappearing footer on the todomvc-flux sample
2014-07-10 20:41:25 -07:00
Paul O’Shannessy
55b7c387da Update supported elements and properties [skip ci] 2014-07-10 20:04:37 -07:00
Paul O’Shannessy
d8aa1c3612 Update polyfills list in docs [skip ci]
Fixes #1744
2014-07-10 17:14:25 -07:00
Paul O’Shannessy
0d8aa8ff65 Update AUTHORS for 0.11 [ci skip] 2014-07-10 14:49:00 -07:00
Paul O’Shannessy
9e582661e3 Merge pull request #1802 from zpao/jsxtransformer-cleanup
Jsxtransformer cleanup
2014-07-09 13:28:49 -07:00
Paul O’Shannessy
31a025a667 Add docblocks and consistent styling to JSXTransformer 2014-07-09 12:51:46 -07:00
Paul O’Shannessy
61d495422d Merge pull request #1801 from zpao/jsxtransformer-sourcemaps
Fix sourcemaps in JSXTransformer for Firefox
2014-07-09 12:49:31 -07:00
Paul O’Shannessy
336890291e Fix sourcemaps in JSXTransformer for Firefox
Fixes #1725
2014-07-09 12:48:02 -07:00
Enguerran
0d481c69a5 another way to fix the footer that is not shown 2014-07-09 10:39:14 +02:00
Paul O’Shannessy
9d5ab297d2 Merge pull request #1784 from wvl/package-built-source-with-npm
Add the built source to npm package. See #1699
2014-07-08 19:22:53 -07:00
Paul O’Shannessy
897b423e0e Merge pull request #1797 from spicyj/transition-group-names
Add displayName to ReactTransitionGroup + friends
2014-07-08 14:40:34 -07:00
Paul O’Shannessy
49c476e1e6 Merge pull request #1786 from zpao/react-tools-readme
Custom readme for react-tools
2014-07-08 14:20:36 -07:00
Ben Alpert
734a345257 Add displayName to ReactTransitionGroup + friends
Fixes facebook/react-devtools#42.

Test Plan: Crossed fingers.
2014-07-08 12:18:46 -07:00
Max F. Albrecht
bcea3bee45 Also list <form> in error message as possible culprit 2014-07-08 14:08:17 +02:00
Enguerran
745082c0ac fix the disappearing footer on the todomvc-flux sample 2014-07-08 11:59:07 +02:00
Paul O’Shannessy
785d2cabef Merge pull request #1793 from monsanto/browserify-note
Add a note about production mode for npm installs.
2014-07-07 21:56:51 -07:00
Christopher Monsanto
39ac88595d Remove mention of envify since it is listed in package.json 2014-07-07 15:00:47 -04:00
Anthony van der Hoorn
5c4e451054 Abstracted out common code into innerTransform
As per feedback brought common logic from both `transform` and `transformAsObject` into its own `innerTransform` function.
2014-07-06 16:23:50 -04:00
Christopher Monsanto
9ddb4d4a78 Add a note about production mode for npm installs. 2014-07-05 20:52:42 -04:00
Paul O’Shannessy
5c85f33184 Custom readme for react-tools
Of course this means I can no longer just npm publish from the project
root, but I haven't been anyway.
2014-07-03 17:39:33 -07:00
Wayne Larsen
c1c8ad8e53 Add the built source to npm package. See #1699 2014-07-03 18:21:22 -04:00
Cheng Lou
e10d10e31e Merge pull request #1531 from spicyj/two-face
Give useful error when using two copies of React
2014-07-03 14:45:23 -07:00
Ben Alpert
70bf3e1306 Give useful error when using two copies of React
If we don't error here, we end up with a confusing error later on in this.getDOMNode() where ReactMount doesn't have the proper container registered in its object.
2014-07-03 14:20:31 -07:00
Andrew Zich
559eb89965 make invariant show formatted actual errors in all unminified environments
Because we can have !__DEV__ but unminified, we still want to see the
message in those cases.
2014-07-03 13:53:41 -07:00
Cheng Lou
e8e08127c5 Merge pull request #1461 from spicyj/no-esc-slash
Don't escape slash; it's unnecessary
2014-07-03 11:05:16 -07:00
Paul O’Shannessy
676aac13d0 Update npm dependencies [skip ci] 2014-07-03 09:57:12 -07:00
Anthony van der Hoorn
4ecde425f9 Update React-tools to support transform as object
This change adds an additional function to the exported object to support getting access to the transformed result as an object rather than just a string result - the separate function designed to maintain backwards compatibility. 

This facilitates tools that want the code separate from the sourcemap or anything else as time goes by.
2014-07-03 08:20:55 -04:00
Paul O’Shannessy
12479d3d20 Merge pull request #1780 from jbrantly/issue-1292
Fixing grunt jsx task in Windows
2014-07-02 17:41:18 -07:00
Cheng Lou
7a27d43020 Merge pull request #1779 from spicyj/spell-gram
Fix spelling/grammar in test comment
2014-07-02 15:13:36 -07:00
jbrantly
9e60afdc31 Fixing grunt jsx task in Windows
Spawning node directly instead of relying on shebang in the jsx-internal script

Fixes #1292
2014-07-02 17:26:40 -04:00
Ben Alpert
c8d9957f68 Fix spelling/grammar in test comment 2014-07-02 14:09:38 -07:00
Ben Alpert
a02b6b3d7f Clarify when getDefaultProps is called
Fixes #1778.
2014-07-02 14:06:48 -07:00
Yuval Dekel
40b522c498 Give context for owners of compenent instantiations with propType errors
See modification to the test-file: Basically we add a small hint at the end
of the error warning for propType errors to help identify which instantiation
of the component at hand is faulty.
2014-07-02 12:47:26 -07:00
Paul O’Shannessy
17aef05d75 Stop running so many things in travis
We're not actively looking at most of these and they take up valuable
job time.
2014-07-01 18:11:34 -07:00
Paul O'Shannessy
a4e5327b76 Remove jest usage in ReactDescriptorTest
Until we're only using jest on github, we should stick with Jasmine spies. Soon, hopefully.
2014-06-30 20:55:19 -07:00
Paul O'Shannessy
022e44c95b Cleanup ReactChildren 2014-06-30 20:55:09 -07:00
Guangqiang Dong
1aa9cc6a8b add count() method to ReactChildren
added ReactChildren.count() to count the number of children, and a test case.
2014-06-30 20:54:57 -07:00
Paul O'Shannessy
5b17e75707 Support more properties for image maps
Supporting the `<area>` tag is pretty useless if we don't support the necessary properties.
2014-06-30 20:54:44 -07:00
Paul O’Shannessy
5eb57fa51b Add support to JSX transform for <hyphenated-tags>
This only adds support for whitelisted tags, not arbitrary ones.

Closes #1539
2014-06-30 20:54:41 -07:00
Cheng Lou
3e5c606f3f Merge pull request #1750 from protron/patch-1
Fix to sample code for href in ReactPropTypes
2014-06-30 17:14:58 -07:00
Paul O’Shannessy
dc8ec2fab1 Cache node_modules on Travis
This isn't actually enabled yet for public projects, but this will help
us speed up builds when it does get enabled.

http://docs.travis-ci.com/user/caching/
2014-06-30 14:19:24 -07:00
Ben Alpert
94fd726f86 Merge pull request #1767 from jgebhardt/fixlink
fix link in community roundup #18
2014-06-30 10:48:29 -07:00
Jonas Gebhardt
a8e273f844 fix link in community roundup #18 2014-06-30 10:41:42 -07:00
Ben Alpert
5a0eee3bb6 Merge pull request #1765 from chenglou/docs-tut-again
[Docs] Fix tutorial line highlights, revert ajax in cb
2014-06-30 01:02:29 -07:00
Cheng Lou
66d6e3f391 [Docs] Fix tutorial line highlights, revert ajax in cb 2014-06-30 01:01:48 -07:00
Cheng Lou
108efb4add Merge pull request #1763 from chenglou/docs-tut
[Docs] Put tutorial up-to-date with the code
2014-06-29 21:50:42 -07:00
Cheng Lou
58a463f01c [Docs] Put tutorial up-to-date with the code 2014-06-29 21:46:16 -07:00
Cheng Lou
546bf0ed74 Merge pull request #1760 from spicyj/docs-harmony
Add --harmony option to live JSX compiler page
2014-06-28 17:32:57 -07:00
Ben Alpert
ba67bf1b0d Add --harmony option to live JSX compiler page 2014-06-28 17:29:30 -07:00
Ben Alpert
cb20dec85f Simplify composite lifecycle state
We now forbid calling setState or forceUpdate if any component's render function is higher in the stack, not just the component you're trying to update. (We do this already now for React.renderComponent and React.unmountComponentAtNode.)

This also has the advantage that we can now remove CompositeLifeCycle.RECEIVING_STATE, making _compositeLifeCycleState easier to reason about (not to mention that RECEIVING_STATE was a confusing name) and making it possible to remove a try/finally from the render path which might help with perf.
2014-06-28 01:04:04 -07:00
Mariano Desanze
bb1a31930b Wrapped line to 80 chars in ReactPropTypes sample 2014-06-28 04:33:45 -03:00
Ben Alpert
bc11793c04 Fix code style in TodoMVC Flux example 2014-06-27 22:16:42 -07:00
Paul O’Shannessy
8dcad5e09c Merge pull request #1622 from gebrits/patch-1
Update todo example. fixes 'Create' that shouldn't happen
2014-06-27 17:57:01 -07:00
Cheng Lou
5ba3911929 [Blog] Update round-up #19 to include more credit 2014-06-27 10:00:41 -07:00
Mariano Desanze
9854be2e46 Fix to sample code for href in ReactPropTypes
Error should be thrown in the previous condition is "not" meet. And the href propType is described as optional in the comment, but the null check was missing.
2014-06-27 11:50:03 -03:00
Sebastian Markbage
ef67406272 Add simple React.createDescriptor hook
This is the minimal runtime change we need to switch the JSX syntax to resolve
to React.createDescriptor(...)
2014-06-26 15:42:18 -07:00
Sebastian Markbage
d0719a5ea4 Preparing to move defaultProps resolution and type validation to the descriptor
This copies the propType and contextType validation to a wrapper around the
descriptor factory. By doing the validation early, we make it easier to track
down bugs. It also prepares for static type checking which should be done at the
usage site.

This validation is not yet active and is just logged using monitorCodeUse. This
will allow us to clean up callsites which would fail this new type of
validation.

I chose to copy the validation of abstracting it out since this is just an
intermediate step to avoid spamming consoles. This makes more a much cleaner
diff review/history. The original validation in the instance will be deleted as
soon as we can turn on the warnings.

Additionally, getDefaultProps are moved to become a static function which is
only executed once. It should be moved to statics but we don't have a
convenient way to merge mixins in statics right now. Deferring to ES6 classes.

This is still a breaking change since you can return an object or array from
getDefaultProps, which later gets mutated and now the shared instance is
mutated. Mutating an object that is passed into you from props is highly
discouraged and likely to lead to subtle bugs anyway. So I'm not too worried.

The defaultProps will later be resolved in the descriptor factory. This will
enable a perf optimizations where we don't create an unnecessary object
allocation when you use default props. It also means that ReactChildren.map
has access to resolved properties which gives them consistent behavior whether
or not the default prop is specified.
2014-06-26 15:40:12 -07:00
Sebastian Markbage
e6134c307e [react jsx transform] Spread attribute -> Object.assign
Add support for spread attributes. Transforms into an Object.assign just
like jstransform does for spread properties in object literals.

Depends on https://github.com/facebook/esprima/pull/22
2014-06-26 15:40:02 -07:00
Paul O’Shannessy
0cf686fe1e Merge pull request #1738 from cassus/master
Add missing markerStart, markerMid, markerEnd SVG attributes
2014-06-26 15:24:30 -07:00
Ben Alpert
991c1c1169 Fix typo in blog post 2014-06-26 15:19:24 -07:00
Paul O’Shannessy
7ec2428611 Merge pull request #1748 from pieterv/community-roundup-19-fix
Change community roundup 19's React Bootstrap author to @stevoland
2014-06-26 15:14:03 -07:00
Pieter Vanderwerff
deb47d5ecc Change community roundup 19's React Bootstrap author to @stevoland 2014-06-27 10:00:10 +12:00
Cheng Lou
dbf41a55a4 {Blog] Community Round-up #19 2014-06-26 13:53:14 -07:00
Paul O’Shannessy
3581a92fc3 Merge pull request #1642 from ryanseddon/trimCSSValues
Correctly trim strings for css properties
2014-06-25 22:02:54 -07:00
Paul O’Shannessy
295da0a795 Merge pull request #1741 from spicyj/mount-unused
Remove unused properties from ReactMount
2014-06-25 21:24:42 -07:00
Ben Alpert
b8ad5a23c6 Remove unused properties from ReactMount
(useTouchEvents lives in EventPluginUtils.)

Test Plan: jest
2014-06-24 22:03:43 -07:00
Cheng Lou
d52bebd07b Merge pull request #1716 from somethingkindawierd/master
Removes value attribute from rendered html of textarea
2014-06-24 19:14:19 -07:00
Paul O’Shannessy
56263c44e8 2 docs fixes.
Fix 404 and extra slash in url
2014-06-24 15:12:19 -07:00
Paul O’Shannessy
2496757364 Simple custom 404 page.
Github doesn't let us handle 404s within a project repository, so we
handle them at the organization level. In order to handle graceully for
specific projects, we're setting up redirects to projects' own 404.html.
2014-06-24 14:11:37 -07:00
Cheng Lou
a0486514a3 Merge pull request #1737 from spicyj/notime
Remove timing metrics from Transaction
2014-06-24 11:02:22 -07:00
Paul O’Shannessy
b018870091 Merge pull request #1664 from spicyj/warn-pooling
Add helpful message about pooled classes
2014-06-24 11:01:21 -07:00
Jon Beebe
e077dd40eb Adds empty onChange handler to textarea test 2014-06-24 07:26:07 -05:00
Cassus Adam Banko
30705f794c Add missing markerStart, markerMid, markerEnd SVG attributes 2014-06-24 11:17:34 +02:00
Dan Abramov
e625b8b234 Warn when using hyphenated style property names 2014-06-24 13:05:52 +04:00
Ben Alpert
1c44b874fc Remove timing metrics from Transaction
No one uses these and they weren't meant to be left in.

Test Plan: jest
2014-06-23 20:32:12 -07:00
Ben Alpert
e65f17b86c Add helpful message about pooled classes
Hopefully this will make fewer people confused at all of the null properties. The string won't wrap nicely so I tried to keep it pithy:

https://s3.amazonaws.com/uploads.hipchat.com/6574/26709/v8vzKAC784QMkX2/upload.png
2014-06-23 14:30:40 -07:00
Cheng Lou
9d5ad77774 [Docs] Render null returns noscript now
Following #1495.
2014-06-23 13:52:09 -07:00
Cheng Lou
f81e213f41 Merge pull request #1495 from syranide/ie8noscript
Fix ReactEmptyComponent disappearing and throwing in IE8
2014-06-23 13:38:36 -07:00
Ryan Seddon
2bff5c5c7e Correctly trim strings for css properties
* If a unitless value is passed with a space it'll return `1 px`
2014-06-23 09:43:50 +10:00
Ben Alpert
14be8f4547 Merge pull request #1731 from cody/master
Fix example for animation
2014-06-22 12:11:11 -07:00
Stefan Dombrowski
c91f95a092 Fix example for animation
* Highlight the correct lines
* Add missing text to button
* Remove unnecessary div
2014-06-22 18:11:51 +02:00
petehunt
c33cceb466 Expose React.addons.Perf 2014-06-20 17:55:48 -04:00
Paul O’Shannessy
f0fc42af77 Merge pull request #1464 from spicyj/style-esc
Don't double-escape style names
2014-06-20 12:12:18 -07:00
Jonas Enlund
0377ec579e Added missing SVG attributes: fill-opacity, font-family, font-size, opacity, stroke-opacity.
Closes #1557
2014-06-20 12:45:31 -04:00
Josh Bassett
11486f1b31 Add 'patternContentUnits' to SVG attributes.
Closes #1702
2014-06-20 12:45:23 -04:00
Nate Hunzaker
3f29d5d6cb Add support for patternUnits attribute.
The patternUnits attribute defines how a pattern's coordinate system is
defined (x, y, width, height). This is particularly important when using
repeatable patterns in SVG. This commit adds this attribute to the lists
of known properties.

Closes #1548
2014-06-20 11:32:31 -04:00
Brandon Bloom
aebb3261ee Add support for SVG ellipse elements.
Closes #1675
2014-06-20 11:29:19 -04:00
Paul O’Shannessy
77150630e2 Merge pull request #1542 from remixz/gh-1420
Add harmony transform support in browser

Fixes #1420. Moved some code around in the merge to account for more
changes in the transform code.

Conflicts:
	vendor/browser-transforms.js
2014-06-20 10:55:06 -04:00
Andreas Svensson
b36e05b0af Fix ReactEmptyComponent disappearing and throwing in IE8 2014-06-20 10:08:49 +02:00
Ben Newman
3c64461383 Merge pull request #1710 from benjamn/fix-tests-broken-by-undefined-window-references
Fix tests broken by undefined `window` references in ReactEventListener.
2014-06-19 15:33:16 -04:00
Ben Newman
4cef56d73b Fix tests broken by undefined window references in ReactEventListener.
This test breakage blames to e1c2d02fdd.
2014-06-19 15:32:45 -04:00
Paul O’Shannessy
cc920a502f Merge pull request #1724 from spicyj/main-nor
Don't export (undefined) React in main.js
2014-06-19 12:21:13 -07:00
Paul O’Shannessy
af1af19d39 Sync out transform tests 2014-06-19 15:14:54 -04:00
Paul O’Shannessy
2c85658c69 [jsx] Make sure we throw when we get XML namespaces
aad8a2b798
replaced XJSIdentifer with XJSNamespacedName for namespaced items, so we
need to adjust here accordingly.
2014-06-19 15:07:08 -04:00
Ben Alpert
8a6e2cde7f Don't export (undefined) React in main.js
Previously, this was throwing an error. It was unintentionally (I assume) introduced in fc5bb9c.

Test Plan: jest
2014-06-19 11:34:50 -07:00
Paul O’Shannessy
324d41b5f0 Merge pull request #1244 from rayqian/master
add chinese translation support
2014-06-19 11:18:11 -07:00
Jon Beebe
b9c132e58a Removes value from rendered attributes of textarea 2014-06-19 07:14:49 -05:00
Ben Alpert
b0dce1543a Merge pull request #1721 from whatthejeff/patch-1
Fugbix typo.
2014-06-18 20:47:19 -07:00
Jeff Welch
27db8acaf9 Fugbix typo. 2014-06-18 23:36:37 -04:00
Paul O’Shannessy
92e3384cd2 Merge pull request #1513 from danielschonfeld/shouldcomponentupdate-boolean
Warn if shouldComponentUpdate returns anything other than true/false
2014-06-18 11:29:31 -07:00
Paul O’Shannessy
29083d0cec Merge pull request #1713 from bmihelac/patch-1
Missing semicolon in TodoStore.js
2014-06-18 11:17:04 -07:00
Bojan Mihelac
84135bc605 Missing semicolon in TodoStore.js 2014-06-18 10:34:53 +02:00
Ben Alpert
121b290899 Clarify refs and setState callback documentation 2014-06-17 23:20:04 -07:00
Cheng Lou
3d696312ef Merge pull request #1712 from mathieumg/master
Added example of objectOf usage in documentation.
2014-06-17 20:55:13 -07:00
Mathieu M-Gosselin
7fefab5946 Added example of objectOf usage in documentation. 2014-06-17 23:43:25 -04:00
Paul O’Shannessy
7f757347bc Update many npm dependencies
Sauce/connect related things need some more work and I didn't want to
figure those out right now.

Fixes #1701
2014-06-17 14:21:24 -07:00
Paul O’Shannessy
8bbbe900a5 Sync out camelize module
For use in #1662
2014-06-17 09:27:59 -07:00
Ben Alpert
00037b3ec2 Fix tagtree.tv link
Fixes #1697.
2014-06-16 13:56:36 -07:00
Paul O’Shannessy
08a207f401 Merge pull request #910 from andrewdavey/react-transform-source-map
Add sourceMap option to react-tools transform
2014-06-16 13:41:41 -07:00
Cheng Lou
20a50410a2 Merge pull request #1609 from spicyj/tlt-indirect
Remove unnecessary topLevelTypes indirection
2014-06-16 13:07:44 -07:00
Ben Alpert
52127dd7cf Remove unnecessary topLevelTypes indirection
topLevelTypes is a key mirror, so dependency and topLevelType are always the same here.
2014-06-16 12:18:19 -07:00
Pete Hunt
c93583c84f Remove bad perf metric
Remove a bad perf metric. Will investigate later.
2014-06-14 20:40:09 -07:00
Pete Hunt
e1c2d02fdd Create ReactEventListener
Per our discussion friday, this creates ReactEventListener and renames variables to use the "handle"
nomenclature.
2014-06-14 20:38:45 -07:00
Marshall Roch
a6cd945d9f Fix 'this' in static methods
binds static methods on the descriptor to the component's actual constructor, so that `foo.constructor.bar()` and `Foo.bar()` run with the same `this`.
2014-06-14 20:37:51 -07:00
Tim Yung
431155d2e2 Revert #1536
It's causing issues in product code. Reverting until it can be
investigated further.
2014-06-14 20:36:07 -07:00
Kunal Mehta
0f7423f31d Merge pull request #1661 from spicyj/test-ie10-select-multiple
Fix select switching to multiple in IE
2014-06-13 14:24:50 -07:00
Cheng Lou
3eb36415bd Merge pull request #1206 from brandonbloom/apply
$apply directive for update
2014-06-12 20:34:29 -07:00
Cheng Lou
4329d5ac38 Merge pull request #1611 from mathieumg/master
Added 'objectOf' PropType validator to iterate on objects and validate properties.
2014-06-12 20:19:33 -07:00
Brandon Bloom
86161c9c48 $apply command for update 2014-06-12 23:10:14 -04:00
Ben Alpert
7ab5769e18 Merge pull request #1687 from KyleAMathews/patch-2
typo fix
2014-06-12 16:29:19 -07:00
Kyle Mathews
cfdc884582 typo 2014-06-12 16:27:40 -07:00
Ben Alpert
5758f8da35 Merge pull request #1685 from randallsquared/patch-1
Fix correlation direction of wording in Ballmer Peak example.
2014-06-12 12:34:53 -07:00
Randall Randall
6d0e2feb52 Fix wording.
The Ballmer Peak XKCD suggests that it's a graph of ability, rather than bug frequency, which should be inversely correlated with ability.  A simple change of the wording fixes this terrible mishandling of Ballmer Peak data.
2014-06-12 10:15:13 -04:00
Mathieu M-Gosselin
4852c30d62 Added 'objectOf' PropType validator to iterate on object literals and
validate properties.
2014-06-11 21:12:05 -04:00
Cheng Lou
303a719f92 Merge pull request #1658 from spicyj/test-ie10-submit-label
Fix submit-button value test in IE10
2014-06-11 13:44:27 -07:00
Cheng Lou
9eff32c80c Merge pull request #1659 from spicyj/test-ie10-iframe
Fix EnterLeaveEventPlugin-test in IE10
2014-06-11 13:44:16 -07:00
Cheng Lou
92c174fec8 Merge pull request #1671 from gasi/fix-unset-style
Prevent null reference access when unsetting styles
2014-06-11 11:27:37 -07:00
Cheng Lou
36f2999d47 Merge pull request #1660 from spicyj/test-ie10-proptypesname
Fix PropTypes test in IE10
2014-06-11 10:34:28 -07:00
Ben Alpert
8e2dcceee3 Merge pull request #1597 from spicyj/defaultprops-autobind
Auto-bind before getDefaultProps
2014-06-11 10:14:31 -07:00
Ben Alpert
927eb570b9 Merge pull request #1631 from dblandin/master
Update link to @petehunt's react-server-rendering GitHub repo
2014-06-10 13:53:37 -07:00
Ben Alpert
e1e2fbdcf7 Merge pull request #1636 from harshadsabne/master
Update 2014-03-21-react-v0.10.md
2014-06-10 13:45:46 -07:00
Daniel Gasienica
7c2dec5bd3 Prevent null reference access when unsetting styles 2014-06-10 13:33:32 -07:00
Ben Alpert
2f61996ec3 [docs] Point to renderComponent over setProps 2014-06-08 13:04:40 -07:00
Ben Alpert
eaa68b8e6b Fix select switching to multiple in IE
This one was an actual behavioral bug rather than a bug with the tests; our intention was that the first element from the `defaultValue` array would remain selected but IE seemed to be choosing the last one instead. Now we set the value for uncontrolled components in componentDidUpdate when switching from multiple to non-multiple to ensure that a consistent option gets selected.

Test Plan: Ran the ReactDOMSelect tests in jest, phantomjs, IE10, Chrome, and Firefox. Also tested an uncontrolled select manually to make sure that nothing crazy happened when switching between options.
2014-06-07 19:16:34 -07:00
Ben Alpert
7cd5e9b399 Fix PropTypes test in IE10
Test Plan: Ran the test in jest, phantomjs, IE10, Chrome, and Firefox.
2014-06-07 18:56:28 -07:00
Ben Alpert
5790a75622 Fix submit-button value test in IE10
Test Plan: Ran test in jest, phantomjs, IE10, Chrome, and Firefox.
2014-06-07 18:50:29 -07:00
Ben Alpert
e938116549 Fix EnterLeaveEventPlugin-test in IE10
Previously this was failing because iframeDocument.body wasn't properly initialized. Creating the document this way seems to work in all environments

Test Plan: Ran the test in jest, phantomjs, IE10, Chrome, and Firefox.
2014-06-07 18:45:32 -07:00
cpojer
eebcf9f888 Fix ExecutionEnvironment.canUseDOM for IE8. 2014-06-05 12:44:24 -07:00
Christoph Pojer
41ed67d222 Merge pull request #1638 from spicyj/getmodifierstate-2
Fix getEventModifierState, no allocations
2014-06-03 14:36:16 -07:00
Ben Alpert
e501238c10 Fix getEventModifierState, no allocations
Alternative to #1637 that doesn't allocate on every event.

Test Plan: Crossed fingers.
2014-06-03 14:35:29 -07:00
Harshad Sabne
7172b1d5da Update 2014-03-21-react-v0.10.md
Fix link to React v0.10 RC
2014-06-03 21:35:49 +05:30
Pete Hunt
87bcbff218 Merge pull request #1632 from spicyj/img-load-error
Fix onLoad and onError on images
2014-05-30 17:04:41 -07:00
Ben Alpert
3e34739cb9 Fix onLoad and onError on images
Fixes bug introduced in c62c2c5.

Test Plan: Tested that the onLoad event was properly triggered on an image. Didn't test onError but I can only assume that it works equally well.
2014-05-30 16:53:46 -07:00
Devon Blandin
d8a2f12498 Update link to @petehunt's react-server-rendering GitHub repo 2014-05-30 14:14:18 -05:00
Cheng Lou
6ce193614c Merge pull request #1627 from Enome/master
Typo: ClosureScript -> ClojureScript in latest blog post
2014-05-29 16:20:42 -04:00
enome
b72d9f3aab Typo: ClosureScript -> ClojureScript 2014-05-29 22:10:15 +02:00
Ben Alpert
5a856c769d Merge pull request #1614 from chenglou/1-year
[Blog] One-year anniversary post
2014-05-29 11:41:51 -07:00
Cheng Lou
c5f690a7c7 [Blog] One-year anniversary post 2014-05-29 14:39:59 -04:00
Geert-Jan Brits
0c312222e9 Update todo example. fixes 'Create' that shouldn't happen
Currently, an `onBlur` creates a new todo on `TodoTextInput`. This makes sense for existing items but not for new items. I.e consider the following: 

1. cursor on new item ("What needs to be done?")
2. click 'x' on the first item. 

This results in two actions being fired: 

1. TODO_CREATE, with an empty string as 'text'
2. TODO_DESTROY

The proposed fix doesn't send a TODO_CREATE if `text.trim() === "")`
2014-05-29 14:45:42 +02:00
Ben Alpert
8d8dd4d336 Merge pull request #1620 from kmeht/jestDoc
Reference Jest in TestUtils documentation.
2014-05-28 23:53:37 -07:00
Kunal Mehta
055275b833 Reference Jest in TestUtils documentation. 2014-05-28 23:51:22 -07:00
Ben Alpert
3297909545 [docs] Fix grammar 2014-05-28 23:31:02 -07:00
Fred Zhao
50516585a4 Update findComponentRoot and processUpdates warnings for SVG
I ran into a really difficult-to-debug issue with a React app with SVG
elements. Christopher sat down with me for a while and we finally figured out
that the browser was moving non-SVG elements out of a parent `<svg>` node which
triggered the `processUpdates()` invariant. This updates the error message
thrown from there to include this scenario in the possible issues list.
2014-05-28 18:19:49 -07:00
Paul O’Shannessy
6c7abd36dd Sync upstream modules
crateObjectFrom is no longer used (was used in ReactPropTypes). Others are small changes.
2014-05-28 15:13:02 -07:00
Ben Alpert
2e3cf459ba Fix tutorial to have exact translation of example
Fixes #903.
2014-05-28 10:29:34 -07:00
Paul O’Shannessy
0ad8cfad1a Merge pull request #1590 from spicyj/svg-classname
Handle className properly on SVG nodes
2014-05-28 10:14:59 -07:00
Paul O’Shannessy
f230e0a031 Merge pull request #1583 from nhunzaker/jsxtransform-parallel
Load external scripts in parallel in JSXTransformer
2014-05-27 14:31:25 -07:00
Timothy Yung
bca1f0e352 Merge pull request #1536 from spicyj/gh-1169
Attach empty onclick listener to each node
2014-05-27 16:44:08 -04:00
Ben Alpert
e096000bb5 Attach empty onclick listener to each node
Fixes #1169.

This is a more robust way of fixing what MobileSafariClickPlugin previously tried to. Now even if you don't want anything to do with touch events, click events still work properly.

Test Plan: Added a click handler to an `<img />` element and triggered it in the iOS simulator -- it didn't execute before.
2014-05-27 13:40:17 -07:00
Paul O’Shannessy
fa6fe54432 Merge pull request #1596 from mindeavor/patch-1
Fix typo in Flux TodoMVC Tutorial
2014-05-27 11:07:09 -07:00
Tom Haggie
cd3ba59cf1 Updated the ajax to tip to also mention that you need to check
that the component is still mounted before updating it's state.

Closes #1600.
2014-05-26 20:29:48 -07:00
Ben Alpert
03df8d7de0 Ignore built todomvc-flux bundles 2014-05-26 20:27:48 -07:00
Ben Alpert
f761f770e1 Don't load todomvc-common/base.js
Fixes #1603.

It's unnecessary and makes a request to learn.json which doesn't exist.
2014-05-26 20:19:16 -07:00
Ben Alpert
db4a90a9ef Capitalize README for consistency 2014-05-26 20:14:54 -07:00
Dan Abramov
367c88e399 Apply component and mixins specs deterministically
Fixes #1589.
2014-05-26 02:56:28 +04:00
Ben Alpert
8a460ba2e8 Auto-bind before getDefaultProps
Fixes #1595.
2014-05-25 00:40:39 -07:00
Gilbert
330fa30141 Fix typo in Flux TodoMVC Tutorial
A sentence says "only handles one actionType" when the example code instead handles two.
2014-05-25 00:21:31 -05:00
Ben Alpert
e1457a14fd Run all tests, fix indentation 2014-05-23 23:03:13 -07:00
Ben Alpert
1e268c3591 Merge pull request #1556 from joshma/flux-dispatcher-docs
Update Flux Dispatcher.dispatch and waitFor examples
2014-05-23 23:01:25 -07:00
Ben Alpert
3e30940bf3 Bump to React 0.10 in TodoMVC Flux 2014-05-23 16:09:47 -07:00
Paul O'Shannessy
7a9b81ef55 remove spurios module ref
long long ago in a galaxy far away this was probably a dependency
2014-05-23 15:35:22 -07:00
Joshua Ma
7954a861d1 Add more complicated fourth listener to AppDispatcher-test 2014-05-23 12:42:09 -07:00
Joshua Ma
a616742fce Configure todomvc-flux npm test to use jest 2014-05-23 12:36:38 -07:00
Joshua Ma
f8d0291874 Fix doc typo and remove underscore from local var 2014-05-23 12:34:40 -07:00
Paul O'Shannessy
c62c2c59bb Remove event listeners from native dom wrapper components
Not removing them resulted in leaks as we would hold on to removed nodes forever.

This really showed up with images and the load event where we would unmount and create a new img with the same react id as the old one. We properly cleared and primed the caches but we would handle the load event for both nodes. We would eventually hit an invariant in that path as we tried to handle the event for the removed node, which no longer matched the node we had in the cache.

By forcefully removing the listener, we'll avoid this problem entirely and we should leak fewer DOM nodes.
2014-05-23 11:30:19 -07:00
Ben Alpert
37f61c479e Handle className properly on SVG nodes
This strategy avoids a runtime check for every set (as opposed to using a mutation method).

Test Plan: Verify that changing className works on a div and a rect in latest Chrome, latest Firefox, IE9. Verify that the div works in IE8.
2014-05-22 20:31:04 -07:00
Ben Alpert
e60a893d2f Bump esprima-fb and jstransform versions
Fixes #1584, fixes #1475.
2014-05-22 20:16:37 -07:00
Jeff Morrison
9ef6156d5c Merge pull request #760 from syranide/jsxns
Support for JSX tag namespaces <React:DOM:div />
2014-05-22 15:51:49 -07:00
Paul O’Shannessy
f9ad17db65 Merge pull request #1363 from spicyj/batch-all
Batch subupdates caused by any state update
2014-05-22 15:28:48 -07:00
Ben Alpert
49652c8e20 Merge pull request #1575 from spicyj/dispatch-index
Make promise selection logic clearer
2014-05-21 15:39:53 -07:00
Paul O’Shannessy
cccdc54b68 Merge pull request #1576 from spicyj/ex-shim
Add shims to examples
2014-05-21 15:16:51 -07:00
Ian Obermiller
bf5dfc87dc Error in extractEvents
If the event is on the window object, topScroll, for instance, the topLevelTarget will not have getAttribute defined. Restore the previous `|| !topLevelTarget.attributes` check to avoid an error on every scroll.
2014-05-21 15:12:26 -07:00
Ben Alpert
696e556eae Merge pull request #1579 from gscottolson/master
Improve readability of multi-line nav items.
2014-05-21 12:30:28 -07:00
G Scott Olson
c9bac95034 Fix nested UL spacing. 2014-05-21 15:26:01 -04:00
Nate Hunzaker
59a9251c90 Set executed after run 2014-05-21 15:09:52 -04:00
Nate Hunzaker
b1247690d5 Load in parallel, evaluate linearly as they come in 2014-05-21 15:07:10 -04:00
Pete Hunt
6c34151588 Merge pull request #1577 from piranha/master
better talk in russian
2014-05-21 11:26:29 -07:00
G Scott Olson
7094737782 Improve readability of multi-line nav items. 2014-05-21 10:55:42 -04:00
Alexander Solovyov
4595dbdc7a better talk in russian 2014-05-21 11:52:24 +03:00
Ben Alpert
4cb4bd0220 Add shims to examples
I find myself often using (modified) examples to test in IE and it's a pain to have to add the shims in every time. Might as well just add them in always.
2014-05-21 00:07:18 -07:00
Ben Alpert
e58899cdff Make promise selection logic clearer 2014-05-20 17:09:05 -07:00
Paul O’Shannessy
c6309567c9 Merge pull request #1559 from spicyj/gh-1376
Allow unmounting title tag
2014-05-20 11:23:36 -07:00
Paul O’Shannessy
e63eab111c Merge pull request #1553 from givingstage/invalid_checksum_warning_spacing
Fixed spacing of invalid checksum warning
2014-05-20 11:23:19 -07:00
Paul O’Shannessy
6c595d55dc Merge pull request #1571 from spicyj/style-test
Switch style test to pass in jsdom
2014-05-20 11:22:30 -07:00
remixz
765ee8e5d0 Merge upstream changes 2014-05-19 20:12:57 -07:00
Ben Alpert
2d26451821 Add configuration for running tests with Jest
Can be run with `node_modules/.bin/jest` for now; didn't want to disturb the grunt setup.

Right now one test fails with:

```
 FAIL  browser/ui/__tests__/ReactDOMComponent-test.js (1.423s)
● ReactDOMComponent › updateDOM › it should update styles when mutating style object
  - Expected: '0' toEqual: '0.5'
        at Spec.<anonymous> (src/browser/ui/__tests__/ReactDOMComponent-test.js:99:33)
```

which I can only assume is a jsdom problem -- no other asserts fail.
2014-05-19 16:58:33 -07:00
Ben Alpert
4e5ed8317b Switch style test to pass in jsdom
This should be testing approximately the same thing and passes in Jest.

Test Plan: Cherry-pick Jest config from #1528 and verify that running `jest`.
2014-05-19 16:56:30 -07:00
Ben Alpert
e17086e5df Add componentWillReceiveProps setState test 2014-05-19 15:58:40 -07:00
Paul O’Shannessy
5933d97cb6 Merge pull request #1563 from spicyj/travis-no-sauce
Don't fail Travis on sauce failures
2014-05-19 13:28:09 -07:00
Ben Alpert
8db8e60a38 Don't fail Travis on sauce failures
Fixes #1496.
2014-05-19 13:23:07 -07:00
Paul O’Shannessy
ab58ecefa7 Merge pull request #1564 from spicyj/hop-ie8
Use Object.prototype.hasOwnProperty for doc in IE8
2014-05-19 13:15:25 -07:00
Ben Alpert
550795445e Use Object.prototype.hasOwnProperty for doc in IE8
Test Plan: Loaded ballmer-peak example in IE8 without errors and interacted with the text field.
2014-05-19 13:09:47 -07:00
Paul O’Shannessy
0c6bee049e Merge pull request #1189 from spicyj/hasown
Add hasOwnProperty checks where appropriate
2014-05-19 09:38:56 -07:00
Ben Alpert
4935d04d50 Allow unmounting title tag
cf. #1376.

This is useful for SVG. Dynamically adding and removing `<title>` elements in SVG still won't work properly because of getMarkupWrap but this at least lets you include it in initial render and then unmount the entire `<svg>` without problems.
2014-05-18 23:19:51 -07:00
Nate Hunzaker
0614cfa43e Load scripts in parallel 2014-05-18 16:34:40 -04:00
Ben Alpert
66291d2761 Merge pull request #1558 from nhunzaker/fix-1530
Fix 1530 - Asynchronously load scripts with JSX transformer
2014-05-18 13:04:11 -07:00
Nate Hunzaker
bc79f623a1 Asynchronously load scripts with JSX transformer. 2014-05-18 15:41:41 -04:00
Andrew Davey
2b38795769 Rebased on master 2014-05-18 17:51:14 +01:00
Andrew Davey
fc5bb9c9b2 Add sourceMap option to react-tools transform
Allow tools like grunt-react to include inline source maps in the
generated JavaScript. Browserify can then combine these source maps when
bundling everything together.

Usage:

```
var transform = require('react-tools').transform;
var output = transform(jsxContent, {
  sourceMap: true,
  sourceFilename: 'source.jsx'
});
```

The `output` will have an inline source map comment appended.
2014-05-18 17:42:35 +01:00
Mark IJbema
59616672d7 Make sure it works when we have no css transitions 2014-05-18 11:31:24 +02:00
Mark IJbema
cd7b8aa0b1 Added event parameter 2014-05-18 11:29:29 +02:00
Ben Alpert
1baca43391 Mention PropTypes in top-level API
cf. #449
2014-05-18 00:15:35 -07:00
Ben Alpert
f1a5a4c58e Be more specific with createClass, renderComponent
Closes #371.
2014-05-18 00:15:35 -07:00
Ben Alpert
566af16e64 Tweak getting started wording 2014-05-18 00:15:35 -07:00
Joshua Ma
de1f783188 Update todomvc dispatcher to match docs, add AppDispatcher test 2014-05-17 22:01:18 -07:00
Joshua Ma
f12a376f34 Update Flux Dispatcher.dispatch and waitFor examples
The previous examples didn't properly work when 1) a Store callback does
waitFor on Stores that haven't been reached yet and 2) a Store callback
waits on another Store that is already waiting.

The updated example uses constructs Promises up front and then
asynchronously resolves them.
2014-05-17 21:17:08 -07:00
Thomas Shafer
0a7128c70f Fixed spacing of invalid checksum warning 2014-05-17 20:04:52 -07:00
Ben Alpert
e9653aad6a Merge pull request #1552 from t3chnoboy/master
Update Jasmine link
2014-05-17 18:33:51 -07:00
Dmitry Mazuro
8192b8c27f Update Jasmine link 2014-05-18 04:30:02 +03:00
Ben Alpert
78958fe0f5 Remove references to autoflow
Most references were removed in 6e59561; this should be the last.
2014-05-17 15:15:26 -07:00
Ben Alpert
6c331fba07 Add hasOwnProperty checks where appropriate
For boolean-like objects, I've added hasOwnProperty checks in addition to the existing truthiness check even though for most of these dicts, we leave out false keys instead of setting them explicitly to false.

In DOMPropertyOperations, we don't need to check hasOwnProperty if the property is in isStandardName because (with the exception of getPossibleStandardName) the dicts on DOMProperty will now be consistently populated with every valid attribute.
2014-05-16 10:59:51 -07:00
Paul O’Shannessy
4558e2c4bc Merge pull request #1491 from naturalatlas/itemscope
Added support for itemscope, itemtype, itemprop attributes.
2014-05-15 14:48:51 -07:00
Jan Kassens
46de927a28 Merge pull request #1537 from chenglou/rm-filter-attrs
Remove filterAttributes.js
2014-05-15 12:16:35 -07:00
Cheng Lou
80a5463a2c Remove filterAttributes.js
This is no longer needed because of 089a494a1f

mutateHTMLNodeWithMarkup.js was the only one using it.
2014-05-15 14:14:38 -04:00
Andreas Svensson
3bec9f070f Guard against contentEditable with children props 2014-05-15 11:08:25 +02:00
Ben Alpert
c913c95908 Update Simulate docs to reflect reality
cf. #1532, #1445.
2014-05-14 21:39:00 -07:00
remixz
3f31ec463f Change harmony option to "harmony=true" 2014-05-14 15:50:35 -07:00
remixz
65c258a7b7 Add harmony transform support in browser (Fixes GH-1420)
I implemented this by checking for `type="text/jsx;harmony"`, since this
has a bit of a cleaner implementation rather than parsing a JSON object
out of a data attribute. If in the future there are other options to
pass, it would make sense to move to a system like that.

Along with adding support, there is also a new example added that's
the basic-jsx example with Harmony syntax.
2014-05-13 22:07:02 -07:00
Daniel Schonfeld
7d91277a50 warn when shouldComponentUpdate() returns undefined 2014-05-13 22:44:00 -04:00
Pete Hunt
b66202eb98 Merge pull request #1487 from somethingkindawierd/master
Adds svg mask and pattern dom components
2014-05-13 11:28:59 -07:00
Ben Alpert
808a54f410 Batch subupdates caused by any state update
With this, multiple setState calls triggered by a componentDidUpdate handler (or similar) will be batched together, regardless of if the original setState call was in a batching context.

I also cleaned up some inconsistencies with the order of component updates and callbacks in situations where one component's update directly causes another to update.

Fixes #1147. Helps with #1353 and #1245 as well, though doesn't completely fix them yet.

Test Plan:
grunt test
2014-05-13 10:50:26 -07:00
Paul O’Shannessy
a00199ddd2 Merge pull request #1358 from spicyj/one-transaction
Share reconcile transaction in batched updates
2014-05-13 10:47:03 -07:00
Josh Duck
29f3f74c52 Make perf show all exclusive time, not just render time.
Currently require('ReactDefaultPerf').printExclusive() shows render
time and aggregate componentMount time.

This makes it show exclusive mount time by tracking a stack.
2014-05-12 16:39:09 -07:00
Pete Hunt
7268f44c94 Merge pull request #1504 from spicyj/flux-621
Start Flux video at 10m21s
2014-05-12 13:44:21 -07:00
Pete Hunt
e4f80f301d Merge pull request #1516 from syranide/es5err
Preemptively error when required ES5 shim/shams are not available
2014-05-12 13:40:00 -07:00
Ben Alpert
d46e1588f9 Update Flux README to point at website post/docs 2014-05-12 01:33:53 -07:00
Ben Alpert
76abdddae8 todomvc-flux: Depend on uglify-js, not uglifyjs
Fixes #1505.

Confusingly, the uglify-js package provides the `uglifyjs` binary and `npm run-script build` didn't work if uglify-js wasn't installed globally; now it does.
2014-05-12 01:14:01 -07:00
Andreas Svensson
659b7981e1 Preemptively error when required ES5 shim/shams are not available 2014-05-11 21:20:07 +02:00
Ben Alpert
6b1c546602 Add missing emitChange() to Flux docs 2014-05-10 17:50:26 -03:00
Ben Alpert
6b758ef283 Merge pull request #1503 from dybskiy/patch-2
Update flux-todo-list.md
2014-05-09 15:38:18 -03:00
Ben Alpert
39a0dbaebe Start Flux video at 10m21s 2014-05-09 15:34:12 -03:00
Yuriy Dybskiy
d5a5840d31 Update flux-todo-list.md
Fix broken link to todomvc-flux repo

@spicyj cla signed
2014-05-09 11:11:42 -07:00
Daniel Lo Nigro
bf957c6c50 Fix minor typo 2014-05-09 10:01:40 -07:00
Brian Reavis
f399b68201 Stylistic changes. 2014-05-08 23:25:10 -07:00
fisherwebdev
39ec28f6f4 update Flux tutorial link 2014-05-08 19:57:19 -07:00
Christopher Chedeau
7f9a8385b6 Merge pull request #1499 from vjeux/flux
Flux blog post and tutorial
2014-05-08 16:26:43 -07:00
Vjeux
46995dd2fe Flux blog post and tutorial 2014-05-09 01:22:47 +02:00
Paul O’Shannessy
c4ed2c1c90 Move tagtree image to docs/
Missed this in #1470
2014-05-08 11:52:32 -07:00
Paul O’Shannessy
8af991f10b Codemod mockReturnValue externally
320024555c didn't update the mocks module
here, just the callsites.
2014-05-08 10:47:44 -07:00
Christopher Chedeau
320024555c Codemod mockDefaultReturnValue
The naming is super confusing.

mockReturnValue -> mockReturnValueOnce
mockDefaultReturnValue -> mockReturnValue
2014-05-08 10:11:38 -07:00
Paul O’Shannessy
562b1b201e Merge pull request #1492 from spicyj/rtg-from-false
ReactTransitionGroup: Fix moving from falsey child
2014-05-08 09:46:49 -07:00
Jon Beebe
c50dbb0ec1 Adds svg pattern and mask components 2014-05-08 07:16:28 -05:00
Paul O’Shannessy
32b84a4c5e Merge pull request #1460 from spicyj/tg2
Actually fix transitioning to null
2014-05-07 17:12:05 -07:00
Andreas Svensson
aa044c6b61 Add support for JSX member expressions <React.DOM.div /> 2014-05-08 00:10:10 +02:00
Paul O’Shannessy
aa46ab1862 Merge pull request #1486 from nbostrom/patch-1
Embed video from F8
2014-05-07 11:09:19 -07:00
Paul O’Shannessy
67c68612c0 Title case on videos page 2014-05-07 11:07:49 -07:00
Paul O’Shannessy
9926a2d7f9 Merge pull request #1490 from Vijar/master
Fixed incorrect usage of github api in example
2014-05-07 11:01:05 -07:00
Paul O’Shannessy
4a24283559 Merge pull request #1276 from marcins/bugfix/1275-transitiongroup-android
Fix transition end detection for Android
2014-05-07 10:54:37 -07:00
Paul O’Shannessy
c7c3027081 Small style fixup 2014-05-07 10:44:30 -07:00
Brian Reavis
bfcd4cac48 Use camelCase and declare MUST_USE_ATTRIBUTE. 2014-05-07 10:02:57 -07:00
Ben Alpert
5c9224145e ReactTransitionGroup: Fix moving from falsey child
See http://stackoverflow.com/q/23510413/49485.

Test Plan: grunt fasttest
2014-05-07 09:54:23 -03:00
Brian Reavis
2b196b7cd2 Updated documentation. 2014-05-07 00:41:50 -07:00
Brian Reavis
0fe2fcc27e Added support for itemscope, itemtype, itemprop. 2014-05-07 00:37:06 -07:00
Rajiv Tirumalareddy
b360ed80dd Fixed incorrect usage of github api in example
more: https://developer.github.com/v3/gists/#detailed-gist-representation
2014-05-06 16:42:07 -07:00
Christopher Chedeau
52e1b42d26 Merge pull request #1480 from volkanunsal/patch-1
Update Dispatcher.js
2014-05-06 16:40:14 -07:00
Jon Beebe
c50ad81b06 Adds svg mask and pattern dom components 2014-05-06 11:21:47 -05:00
Paul O’Shannessy
88c94683d6 Revert "Move defaultProps resolution and type validation to the descriptor"
This reverts commit ff52e3df00.

Too many things broke with transferPropsTo
2014-05-06 09:09:51 -07:00
Niklas Boström
dea228e4ae Embed video from F8
Edited in githubs inline editor. Not tested!
2014-05-06 15:18:02 +02:00
Sebastian Markbage
ff52e3df00 Move defaultProps resolution and type validation to the descriptor
This copies the propType and contextType validation to a wrapper around the
descriptor factory. By doing the validation early, we make it easier to track
down bugs. It also prepares for static type checking which should be done at the
usage site.

This validation is not yet active and is just logged using monitorCodeUse. This
will allow us to clean up callsites which would fail this new type of
validation.

I chose to copy the validation instead of abstracting it out to a common abstraction. This is just an
intermediate step to avoid spamming consoles. The original validation in the instance will be deleted as soon as we can turn on the warnings at the callsite. Copy+Delete makes this a more a much cleaner diff review/history.

Additionally, getDefaultProps are moved to become a static function which is
only executed once. It should be moved to statics but we don't have a
convenient way to merge mixins in statics right now. Deferring to ES6 classes.

This is still a breaking change since you can return an object or array from
getDefaultProps, which later gets mutated and now the shared instance is
mutated. Mutating an object that is passed into you from props is highly
discouraged and likely to lead to subtle bugs anyway. So I'm not too worried.

The defaultProps are now resolved in the descriptor factory. This will enable
a perf optimizations where we don't create an unnecessary object allocation
when you use default props. It also means that ReactChildren.map has access to
resolved properties which gives them consistent behavior whether or not the
default prop is specified.

This is a breaking change since it can affect how mapping over children and
transferPropsTo works together with defaultProps.
2014-05-05 17:03:54 -07:00
Paul O’Shannessy
b48a534f6f Merge pull request #1032 from fforw/master
Additional SVG tag and attribute names
2014-05-05 16:54:57 -07:00
Ben Alpert
486b3c0bc5 Move envify from peerDependencies to dependencies
Fixes #1482, closes #1483.

This shouldn't make a practical difference to us and will apparently fix browserify-cdn.
2014-05-05 20:26:23 -03:00
Isaac Salier-Hellendag
d6731e7a0b Merge pull request #776 from syranide/superkey
Even better normalization of KeyboardEvent + MouseEvent
2014-05-05 16:19:02 -05:00
Paul O’Shannessy
c253c786a9 Merge pull request #1468 from dschafer/tutorial
Update jsfiddles in thinking-in-react to remove handleSubmit from forms
2014-05-05 13:10:28 -07:00
volkanunsal
035a648a2d Update Dispatcher.js 2014-05-05 12:20:25 -04:00
volkanunsal
c81c07c816 Update Dispatcher.js 2014-05-04 19:15:44 -04:00
volkanunsal
a7823a3624 Update Dispatcher.js 2014-05-04 19:08:46 -04:00
volkanunsal
31477dbf94 Update Dispatcher.js
I think Array.filter expects a boolean return value, am I correct?
2014-05-04 19:04:51 -04:00
Ben Alpert
f1096c6bb3 Fix ASCII-art arrow alignment 2014-05-03 23:45:12 -03:00
Paul O’Shannessy
064abe3d49 Merge pull request #1470 from hendrikswan/master
Link to tagtree 'Thinking in React' video - on master
2014-05-02 15:22:27 -07:00
Pete Hunt
b02a5dc0f8 Merge pull request #1479 from fisherwebdev/master
Clean up Flux documentation and add more info about dependencies btwn stores
2014-05-02 23:56:06 +02:00
fisherwebdev
b0f82bfe4c Clean up Flux documentation and add more info about managing dependencies between stores 2014-05-02 13:22:15 -07:00
hendrik swanepoel
cdac160439 Fixed a couple of issues with link to tagtree.tv video 2014-05-02 21:28:31 +02:00
Paul O’Shannessy
0dd8f551c0 Merge pull request #1477 from KyleAMathews/patch-1
Typo in Flux example readme
2014-05-02 12:05:20 -07:00
Kyle Mathews
72b830ec4c Typo 2014-05-02 11:10:13 -07:00
petehunt
fa154e6e21 Add some backticks to flux docs 2014-05-02 16:44:43 +02:00
Pete Hunt
d567f37bc3 Merge pull request #1476 from fisherwebdev/master
Additional Flux documentation
2014-05-02 16:42:20 +02:00
fisherwebdev
b97cf7a180 Additional Flux documentation 2014-05-02 07:17:49 -07:00
Andreas Svensson
bf7826c68d Normalize and polyfill KeyboardEvent further, also MouseEvent+TouchEvent
KeyboardEvent now normalizes "charCode", "keyCode", "which" across all browsers
KeyboardEvent has partial "key"-support for KeyDown/KeyUp and full "key"-support for KeyPress.
KeyboardEvent, MouseEvent and TouchEvent now has "getModifierState", polyfill when not implemented.
2014-05-01 16:56:43 +02:00
hendrik swanepoel
6323db7c18 link to tagtree 'Thinking in React' video 2014-05-01 11:30:21 +02:00
dschafer
fbbace6b69 Update jsfiddles in thinking-in-react to remove onSubmit from forms 2014-04-29 19:53:13 -07:00
Ben Alpert
da34209148 Don't double-escape style names
Previously we were escaping both in createMarkupForStyles and then in createMarkupForProperty; now we escape only in the latter (otherwise the hypothetical style name `b&ckground` would become `b&amp;amp;ckground`).

Test Plan: grunt fasttest
2014-04-29 15:50:12 -03:00
Christopher Chedeau
32d80aa5eb Merge pull request #1462 from spicyj/lint
Fix some linty things
2014-04-29 11:34:30 -07:00
Christopher Chedeau
92a3e94528 Merge pull request #1459 from spicyj/ti
Move tooling info to Complementary Tools wiki
2014-04-29 11:33:50 -07:00
Christopher Chedeau
3eee27ebc8 Merge pull request #1463 from andreypopp/example-commonjs
Add basic CommonJS example with browserify
2014-04-29 10:58:14 -07:00
Andrey Popp
93fed1a459 Add basic CommonJS example with browserify 2014-04-29 21:57:08 +04:00
Ben Alpert
d5a4d29532 Fix some linty things 2014-04-28 23:30:05 -03:00
Ben Alpert
0d3622714c Don't escape slash; it's unnecessary
Fixes #1444.

Test Plan: grunt fasttest
2014-04-28 23:22:03 -03:00
Ben Alpert
4b51708ed2 Actually fix transitioning to null
Test Plan: grunt fasttest
2014-04-28 22:16:59 -03:00
Ben Alpert
05cc7b635c Move tooling info to Complementary Tools wiki
I moved the info that was here to the wiki page: https://github.com/facebook/react/wiki/Complementary-Tools; it doesn't need to live in the website any more.
2014-04-28 21:03:19 -03:00
Pete Hunt
b9e215d169 Merge pull request #1458 from spicyj/gh-1457
ReactTransitionGroup: Fix changing to null child
2014-04-28 17:00:22 -07:00
Ben Alpert
9dbbaf12bf ReactTransitionGroup: Fix changing to null child
Fixes #1457.

Test Plan: grunt fasttest
2014-04-28 20:52:42 -03:00
Paul O’Shannessy
d657479a9d Merge branch 'spicyj-nested-render' from #1402 2014-04-27 13:15:58 -07:00
Cheng Lou
8b23a7e699 Warn instead of throw for nested render calls 2014-04-27 13:15:42 -07:00
Cheng Lou
3a796ab47c Merge pull request #1455 from jeffmo/master
Bump jstransform dependency to point at 4.0.1 or higher
2014-04-26 15:38:32 -07:00
jeffmo
a7c3dc8b08 Bump jstransform dependency to point at 4.0.1 or higher 2014-04-26 15:34:40 -07:00
Pete Hunt
50eb9b3e50 Merge pull request #1452 from chenglou/perf-fix
Fix perf suite broken by descriptor change
2014-04-25 11:10:27 -07:00
Cheng Lou
5158a022df Fix perf suite broken by descriptor change 2014-04-25 10:38:17 -07:00
Marcin Szczepanski
cc56629620 Fix transition end detection for Android
Some Android versions have the "transition" and "animation" properties
set on element style objects despite not supporting un-prefxied animations
and transitions.  This change adds an additional sanity check to make sure
the correct event handlers are added for transition groups.
2014-04-25 13:19:25 +10:00
Paul O’Shannessy
28820e0adb Merge pull request #887 from syranide/textdocument
Test innerText/textContent on document.documentElement instead
2014-04-24 16:10:13 -07:00
Paul O’Shannessy
83687b927d Merge pull request #1450 from sahat/patch-1
Update build status svg badge
2014-04-24 15:45:19 -07:00
Sahat Yalkabov
f98995fe08 Update build status svg badge 2014-04-24 18:41:34 -04:00
Paul O’Shannessy
a0dc45e652 Merge pull request #879 from syranide/inlinechild
Remove unnecessary tests from insertChildAt and inline it instead
2014-04-24 15:02:14 -07:00
Andreas Svensson
a9a398b15a Test innerText/textContent on document.documentElement instead 2014-04-24 23:51:05 +02:00
Andreas Svensson
9ee1d92b52 Remove unnecessary tests from insertChildAt and inline it instead 2014-04-24 23:44:41 +02:00
Isaac Salier-Hellendag
cc292c1e22 Fix IE11 collapsed ranges in ReactDOMSelection
In IE10/11, it is apparently possible to have a Selection or Range object that has the following properties:

  - `anchorNode` === `focusNode` (Selection) or `startContainer` === `endContainer` (Range)
  - `anchorOffset` === `focusOffset` (Selection) or `startOffset` === `endOffset` (Range)
  - `isCollapsed` === `false` (Selection) or `collapsed` === `false` (Range)

As defined in http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html, this doesn't really make sense. Since the nodes and offsets are the same, the "collapsed" value should be `true`.

Moreover, when calling `selection.toString()` in this case, it appears that the entire text contents of `body` -- including `<script>` tag contents -- are considered within the selection. I thought maybe the selected nodes were missing from the DOM or something, but no, they're there.

Sidestep all of this in `ReactDOMSelection` by calculating the `collapsed` property manually and setting the selection length directly to zero if it is actually collapsed.

Side note: I think that for selection restoration on contenteditables, we shouldn't try to do this offset calculation. We should just use the structure provided natively (nodes and offsets) since we can restore using that structure as well.
2014-04-24 12:53:08 -07:00
Sven Helmberger
8e0d17c756 Add tspan to JSX transform 2014-04-24 19:13:01 +02:00
Sven Helmberger
0f0328f093 Current set of must-have SVG attributes / tag
The current set of SVG attributes / tag I felt like I needed
them absolutely for my React/SVG editor app.
2014-04-24 19:12:58 +02:00
Jeff Morrison
1b022e9b3a Merge pull request #1441 from zpao/update-jstransform
Upgrade jstransform to 4.0
2014-04-23 16:49:11 -07:00
Cheng Lou
7fa656dae9 Don't let new keys on style from transferPropsTo override old ones
Previous behavior: `transferPropsTo(<div style={{color: 'red'}} />)` would get `color` overriden if we transfer in a `style={{color: 'blue'}}`. This is inconsistent with how other props are transfered.

This simply reverses the order of arguments.

closes #1435
2014-04-23 16:44:32 -07:00
Paul O’Shannessy
4ed9e22a44 Upgrade jstransform to 4.0
Also enables the object-concise-method transform for --harmony

closes #1438
2014-04-23 16:36:45 -07:00
Paul O'Shannessy
3d605da15f Split DefaultDOMPropertyConfig
This makes it a little easier to add SVG properties. It also makes use of that injection that we claim is easy to use and will likely start playing a bigger part soon.

Closes #1009
2014-04-23 16:22:10 -07:00
Paul O’Shannessy
ff60e81fa9 Remove whitespace_transformer package
This was a one-time use thing, let's get rid of it. If we ever need to
push an update, we'll do it from the 0.9-stable branch.
2014-04-23 16:00:44 -07:00
Pete Hunt
df72bd76be Update videos.md 2014-04-23 15:45:48 -07:00
Jan Kassens
514f5fb98b fix warnings in cloneWithProps test
Don't test refs in this case, already testing warning above
2014-04-23 14:14:45 -07:00
Jan Kassens
9e9d8dbe76 fix warnings in ReactComponentLifeCycle test
Don't use inputs to avoid warnings in tests
2014-04-23 14:14:42 -07:00
Jonas Gebhardt
01d41f6e18 better error message for React EventPlugin order check
Ran into this while inadvertently requiring multiple React versions in a separate project (`require('react');` vs `require('React');`
2014-04-21 15:42:25 -07:00
Jan Kassens
4c199daa26 fix log spew from ReactDOMTextarea test
Similar to previous but for textarea. If `value` is set, we have to also set
`onChange` to avoid warnings.
2014-04-21 15:42:00 -07:00
Jan Kassens
089146b2f8 fix log spew from ReactDOMInput test
The prop validation threw a warning that either `onChange` or `readOnly` is required. Set the `onChange` where needed.
2014-04-21 15:41:50 -07:00
Paul O'Shannessy
c8933b947b unbreak server-side/web worker
We're now trying to access document directly at require time. Wrapping in a function prevented that before. But we can simply check what environment we're in first.
2014-04-20 11:44:01 -07:00
Juraj Dudak
385eb1cef1 Fixed a bug in expectRenderedChildAt
React components have _mountIndex, that looks like it is their order in DOM.
If you swap 2 elements in DOM, their order in children array isn't changed, but their _mountIndex is
2014-04-18 12:57:24 -07:00
Christoph Pojer
9a13393ce3 Remove function wrappers in DOMSelection
There is no point in doing the feature detection on every call, unless there is an IE bug where it is not sure about which support for selection it has (totally plausible).
2014-04-18 12:57:05 -07:00
Jonas Gebhardt
3a49ee7d82 Add typed ReactLink to ReactProps
Adds a PropType that checks for proper use of the ReactLink API and optionally validates the type of value passed in via the link. Basically, it's a wrapper around PropTypes.shape that hides the implementation of ReactLink.
2014-04-18 12:56:46 -07:00
Cheng Lou
0a5c22264b Make custom PropTypes return error rather than whatever
The new rule for PropTypes is that it should return an error object if validation fails, not throw, not warn.
2014-04-18 12:56:25 -07:00
Cheng Lou
4487831281 Allow false as an acceptable renderable type value
`false` is renderable.
2014-04-18 12:56:06 -07:00
Cheng Lou
3ee081b125 Merge pull request #1188 from spicyj/comp-spec-inv
Add clearer invariants to composite spec mixing
2014-04-17 12:50:29 -07:00
Cheng Lou
13f799ee8e Merge pull request #1419 from spicyj/inv-process
Add clearer invariant in processUpdates
2014-04-17 01:30:58 -07:00
Ben Alpert
7fb7e95108 Add React.batchedUpdates to public API
Fixes #906.
2014-04-16 15:59:54 -07:00
Ben Alpert
945d041160 Add clearer invariant in processUpdates
The `updatedChildren[j].parentNode.removeChild(updatedChildren[j]);` line below can fail if (1) we're moving/moving the same node twice or (2) the node we're looking for is gone completely. This makes it easier to distinguish between the two cases.

Perf shouldn't be a concern here because this is DOM code and invariants are fast in comparison.

Test Plan: grunt test
2014-04-16 15:09:31 -07:00
Cheng Lou
e9c00b1bae Remove grunt-complexity
The report itself is more or less useful because it detects stuff like
big objects (e.g. CSSProperty) as being too complicated. Furthermore, afaik
nobody refactors the code based on what the report says =).
2014-04-16 11:52:25 -07:00
Paul O’Shannessy
b3f5e863e0 Merge pull request #1340 from matthewwithanm/download-attribute
Support download attribute properly
2014-04-15 16:30:30 -07:00
Cheng Lou
7832b94114 Merge pull request #1412 from gasi/patch-3
Match `setTimeout` delay with documentation
2014-04-15 13:47:20 -07:00
Daniel Gasienica
663dd6f5b3 Match setTimeout delay with documentation 2014-04-15 13:45:09 -07:00
Paul O’Shannessy
0dcbfe831a Merge pull request #1410 from spicyj/sih
Don't try to detach a detached node
2014-04-15 12:59:57 -07:00
Ben Alpert
cc0233dd76 Don't try to detach a detached node
Test Plan: grunt test
2014-04-15 11:27:46 -07:00
Ben Alpert
c9767c2822 Guard top-level methods, not in every render call
Test Plan: grunt test
2014-04-15 00:03:02 -07:00
Matthew Dapena-Tretter
32a7a1cedb Rename "booleanish" to "overloaded boolean" 2014-04-14 23:00:25 -04:00
Cheng Lou
c6df1c2dd2 Fix PropType for travis
closes #1404
2014-04-14 17:20:50 -07:00
Paul O’Shannessy
717eacdb64 Merge pull request #1183 from lrowe/patch-6
meta http-equiv attribute name
2014-04-14 17:03:16 -07:00
Ben Alpert
f27175d166 Fix preposition capitalization 2014-04-14 16:28:46 -07:00
Ben Alpert
14580fb012 Update refs example code to use onChange
Fixes #1408.

Test Plan: Copy each code snippet into jsbin; type in the text box successfully; click the button and see the input clear (and in the second example, get focused).
2014-04-14 16:23:37 -07:00
Pete Hunt
d5533cfb6d Add docs for fasttest 2014-04-14 14:27:23 -07:00
Pete Hunt
d44b6c41d2 Merge pull request #1406 from petehunt/testperf
Improve `grunt test` performance
2014-04-14 13:45:08 -07:00
petehunt
2220f0478c Drastically improve test performance 2014-04-14 11:32:36 -07:00
Cheng Lou
b9c50ee8fd Merge pull request #1403 from spicyj/keyword-spacing
Make code spacing more consistent
2014-04-14 11:06:11 -07:00
Paul O’Shannessy
4c7422f4d3 Merge pull request #1384 from chenglou/render-docs
[Docs] Rendering null/false and getDOMNode
2014-04-14 10:15:14 -07:00
Paul O’Shannessy
34c9e142dc Merge pull request #1386 from georgesisco/master
In the tutorial, carry ajax error checking from step 13 forward to other ajax steps
2014-04-14 10:14:35 -07:00
Laurence Rowe
b5017c26b4 meta http-equiv attribute name 2014-04-13 17:56:03 -04:00
Cheng Lou
ea361e884e Merge pull request #1284 from plievone/directives-2-commands
[addons] Renamed update() directives to commands
2014-04-13 14:25:38 -07:00
Ben Alpert
f923933ef3 Make code spacing more consistent
I'm a little surprised we don't have lint rules for this.
2014-04-13 14:25:11 -07:00
Cheng Lou
716dcead3a Merge pull request #1405 from spicyj/css-tests
Restore CSSTransitionGroup tests
2014-04-13 14:23:53 -07:00
Cheng Lou
3c27f8564d Merge pull request #1324 from jordwalke/executeDispatchesInOrder
Make EventPluginUtils clear dispatchIDs and dispatchListeners
2014-04-13 00:23:26 -07:00
Ben Alpert
b918f7fc07 Restore CSSTransitionGroup tests
Not sure what happened here.

Test Plan: grunt test
2014-04-12 17:05:29 -07:00
Ben Alpert
382be4e9e9 Improve error for nested render calls
In the future we could consider wrapping the entire public API (renderComponent, setProps, setState, etc) in this check but this should do for now.

Test Plan: grunt test
2014-04-12 15:37:48 -07:00
Cheng Lou
775d2a3952 Merge pull request #1184 from spicyj/setInnerHTML
Consolidate innerHTML setting logic
2014-04-12 00:58:37 -07:00
Ben Alpert
534e7c06e9 Consolidate innerHTML setting logic
See https://github.com/facebook/react/commit/7eb33ef#commitcomment-5447724.
2014-04-12 00:41:54 -07:00
Cheng Lou
ed1b4dbfb5 Merge pull request #1394 from spicyj/gh-1164
Add test for isValidDescriptor
2014-04-11 20:48:29 -07:00
Cheng Lou
f4f6b055df Merge pull request #1190 from spicyj/custom-set-null
Remove custom attrs properly when setting to null
2014-04-11 18:02:02 -07:00
Ben Alpert
b067556a93 Merge pull request #1390 from chenglou/doc-new-proptypes
[Docs] new PropType behavior
2014-04-11 17:42:27 -07:00
Cheng Lou
acc9bde1f3 [Docs] new PropType behavior
(Killed the TODOs since they're no longer valid).
2014-04-11 17:40:04 -07:00
Paul O’Shannessy
3e2182fd16 Merge pull request #1231 from spicyj/gh-1227
Batch updates caused by handlers in multiple roots
2014-04-11 17:16:04 -07:00
Paul O'Shannessy
3bf12bba0d add displayName to component spec functions
closes #992
2014-04-11 16:39:45 -07:00
Cheng Lou
d673e51044 Make PropType.object pass for Date and RegExp instances
8855d6153e gave more accurate error messages for date and regexp by returning 'date' and 'regexp' respectively from `getPropType`.
However, for the object primitive check, which compares the instance passed with `getPropType's` return string, `object` !== 'date'.
This adds special hanlding for those.
2014-04-11 16:39:02 -07:00
Paul O’Shannessy
ef81148b09 Merge pull request #925 from chenglou/rm-comm
[Docs] Remove comment section
2014-04-11 11:43:23 -07:00
Paul O’Shannessy
cb2e394b9c Merge pull request #1285 from justinj/weak-shape-checker
Add tests for oneOfType with shape
2014-04-11 11:38:05 -07:00
georgesisco
287db7017e Update tutorial.md 2014-04-10 14:51:10 -04:00
Matthew Dapena-Tretter
1c63a3a7f4 Test more falsey values 2014-04-10 09:21:56 -04:00
Matthew Dapena-Tretter
4b71cf2efe Combine valid value checks 2014-04-10 09:21:56 -04:00
Matthew Dapena-Tretter
77ae237be9 Rename CAN_BE_MINIMIZED to HAS_BOOLEANISH_VALUE 2014-04-10 09:18:39 -04:00
Matthew Dapena-Tretter
422a8d9c2c Support minimizable, non-boolean attributes
Fixes GH-1337
2014-04-10 09:17:39 -04:00
Matthew Dapena-Tretter
13351dd937 Test for correct handling of "download" attribute
These tests currently fail as there is no special treatment for this kind of
attribute.

Related: GH-1337
2014-04-10 09:12:35 -04:00
Cheng Lou
f728846712 docs remove comment section 2014-04-09 22:53:54 -07:00
Ben Alpert
697bf73c5f Add test for isValidDescriptor
Fixes #1164.

Test Plan: grunt test
2014-04-09 22:53:22 -07:00
Justin Jaffray
f88936977f Add tests for oneOfType with shape 2014-04-09 22:23:43 -07:00
Cheng Lou
e17222671e [Docs] Rendering null/false and getDOMNode. 2014-04-09 19:26:42 -07:00
Cheng Lou
8855d6153e Revamp and fix PropTypes
This uses the return value (an Error or nothing) to indicate whether a prop passes validation or not. It used to be done through calling `console.warn` as a side-effect, except this didn't work well with and `oneOfType`, which calls each validator.

The solution was to insert a `.weak` prop to each validator to suppress the warning message. This is overkill and also doesn't work well in because it increases the potential API surface. Plus, letting the validators warn it can't be easily used for logging, especially for custom validators.

So `.weak` is no longer needed: fixes https://github.com/facebook/react/issues/863.

Backward compatibility for custom validators: since they didn't return anything and directly call `console.warn` or something, this doesn't break them.

Improvements:

  - `arrayOf`, `oneOfType` and `oneOf` got better message now, since they can get hold of their validator's message and output that instead of a generic `warning: bla`.
  - More complete tests, including testing custom types and `isRequired` on everything.

Bug fixes:

  - oneOfType(...).isRequired didn't work. The workaround was to use `oneOfType(a.isRequired, b.isRequired, ...)`. This means `oneOfType(a.isRequired, b)` doesn't make sense. The new version simply makes `oneOfType(...).isRequired` possible.
  - `oneOf([true])` worked for 'true' boolean because it converted everything to string before comparing. It no longer does.
- `oneOf([true]).isRequired` didn't work.

(see #1294)
2014-04-09 18:50:53 -07:00
Cheng Lou
5a9d0c6a12 Update invalid render error message
forgot to update the message following the previous diff on rendering null.
2014-04-09 18:50:11 -07:00
Tim Yung
356e85cd6a Separate performanceNow into own project 2014-04-09 18:50:11 -07:00
Josh Yudaken
5c9d616735 Add start property that is used by the <ol> tag
Property was missing
2014-04-09 17:50:34 -07:00
George A Sisco III
af7ea7c999 Carry ajax error checking from step #13 forward to other ajax steps
The following steps also have an ajax function, but the 'error:' param
is gone after #13:
#14
#17
#19
#20
This may be superfluous, but it helped me find an error with something I
was doing - Namely, in my .json file, I had single line javascript
comments ("//") that I copied from the tutorial. I couldn't find the
issue on later steps, but was able to see my issue when the error
handler complained about an unexpected "/" in my file in step #13.
2014-04-09 13:42:13 -04:00
Ben Alpert
4f1ca0ee96 Merge pull request #1381 from marcinkwiatkowski/master
fix typo in 09.4-test-utils.md
2014-04-09 10:05:40 -07:00
Ben Alpert
ddf53f97f0 Share reconcile transaction in batched updates
Should make #1350 better and will also take away any performance hit from #1157.

Test Plan:
grunt test
2014-04-09 01:42:27 -07:00
Paul O’Shannessy
bff6d50796 Merge pull request #1364 from spicyj/key-collisions-2
Ignore children with clashing keys
2014-04-08 18:11:36 -07:00
Marcin Kwiatkowski
5167b7a5b2 fix typo in 09.4-test-utils.md 2014-04-09 01:31:02 +01:00
Paul O’Shannessy
debd3318c7 Merge pull request #1379 from fkling/patch-1
Update 05-reusable-components.md
2014-04-08 15:45:19 -07:00
Felix Kling
af79caf1aa Update 05-reusable-components.md
`any` also seems to accept primitive values, not only objects. And since we already have `React.PropType.object`, the description was confusing.
2014-04-08 15:43:24 -07:00
Christopher Chedeau
009be62906 Document multiple ways to insert comments in JSX 2014-04-08 15:24:09 -07:00
Paul O’Shannessy
ccafb030cb Merge pull request #813 from spicyj/e-view-detail
Normalize view and detail properties
2014-04-08 14:23:46 -07:00
Ben Alpert
348399a594 Let early returns do their thing 2014-04-08 14:08:16 -07:00
Ben Alpert
4d62e1ef59 Don't fail if target.ownerDocument is null
See f71dbab.
2014-04-08 14:08:16 -07:00
Ben Alpert
5fa001b12c Normalize view and detail properties 2014-04-08 14:08:16 -07:00
Cheng Lou
f0f59877aa Make rendering to null work and make it injectable
This allows render to return `null`. Under the hood, this renders a `script` tag.

closes #1127
2014-04-08 10:12:18 -07:00
Paul O'Shannessy
af3c04b43b Warn better for key issues
We weren't warning for key issues at the top level (renderComponent)
level at all. This makes us do that, even if it's not quite perfect.

closes #1351
2014-04-07 18:18:50 -07:00
Karl Mikkelsen
f0a8a397ac Link to Events from Forms
closes #1372
2014-04-07 17:47:41 -07:00
Paul O’Shannessy
127e964808 Merge pull request #1362 from spicyj/cb-queue
Make MountReady more reusable, reduce allocations
2014-04-07 15:46:34 -07:00
Paul O’Shannessy
7f9ab471ac Merge pull request #1365 from akre54/unminified-docs-js
Serve unminified react.js on docs site
2014-04-07 15:42:50 -07:00
Ben Alpert
216fcdeb42 Ignore children with clashing keys
Fixes #566.
2014-04-07 13:50:42 -07:00
Paul O’Shannessy
40cbc074ee Move complementary tools to wiki for easier management. 2014-04-07 12:56:38 -07:00
Pete Hunt
b75d11c603 Merge pull request #1356 from petehunt/server-rendering-example2
React server rendering example
2014-04-08 07:27:58 +12:00
Ben Alpert
6cafc638fa Don't forcibly wrap lines in git commit messages 2014-04-06 23:17:51 -07:00
Adam Krebs
a6211a0fd8 Serve unminified react on docs site. Fixes #1359 2014-04-07 02:13:59 -04:00
Ben Alpert
59d2420b05 Add clearer invariants to composite spec mixing 2014-04-06 21:16:38 -07:00
Ben Alpert
ec6da04f6a Make MountReady more reusable, reduce allocations
Test Plan:
grunt test
2014-04-06 17:06:12 -07:00
petehunt
9a78db3457 Initial add
Add readme

remove gitignore

fix graphic
2014-04-04 18:47:33 -07:00
Daniel Lo Nigro
21de5c816f ReactJS.NET blog post
Closes #1354.
2014-04-04 13:23:24 -07:00
Ben Alpert
ed0ef164c0 Fix appearance of code blocks in lists 2014-04-04 12:55:43 -07:00
Jeff Morrison
9c2b9b1eb6 Merge pull request #970 from syranide/jsxws
Normalize whitespace for transformed JSX code
2014-04-04 10:20:43 -07:00
Paul O’Shannessy
0617696ae4 Merge pull request #1251 from davidxi/patch-1
Update jasmine-support.js
2014-04-03 18:41:59 -07:00
Ben Alpert
933dde9c6d Batch updates caused by handlers in multiple roots
Fixes #1227.

It seems rare that event handlers in two roots nested in the DOM will update the same component in the same tick, but if that happens, the updates should be batched together.
2014-04-03 17:41:04 -07:00
Paul O’Shannessy
ed6f8aea77 Merge pull request #1258 from fisherwebdev/master
TodoMVC Flux Example
2014-04-03 15:10:42 -07:00
Paul O’Shannessy
4f6800c2a4 Merge pull request #1306 from twobit/master
Add dx and dy attributes for SVG text
2014-04-03 15:05:44 -07:00
Paul O’Shannessy
00aa33446b Merge pull request #1325 from venmo/add-scrolling-attribute
Add scrolling attribute for <iframe>
2014-04-03 09:56:07 -07:00
Paul O’Shannessy
079749bac6 Merge pull request #1338 from chenglou/tip-children
[Docs][Tips] Entry on this.props.children and tweak component ref entry
2014-04-03 09:30:53 -07:00
Paul O’Shannessy
0aba933911 Merge pull request #1313 from spicyj/ms-prefix
Support `ms` vendor prefix when generating markup
2014-04-03 09:25:41 -07:00
Ben Alpert
67ff4e5050 Add acknowledgement to Christopher Aue 2014-04-03 07:33:32 -07:00
Ben Alpert
2d66fc4518 Add callback to setProps docs 2014-04-02 15:01:50 -07:00
Sebastian Markbage
b44761135e Remove toJSON
This was temporarily needed since clone on mount introduced a cyclic reference
in __DEV__. This reverts that change since we now have descriptors.

To avoid a problem where toJSON may collide.
2014-04-01 17:07:57 -07:00
Paul O’Shannessy
8ccb363a8e Merge pull request #1308 from chenglou/pure
add `ReactComponentWithPureRenderMixin` to addons
2014-04-01 14:32:18 -07:00
Ben Alpert
e86f7671a0 Merge pull request #1345 from kmeht/referenceDoc
[docs] Amend "References to components" tip to mention descriptors.
2014-04-01 13:40:22 -07:00
Kunal Mehta
93a033a94f Remove erroneous line about static methods. 2014-04-01 13:36:56 -07:00
Kunal Mehta
d236a0538d Simplify comment. 2014-04-01 13:04:09 -07:00
Kunal Mehta
da27fb049a [docs] Amend "References to components" tip to mention descriptors. 2014-04-01 11:42:15 -07:00
Paul O’Shannessy
c8fc3e38ab Merge pull request #1329 from irae/transition-group-leftovers
Remove leftovers from ReactTransitionGroup rewrite
2014-04-01 10:16:53 -07:00
Paul O’Shannessy
a2ed61ee66 Update mailmap post 0.10 (see #1283) 2014-04-01 09:30:08 -07:00
Cheng Lou
dc7242c786 [Docs][Tips] Entry on this.props.children and tweak component ref entry
Component ref entry wasn't registered in nav_tips.
2014-03-31 19:13:16 -07:00
Ben Alpert
f63d0fe2b4 Merge pull request #1336 from Daniel15/making-zpao-happy
[Docs] Consistent use of self-closing tags in layout
2014-03-30 22:43:15 -07:00
Daniel Lo Nigro
306209be9e [Docs] Consistent use of self-closing tags in layout 2014-03-30 22:42:02 -07:00
Ben Newman
60d16be90b Merge pull request #1330 from spicyj/clone-imm
Clone objects in immutable tests.
2014-03-30 19:25:56 -04:00
Ben Alpert
42e20a1488 Fix jshint warnings in grunt/
Fixes #1052.

Test Plan:
jshint grunt
2014-03-30 16:09:08 -07:00
Cheng Lou
7cbbff01e7 Merge pull request #1334 from spicyj/non-numeric-top-level
Don't break on top-level non-numeric object keys
2014-03-30 14:03:18 -07:00
Ben Alpert
a89ed9b8dc Don't break on top-level non-numeric object keys
Previously, this threw (in `__DEV__` only) in `ReactCurrentOwner.current.constructor.displayName` because `ReactCurrentOwner.current` is null:

```
React.renderComponent(<div>{{1: <div />, 2: <div />}}</div>, document.body);
```
2014-03-30 13:55:45 -07:00
Christopher Chedeau
f99123b882 Merge pull request #1332 from chenglou/linter
[Jshint] Allow Jasmine globals in *-test.js
2014-03-30 13:13:49 -07:00
Stephen Murphy
468007612f Merge branch 'master' of github.com:facebook/react 2014-03-30 12:53:26 -07:00
Cheng Lou
09ca4a9c80 [Jshint] Allow Jasmine globals in *-test.js
Editors that inline lint use`.jshintrc and directly lint the open
*-test.js files. This makes those linters actually useful.
2014-03-30 12:52:49 -07:00
Ben Alpert
99e943dd13 Clone objects in immutable tests
Fixes #1314, fixes #1328.

Test Plan:
`grunt test`, `grunt test --debug` in Chrome and Firefox.
2014-03-29 17:01:23 -10:00
Irae
27ea2c7e51 Remove leftovers from ReactTransitionGroup rewrite
Looks like while rewriting @petehunt forgot to remove this block.
See: 9ac27cb551
This block used to contain the only `runNextTick` ocurrences in the whole project.
No tests broken after removal, no documentation affected.
2014-03-29 14:46:02 -07:00
Thomas Boyt
8a69b5bc98 Add scrolling attribute for <iframe> 2014-03-29 13:41:34 -04:00
Jordan W
08baa114cc Make EventPluginUtils clear dispatchIDs and dispatchListeners
The other dispatch utils clear these out and I found a bug where they weren't being cleared out.
I'm thinking this should probably be done in the `SyntheticEvent` constructor but at least this way it's consistent. Also, I know no one else uses `executeDispatchesInOrderStopAtTrue` except the `ResponderEventPlugin`.
2014-03-29 01:17:20 -07:00
Christopher Chedeau
70a8c55023 Merge pull request #1288 from vjeux/server_docs
Add client/server mention in componentDid/WillMount documentation
2014-03-28 23:24:20 -07:00
Christopher Chedeau
98ef7abb1a Merge pull request #1322 from spicyj/transformer-harmony
Add optional harmony support to browser transform
2014-03-28 23:22:17 -07:00
Ben Alpert
e6c93f9246 Add optional harmony support to browser transform
This mirrors the react-tools API; it doesn't include support (yet) for transforming `<script type="text/jsx">` blocks with the ES6 transforms, mostly because I don't have a good API in mind there.

Test Plan:
Ran

    JSXTransformer.transform("var two = () => 2;", {harmony: true}).code

in Chrome's dev console and got back some ES5 code.
2014-03-28 18:26:20 -10:00
Cheng Lou
999b4cf1a8 Merge pull request #1318 from spicyj/existence
Fix spelling of 'existence'
2014-03-28 20:27:38 -07:00
Ben Alpert
4cb83566e0 Merge pull request #1320 from gasi/patch-2
Fix minor typo in `update` `$push` directive
2014-03-28 13:35:04 -10:00
Daniel Gasienica
5fc2ecbe92 Fix minor typo in update $push directive 2014-03-28 16:33:03 -07:00
Josh Duck
e5c8831f90 Formatting
An extra "`" snuck in there.
2014-03-28 14:26:05 -07:00
Ben Alpert
c0de6b51ff Fix spelling of 'existence' 2014-03-28 10:44:03 -10:00
Paul O’Shannessy
a778bf2c51 [blog] The Road to 1.0 2014-03-28 13:38:28 -07:00
Paul O’Shannessy
7982ba0571 Merge pull request #1310 from plievone/patch-1
Fix hasOwnProperty check typo in mixStaticSpecIntoComponent
2014-03-28 13:09:14 -07:00
Isaac Salier-Hellendag
807e3dc423 BeforeInputEventPlugin: Support Opera <= 12
Add support for Opera <= 12 (Presto) in `BeforeInputEventPlugin`.

It turns out that Opera 12 has a `TextEvent` in `window`, but doesn't actually fire any input events. Even `input` apparently doesn't fire. Fall back to keypress handling in this case.
2014-03-28 12:33:10 -07:00
Sebastian Markbage
c40e06f728 First phase to true descriptors
This moves all convenience constructors to use frozen ReactDescriptors.
2014-03-28 12:32:53 -07:00
Tom Occhino
a91c9f38f8 Update CONTRIBUTING.md
Updating doc to point to the brand new CLA form at https://code.facebook.com/cla
2014-03-27 23:57:32 -07:00
Ben Alpert
6406183f78 Support ms vendor prefix when generating markup 2014-03-27 19:46:02 -10:00
Paul O'Shannessy
fe9cecd507 Clean up assertions on descriptors
By making this fail, we catch a lot of tests that are expecting rendered
instances but are actually operating on descriptors.
2014-03-27 13:41:18 -07:00
Pete Hunt
976826aec0 Remove extraneous assert 2014-03-27 13:41:10 -07:00
plievone
65d16883a5 Fix hasOwnProperty check typo in mixStaticSpecIntoComponent 2014-03-27 21:21:12 +02:00
Cheng Lou
858fd2e4e2 Merge pull request #1309 from spicyj/dom-arg-order
Fix docstring arg order in createDOMComponentClass
2014-03-27 11:42:52 -07:00
Cheng Lou
0a483e3799 add ReactComponentWithPureRenderMixin to addons 2014-03-27 11:27:45 -07:00
Ben Alpert
3cdef1a86a Fix docstring arg order in createDOMComponentClass 2014-03-27 08:27:19 -10:00
Stephen Murphy
94c2f961fd added dx and dy for laying out text with relative offsets 2014-03-26 16:57:50 -07:00
fisherwebdev
85339bfdae TodoMVC Flux Example 2014-03-26 12:13:17 -07:00
Isaac Salier-Hellendag
5476f9168b Repair spacebar textInput
Browsers that natively support the `textInput` event appear to have a bug: when preventing default behavior for a `textInput` event occurring for a spacebar keypress, the character is prevented from being inserted **but the browser scrolls down**.

Minimal repro example: http://jsfiddle.net/salier/bX4fw/

This is ridiculous, since scrolling makes no sense when the user is focused in a textinput or contenteditable. Preventing default at the `textInput` stage should mean to prevent the character from being inserted, and should have no impact at all on scrolling behavior. I have filed this as a Chromium bug (https://code.google.com/p/chromium/issues/detail?id=355103) but I'm not going to hold out much hope that they'll fix it.

To resolve this, I'm special-casing the spacebar character at the plugin level, in `BeforeInputEventPlugin`. I looked for ways to do this at the component level, but it seems to me that this is simply a browser bug and it's cleaner to handle it there.

In browsers that can use the native `textInput` event, I'm checking the code of the pressed key. If it's the spacebar, we dispatch the synthetic event as if there were no native `textInput` event -- as if we were running Firefox. Then, if the synthetic event is not canceled and we make it through to the native `textInput` event, bail if the character data is a space character.
2014-03-25 13:05:44 -07:00
Cheng Lou
09333a3819 Remove last uses of {' '} in docs and tests
Whitespace fix is in, so no need for {' '} anymore.
2014-03-25 13:05:44 -07:00
Cheng Lou
edc0fa4c3f assertValidProps for updating DOM components through renderComponent
`renderComponent(<div style={invalidType}/>, container)` throws correctly,
but not when it's called a second time (i.e. updating rather than mounting).
It goes through `ReactDOMComponent.updateComponent` but there wasn't a
props assertion there.
(Removed the assertion in `receiveComponent`)
2014-03-25 13:05:44 -07:00
Isaac Salier-Hellendag
116ee058eb TextInputEventPlugin, SyntheticTextInputEvent
This diff introduces `TextInputEventPlugin` and `SyntheticTextInputEvent`, which are based on Webkit's native `textInput` event.

In Chrome, Safari, and Opera, the `textInput` event fires prior to the insertion of character data into the document. For normal typing, for example, thevent sequence is: `keydown`, `keypress`, `textInput`, `input`, `keyup`. The `textInput` event contains a `data` field corresponding to the character data that will actually be inserted.

There is also a `beforeinput` event described by http://www.w3.org/TR/DOM-Level-3-Events/#event-type-beforeinput, and this is essentially that event, so it may make sense to rename the plugin.

This event is especially useful because it solves a number of issues we can't currently handle with only keypress and composition events:

  - **Windows Chrome: Trailing characters discarded in Korean IME.** For instance, `안녕하세요` becomes `안녕하세` with the final character discarded by the final `compositionend` event. The `textInput` event fires correctly with the final character.
  - **Windows Chrome: Special characters discarded in IME.** Certain ideographs are discarded in IME mode. In Japanese, typing the ideographic space character is not represented by keypress but //is// represented by the subsequent `textInput`. This issue also applies to punctuation characters in Chinese.
  - **OSX Chrome: Characters from palette discarded.** Inserting characters from the OSX character palette fails, since no keypress is fired.

The plugin is useful for Firefox and IE. For these, we record inserted characters via keypress and compositionend events and dispatch the synthetic event with these characters as the `data` field to match the native `textInput` event.

  - Firefox has no corresponding `textInput` event and has not yet implemented `beforeinput`.
  - IE has a native `textinput` event, but it fires after the DOM mutation has already occurred, so it isn't very useful as an analog to the Webkit version. I'm just not going to bother with it.
2014-03-25 13:05:44 -07:00
Christoph Pojer
f10f32aaaf Remove objMapKeyVal 2014-03-25 13:05:44 -07:00
Christoph Pojer
6cbeee1e59 Rename objMap to mapObject
mapObject fits better with other module names ("flattenChildren", "traverseAllChildren" etc.) and highlights that it only works with objects - which is going to be more important once we'll have an ES6 Map polyfill.
2014-03-25 13:05:43 -07:00
Mark IJbema
89a2157914 Only stop if the transition on this element ended
This way it doesn't end when some random element elsewhere on the page has an ending transition.

It must be noted that this is not a complete fix. If you have multiple transitions on the element, it still ends when the first ends.

I ran into this not working (the transition ends almost immediately, because some unrelated transition ends). This fixes it for me, but I was wondering whether this cornercase was considered, and whether the other cornercase (multiple transitions) was considered.

I think it's very hard to get this correct, and think it might be better to make the timeout explicit, or at least allow to set it explicit, and fall back to this behaviour. But I'm really interested in feedback on this one.
2014-03-25 15:02:12 +01:00
Christopher Chedeau
e55b9aa059 Add client/server mention in componentDid/WillMount documentation 2014-03-22 12:18:12 -07:00
plievone
c5bf2ada4b [addons] Renamed update() directives to commands 2014-03-22 01:40:05 +02:00
Paul O’Shannessy
f0eae5086b version bump for 0.11 development 2014-03-21 14:58:52 -07:00
Paul O’Shannessy
aea3949062 0.10 release materials 2014-03-21 14:57:03 -07:00
Paul O’Shannessy
3b2d176f59 Update AUTHORS for 0.10 2014-03-21 13:21:20 -07:00
Pete Hunt
68da0eccbe Merge pull request #1282 from jeffbski/addCodewinds004Videos
add CodeWinds episode 4 w/Pete Hunt to videos
2014-03-21 12:54:48 +00:00
Jeff Barczewski
593889b87a add CodeWinds episode 4 w/Pete Hunt to videos
Added to videos.md
2014-03-21 07:41:06 -05:00
Paul O’Shannessy
732f4717a6 Merge pull request #1186 from chenglou/doc-toString-opt
[Docs] document optional param for renderComponentToString
2014-03-20 17:28:51 -07:00
Ben Newman
7807413256 Upgrade Commoner to v0.9.2 to silence deprecation warnings.
Closes #1278.
2014-03-20 14:43:47 -04:00
Ben Alpert
ec893833ee Merge pull request #1273 from wincent/typo-fix-02
Fix a minor typo in the `update()` docs
2014-03-19 15:37:30 -07:00
Greg Hurrell
5aaf4dbae9 Fix a minor typo in the update() docs 2014-03-19 15:33:43 -07:00
Paul O’Shannessy
ecea2918cf 0.10rc blog post 2014-03-18 22:15:16 -07:00
Paul O’Shannessy
7f24943e5a update version for 0.10rc 2014-03-18 22:09:32 -07:00
Paul O’Shannessy
0491d30e7c re-enable moved root warning 2014-03-18 22:03:25 -07:00
Paul O’Shannessy
55b0222596 Upgrade browserify 2014-03-18 21:33:39 -07:00
Paul O’Shannessy
b95fbbe4a2 Silence tests unsupported in PhantomJS.
These tests can still be run in the browser using `grunt test --debug`.

This is a repeat of 42f8d155f8. For posterity, we
do this because Phantom has a problem with Object.freeze and the test runner
can't do __DEV__ right (because we get rid of that in the build step).
2014-03-18 17:48:16 -07:00
Kunal Mehta
e505e47e01 Separate immutable project
This moves Immutable and Immutable object into the new `immutable` project.
2014-03-18 15:03:26 -07:00
Sebastian Markbage
e0c487649d Logging use of objects as maps for children
Let's start logging objects as maps for children. We may want to deprecate this
and replace it with ImmutableMap and Map data structures instead.

This should ideally be logged in the recursive function but since that loses the
scope of where these children are passed it's easier to start tracking them
here to get an idea of how frequently and where it's used.
2014-03-18 15:01:51 -07:00
Andrew Zich
22057ef61c don't try to use Object.prototype methods as transfer strategies in ReactPropTransferer.mergeProps
While looking up a detail of how `transferPropsTo()` works I noticed that we never check `TransferStrategies.hasOwnProperty(thisKey)` when merging props, just `newProps.hasOwnProperty(thisKey)` and a truthy test for `TransferStrategies[thisKey]`. This means that if our `newProps` has keys like `toString`, `valueOf`, or `constructor` etc. set, we will pull these functions off `TransferStrategies` and invoke them when merging props. In most cases this will just result in a failure to merge and some code without side effects being run but in the case of `valueOf` it will actually generate an exception.
2014-03-18 15:01:46 -07:00
Josh Duck
0278f01d95 Replace function expression with for loop
isCustomAttribute used an anonymous function in place of a for loop.
Swap it out so we're not allocating unnecessarily.
2014-03-18 14:57:08 -07:00
Kunal Mehta
0cec4af8d7 Sync latest Immutable changes 2014-03-18 14:57:04 -07:00
Paul O’Shannessy
8d495f3b6e Revert "Merge pull request #1234 from RReverser/pure-cjs"
This reverts commit 7987e6a51d, reversing
changes made to d88d479685.
2014-03-18 11:25:21 -07:00
Ben Newman
7987e6a51d Merge pull request #1234 from RReverser/pure-cjs
Switched from browserify to pure-cjs bundler.
2014-03-18 12:04:58 -04:00
Paul O’Shannessy
d88d479685 Merge pull request #1193 from spicyj/jsx-polygon
Add polygon tag to transform
2014-03-17 10:07:23 -07:00
Ingvar Stepanyan
3f3187c14f Renamed commojs task to bundle, added failing build if bundler failed. 2014-03-17 16:53:02 +02:00
Ben Alpert
c1443e92e6 Merge pull request #1226 from LilyJ/master
included link to React devtools in tooling-integration. fixes #791
2014-03-16 22:42:14 -07:00
Paul O’Shannessy
52e8f3fdb0 Merge pull request #1248 from asolove/svg-text-anchor
Add svg text-anchor attribute
2014-03-16 22:33:00 -07:00
Paul O’Shannessy
cdf4f07a15 Merge pull request #1229 from spicyj/no-jsx
Avoid JSX in ReactCSSTransitionGroup code
2014-03-16 22:31:24 -07:00
Paul O’Shannessy
6ff116e34b Merge pull request #1262 from vjeux/harmony-react-to
Add support for {harmony: true} to react-tools
2014-03-16 22:30:30 -07:00
Pete Hunt
d889a01caf Fix ref behavior for remounting
I'm thinking that setting up `this.refs` in `mountComponent` is better than `construct`. Followed the same pattern as `ReactComponent.Mixin` and nulling out
the value in `construct` and setting it to its initial value in `mountComponent`.
2014-03-16 22:01:54 -07:00
Pete Hunt
04f9887f0e More actionable error message for <tbody> and nested <p>
This bites people all of the time. Until we have a better solution, let's just make the error message more actionable (most people don't know how the DOM
gets unexpectedly mutated).
2014-03-16 22:01:34 -07:00
Sebastian Markbage
9b427a322f Fix some invalid uses of instances
Breaking this out of the other code mod.
2014-03-16 22:01:30 -07:00
Sebastian Markbage
7bbdcdba96 Reassign variable of rendered component
The component that gets passed into renderComponent isn't guaranteed to be the
instance that gets mounted. We want to clone the instance.

Unit tests need to reason about the mounted instance. The first code mod changes:

  ReactTestUtils.renderIntoDocument(<identifier>)

into

  <identifier> = ReactTestUtils.renderIntoDocument(<identifier>)

Using this scripts:

  scripts/bin/codemod -m -d ~/www --extensions js \
   '^(\s*)ReactTestUtils\.renderIntoDocument\(\s*([$a-zA-Z0-9_]+)\s*\)' \
   '\1\2 = ReactTestUtils.renderIntoDocument(\2)'

In the second case I do the same for React.renderComponent. However, there are
alot more unnecessary matches so I only codemod if the same identifier occurs
later in the file.

  scripts/bin/codemod -m -d ~/www --extensions js \
   '^(\s*)React.renderComponent\(\s*([$a-zA-Z0-9_]+)\s*?,(.*?\n?.*?\s\2\b)' \
   '\1\2 = React.renderComponent(\2,\3'

And one more for ReactMount.renderComponent used by internals.

  scripts/bin/codemod -m -d ~/www --extensions js \
   '^(\s*)ReactMount.renderComponent\(\s*([$a-zA-Z0-9_]+)\s*?,(.*?\n?.*?\s\2\b)' \
   '\1\2 = ReactMount.renderComponent(\2,\3'

This still matches many unnecessary cases where the second occurance of the
identifier is a redeclaration or comment. But this code mod doesn't hurt in
those cases.

Finally I have to do the same for:

  this.<identifier> = React.renderComponent(this.<identifier>,

This is a common pattern for production code but not tests. Some of these call
sites will likely break when we move to true descriptors.

  scripts/bin/codemod -m -d ~/www --extensions js \
   '^(\s*)React.renderComponent\((\s*)this\.([$a-zA-Z0-9\_\.]+)\s*?,' \
   '\1this.\3 = React.renderComponent(\2this.\3,'
2014-03-16 22:01:09 -07:00
Christopher Chedeau
5106b793f7 Add support for {harmony: true} to react-tools
```
require('react-tools').transform(code, {harmony: true});
```

now enables all the harmony es6 transforms that are supported.

This is modeled after https://github.com/facebook/react/blob/master/bin/jsx#L17-L23
2014-03-16 15:38:40 -07:00
Jonas Gebhardt
83e4ef16e6 Community Round-up #18 2014-03-14 16:56:12 -07:00
ray
f6a2888910 change some translation words 2014-03-13 23:28:50 +08:00
ray
b7471bcd93 add translation for getting-started.md 2014-03-13 23:19:29 +08:00
ray
93b6804912 make translation better 2014-03-13 21:12:25 +08:00
ray
3c9b797d21 fix ( 2014-03-13 21:00:25 +08:00
Paul O’Shannessy
308c9a0752 Merge pull request #1181 from lrowe/patch-5
omitClose for all void elements
2014-03-12 16:37:52 -07:00
davidxi
29abe53924 Update jasmine-support.js
fix typo in multiple error messages.
2014-03-12 14:39:14 -04:00
Adam Solove
6a01752f3d Add svg text-anchor attribute. 2014-03-12 10:07:05 -04:00
Andreas Svensson
60d7a02d44 Normalize whitespace for transformed JSX code 2014-03-12 10:03:16 +01:00
Ben Alpert
6fd53815cd Merge pull request #1246 from ericflo/patch-1
Remove Shirtstarter as an example application.
2014-03-11 15:48:20 -07:00
Eric Florenzano
3efa02da91 Remove Shirtstarter as an example application.
We have unexpectedly had to shut Shirtstarter down, so it won't serve as a good React.js example any more unfortunately -- sorry for the documentation churn.
2014-03-11 15:45:14 -07:00
Jeff Morrison
d9af091244 Merge pull request #1242 from syranide/jsxcomfix
Unbreak JSX comment comma fix
2014-03-11 10:13:24 -07:00
Ingvar Stepanyan
25773ed1b3 CommonJS builder config to Grunt style for easier handling and readability. 2014-03-11 13:40:38 +00:00
Ingvar Stepanyan
9e224e615f Renamed browserify tasks/configs to cjs, updated pure-cjs to 1.9.0 for better build speed. 2014-03-11 13:26:36 +02:00
ray
b0f9f73e91 Merge branch 'master' of github.com:rayqian/react
Conflicts:
	docs/docs/01-why-react.zh-CN.md
2014-03-11 17:52:20 +08:00
ray
c6a59c0ae6 fix some translation error 2014-03-11 17:51:09 +08:00
ray
69767d4b79 fix some translation error 2014-03-11 17:42:03 +08:00
ray
c3948483d9 add chinese translation for 01-why-react.md 2014-03-11 17:36:57 +08:00
Cheng Lou
3ce2cd04e2 Merge pull request #1243 from jeffcarp/master
Remove unused variable in ballmer-peak
2014-03-10 21:29:35 -07:00
Jeff Carpenter
652f5aea28 Remove unused variable 2014-03-10 19:48:13 -07:00
Andreas Svensson
280ff2e5a7 Unbreak JSX comment comma fix 2014-03-11 00:31:59 +01:00
Pete Hunt
5ede7fb619 ReactDOMComponent optimization
Slight optimization to not do unneeded reconciles of DOM components
2014-03-10 15:32:20 -07:00
Sebastian Markbage
3ea3274ca4 Clone on mount
This is the first step towards descriptors. This will start cloning the
component when it's mounted instead of mounting the first instance.

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

We don't need to clone the props object itself. Mutating the shallow props
object of a child that's passed into you is already flawed. Those cases need to
use cloneWithProps. A props object is considered shallow frozen after it leaves
the render it was created in.
2014-03-10 15:28:54 -07:00
Paul O’Shannessy
2ca810fbf3 Merge pull request #1225 from spicyj/cprop
Fix removing DOM property with mapped name
2014-03-10 11:29:10 -07:00
Pete Hunt
d9dd9d5cb3 Merge pull request #1235 from fxbois/master
Update 08-tooling-integration.md
2014-03-08 20:15:45 -08:00
fxbois
9ffd70c688 Update 08-tooling-integration.md
emacs compatibility
2014-03-08 18:12:05 +01:00
Ingvar Stepanyan
3171436d97 Switched from browserify to pure-cjs bundler.
Optimizations and fix for JSXTransformer build.
Dropped dependency on emulation of Node.js native modules.
Added deamdify step for JSXTransformer build.
2014-03-08 16:33:58 +02:00
Jeff Morrison
9ce7ecc3d9 Merge pull request #1219 from syranide/jsxempty
Fix empty JSX expressions sometimes emitting erroneous commas
2014-03-07 21:23:55 -08:00
Paul O’Shannessy
9f9c8bcebf Merge pull request #1228 from spicyj/grunt-debug
Bring back `grunt test --debug`
2014-03-07 11:18:29 -08:00
Ben Alpert
ec54dcbd8f Avoid JSX in ReactCSSTransitionGroup code
Supposedly we want these to be plain JS.
2014-03-06 22:16:25 -08:00
Ben Alpert
9766ed5797 Bring back grunt test --debug 2014-03-06 22:11:55 -08:00
Ben Alpert
1d209248ef Remove obsolete __VERSION__ references 2014-03-06 20:33:06 -08:00
Ben Alpert
21e06196cd Fix removing DOM property with mapped name 2014-03-06 17:50:01 -08:00
Lily
4b56947560 included link to React devtools in tooling-integration. fixes #791 2014-03-06 13:00:48 -08:00
Paul O’Shannessy
554b677e60 Merge pull request #1180 from evanc/master
Test that Node is a function before using instanceof on it
2014-03-06 11:02:28 -08:00
Andreas Svensson
aa70419f9d Fix empty JSX expressions sometimes emitting erroneous commas 2014-03-06 13:01:03 +01:00
Cheng Lou
af1b63456e Merge pull request #1222 from spicyj/npm-dl
[docs] Add more words to downloads page
2014-03-05 20:23:10 -08:00
Ben Alpert
ac3051530a [docs] Add more words to downloads page 2014-03-05 20:16:50 -08:00
Paul O’Shannessy
c5f56f318a Merge pull request #1208 from passy/patch-3
Fix docstring typo for pure render mixin
2014-03-05 19:13:22 -08:00
Paul O’Shannessy
be2c185888 Merge pull request #1211 from spicyj/freeze
Add Object.freeze to polyfill list
2014-03-05 12:18:20 -08:00
Paul O’Shannessy
7d0e6c6c0b Merge pull request #1192 from spicyj/srcset
Add srcSet attribute
2014-03-04 21:39:46 -08:00
Jing Chen
13aa8d37e6 Allow falsy values in statics
We found that the component would break if we set any statics with the
value 0. It turns out @chenglou already ran into this with
d71736b3ed but the statics code was copied
earlier, and still has this falsy check. Made the same change, updated
the unittest.
2014-03-04 18:15:49 -08:00
Kunal Mehta
06f762da77 Add Immutable
As titled. First of 3 diffs to add Immutable, ImmutableMap, and ImmutableObject. No logic changes.
2014-03-04 18:14:47 -08:00
Kunal Mehta
4ad320dd13 LegacyImmutableObject module
This copies the old implementation of ImmutableObject into LegacyImmutableObject.
2014-03-04 18:14:12 -08:00
Ben Newman
521201f121 Merge pull request #1215 from benjamn/fix-cloneWithProps-test
Fix stale usage of emptyObject in cloneWithProps-test.
2014-03-04 13:27:59 -05:00
Ben Newman
41d30bb7de Re-require cloneWithProps as well, for consistency.
And don't mock `emptyObject`, since that might actually replace it with a
mutable/non-frozen object.
2014-03-04 13:12:59 -05:00
Ben Newman
9c87aef67f Fix stale usage of emptyObject in cloneWithProps-test.
After we run `require('mock-modules').dumpCache()`, the object exported by
the `emptyObject` module will no longer be identical to previously
exported objects, so tests like `expect(component.refs).toBe(emptyObject)`
will fail.

Note that this behavior only manifests itself in tests, because of course
we do not call `dumpCache` in production code.

We could consider storing the `emptyObject` globally to thwart the effects
of `dumpCache`, but it's more idiomatic simply to re-`require` the latest
version of `emptyObject`.
2014-03-04 12:59:55 -05:00
Ben Alpert
c3cfcf073d Remove custom attrs properly when setting to null
I don't think this particular codepath was exercised at all (because all the callers call deleteValueForProperty) but this fixes a bug here nonetheless.
2014-03-03 17:43:03 -08:00
Ben Alpert
ec8b0d7fbf Add srcSet attribute
Chrome beta supports this now: http://blog.chromium.org/2014/02/chrome-34-responsive-images-and_9316.html.
2014-03-03 17:12:00 -08:00
Ben Alpert
e954a1c0d9 Add Object.freeze to polyfill list 2014-03-03 15:55:19 -08:00
Paul O’Shannessy
1d27770b40 Fix verion-check to look in right place for React.js 2014-03-03 15:35:10 -08:00
Paul O’Shannessy
4c4446d283 Sync more vendored modules 2014-03-03 15:34:14 -08:00
Pete Hunt
a8fc3b940d Move UI-thread-only browser modules to browser/ui/
This also deletes an unused module.
2014-03-03 15:07:11 -08:00
Pete Hunt
6666538316 Unbreak refs
If no refs are rendered, `this.refs` is undefined. This is bad since it deopts & is hard to look for. Instead we should make `this.refs` an immutable empty object.
2014-03-03 15:06:57 -08:00
Sebastian Markbage
620c1bc2ff Add more owner context to monitoring
Always include context and specifically include the component that was missing a key.
2014-03-03 15:06:39 -08:00
Cheng Lou
99dab49f92 Refactor rendering to string without checksum & React ID
Finalize API for rendering to static markup.
Instead of passing a boolean option to `renderComponentToString`, just use another method.
2014-03-03 15:06:27 -08:00
Pete Hunt
9b0534eb77 ReactRAFBatchingStrategy
This will go in React addons only for now until we figure out `pendingState`.
2014-03-03 15:06:14 -08:00
Sebastian Markbage
eee04b19e1 Add monitor module for logging instrumentation
This adds an instrumentation hook for logging so that we can monitor invalid API
usage before we're ready to issue a warning.

I took the opportunity to update some console.warns to use the warning module
instead. The remaining console.warns
will be replaced by the warning module after we've cleaned up the callsites.
2014-03-03 15:05:53 -08:00
Cheng Lou
f734083a17 Better name for server-side rendering without React ID & checksum
"staticMarkup" sounds way better than "noChecksumNoID".
Also avoids some double negations.
2014-03-03 15:05:35 -08:00
Christoph Pojer
3fe9f9f336 Fix ReactPropTypesTest
children should never be defined as propType, so changing the test to use an actual prop.
2014-03-03 15:05:26 -08:00
Jan Kassens
e39c19423a temporarily disable warning 2014-03-03 15:05:10 -08:00
Cheng Lou
6203e53d16 Fix IE8 disabled input throwing on focus
When IE8 focuses a disabled item, it throws
This makes sure the we're not focusing the item during selection restoration/autofocus when the element's disabled.
2014-03-03 15:04:34 -08:00
Ben Alpert
88a4a566ae Merge pull request #1209 from petehunt/thinking-in-react
Add thinking in react to the official docs + cleanup
2014-03-03 10:40:28 -08:00
petehunt
2f6656e3e9 fix 2014-03-03 10:39:41 -08:00
petehunt
a0ecf47242 Add thinking in react to the official docs 2014-03-03 10:37:33 -08:00
Cheng Lou
4b670a08fa Merge pull request #1207 from passy/patch-2
Add missing backtick in complementary-tools.md
2014-03-02 16:21:35 -08:00
Pascal Hartig
6b78cfb0f4 Fix docstring typo for pure render mixin 2014-03-02 22:18:10 +00:00
Pascal Hartig
8df5e55efd Add missing backtick in complementary-tools.md 2014-03-02 22:10:24 +00:00
Pete Hunt
237adacc3a Merge pull request #1204 from jmingov/patch-1
Updated React Version to 0.9.0
2014-03-01 17:01:12 -08:00
Pete Hunt
90e996324a Merge pull request #1203 from fson/jsx-integrations
Merge the lists of JSX integrations in the docs.
2014-03-01 14:24:58 -08:00
3boll
b2649dd73b Updated React Version 0.9.0
**Updated Url's:**

CDN:

    http://fb.me/react-0.9.0.js

    http://fb.me/JSXTransformer-0.9.0.js

Starter Kit

    http://facebook.github.io/react/downloads/react-0.9.0.zip
2014-03-01 21:12:17 +01:00
Ville Immonen
0217461d16 Merge the lists of JSX integrations in the docs.
There were these two lists of JSX tools at Complimentary Tools
and Tooling Integration, that were a bit out of sync with each other.

Bring them together and add a link to the former from the latter.
2014-03-01 16:50:40 +02:00
Pete Hunt
3c4f45fe45 Merge pull request #1200 from ericflo/patch-1
Add Shirtstarter to examples of production apps.
2014-02-28 13:42:28 -08:00
Eric Florenzano
6485e21956 Add Shirtstarter to examples of production apps.
Shirtstarter is 100% built on React.
2014-02-28 13:40:14 -08:00
Paul O’Shannessy
ae72e6ef91 Merge pull request #1082 from spicyj/class-false
Ensure className={false} turns into string 'false'
2014-02-27 16:41:41 -08:00
Ben Alpert
42444f6bb9 Add polygon tag to transform
Fixes #1144.
2014-02-27 12:32:24 -08:00
Cheng Lou
071d2a947c [Docs] document optional param for renderComponentToString 2014-02-26 15:11:53 -08:00
Ben Alpert
298a05517e Tweak propTypes examples for clarity in oneOfType 2014-02-26 15:03:47 -08:00
Laurence Rowe
cbfbb54c1d omitClose for all void elements
According to http://www.w3.org/TR/html5/syntax.html#void-elements the following elements should not specify end tags:

area, base, br, col, embed, hr, img, input, keygen, link, meta, param, source, track, wbr
2014-02-25 20:03:16 -08:00
evanc
26179d2b79 Test that Node is a function before using instanceof on it 2014-02-25 17:55:31 -08:00
Pete Hunt
ba78edbed8 Update complementary-tools.md 2014-02-25 17:01:00 -08:00
Paul O’Shannessy
34b6707132 Merge pull request #1166 from chenglou/docs-examples-consolidate
[Docs] Consolidate the two examples sections
2014-02-25 16:45:01 -08:00
Paul O’Shannessy
7b773a6b3d make <hasOwnProperty/> transform correctly 2014-02-24 18:03:02 -08:00
Paul O’Shannessy
1dfc5c79f9 Merge pull request #1148 from spicyj/jsx-constructor
Make JSX transform not break on 'constructor' attr
2014-02-24 17:20:25 -08:00
Ben Alpert
04111d5228 Add acknowledgements page 2014-02-24 17:18:57 -08:00
Jonas Gebhardt
a6c1b91c7d fix typo in community round-up #17 2014-02-24 15:27:02 -08:00
Pete Hunt
f34f0d2912 Update README.md 2014-02-24 14:25:09 -08:00
Pete Hunt
46cae63d2c Merge pull request #1156 from chenglou/1154
Remove TodoMVCs from examples/
2014-02-24 14:24:12 -08:00
Jonas Gebhardt
5049fc6b05 Community Round-up # 17 2014-02-24 14:20:17 -08:00
Pete Hunt
8b1279e6b2 Merge pull request #1174 from spicyj/addons-update
Add update() to React.addons
2014-02-24 14:10:07 -08:00
Ben Alpert
854d1f7c1b Add update() to React.addons 2014-02-24 14:05:29 -08:00
Pete Hunt
ab2d59f8b0 [addons] update() immutability helper
Dealing with immutable data is hard. This provides a simple helper (ported from the IG codebase) that makes dealing with immutable JSON data easier. Designed to be familiar for people who use MongoDB.
2014-02-24 13:58:51 -08:00
Cheng Lou
25cafec4a9 [Docs] Consolidate the two examples sections
Also made the formatting more consistent between complementary-tools and
examples.
2014-02-23 18:58:28 -08:00
Ben Alpert
61c287c5ea [docs] Fix version in lifecycle argument note
Fixes #1163.
2014-02-23 16:49:27 -08:00
Pete Hunt
7bba8c3257 Merge pull request #1155 from petehunt/update-helper
Add update() docs
2014-02-21 15:58:39 -08:00
Cheng Lou
2f0507f730 Remove TodoMVCs from examples/
Fixes #1154.
Added a README to point to TodoMVC's site instead.
2014-02-21 14:31:54 -08:00
petehunt
989f6f987d Add update() docs 2014-02-21 13:07:51 -08:00
Ben Alpert
e2b006f9ae .dataTransfer not .dragTransfer 2014-02-21 12:13:21 -08:00
Ben Alpert
141ff66986 Merge pull request #1150 from andreypopp/update-react-router-component-link
docs: update react-router-component link
2014-02-21 11:30:26 -08:00
Andrey Popp
da0b34e945 docs: update link for react-async 2014-02-21 18:30:19 +04:00
Andrey Popp
cbce621570 docs: update react-router-component link 2014-02-21 15:51:27 +04:00
Ben Alpert
472be09ff6 Make JSX transform not break on 'constructor' attr 2014-02-20 21:44:58 -08:00
Ben Alpert
7144a9f241 Merge pull request #1146 from dlau/patch-1
incorrect include in css transition group example?
2014-02-20 19:13:14 -08:00
Daryl Lau
8aaf5fdbf4 incorrect include in css transition group example?
TransitionGroup maps to ReactTransitionGroup, shouldn't it be a ReactCSSTransitionGroup?
2014-02-20 18:26:56 -08:00
Ben Alpert
445611f3e6 Add html5shiv to polyfill docs
cf. #1030
2014-02-20 17:21:41 -08:00
Pete Hunt
b79a3cbd21 Break more browser deps in core
This is part of what Sebastian suggested. We require it into every component that explicitly needs it and inject it as a default mixin for composite components in
the browser environment. This change frees us up to inject everything in ReactComponent.
2014-02-20 16:55:17 -08:00
Jason Bonta
0790040aac update docblock
...for typechecking.
2014-02-20 16:55:01 -08:00
Cheng Lou
2900997b5f Fix transaction test comments
Probably got copy/pasted in.
2014-02-20 16:54:52 -08:00
Cheng Lou
7eb33ef176 simplify mountImageIntoNode's way of putting markup in innerHTML
Instead of removing the node from the document before changing its innerHTML, just do it directly.
The comment seems to be outdated for years. http://jsperf.com/detach-while-setting-innerhtml
2014-02-20 16:54:43 -08:00
Cheng Lou
5545887a48 Allow rendering markup string without checksum and React ID
This fixes https://github.com/facebook/react/pull/994.
Also fixes https://github.com/facebook/react/issues/1079.
Server-rendering without ID/checksum now works. Also won't call didMount.
2014-02-20 16:54:20 -08:00
Paul O’Shannessy
e29584b49b Update authors 2014-02-20 15:20:27 -08:00
Jeff Morrison
c43b3f406c Merge pull request #1143 from jeffmo/npm_test
Add support for `npm test`
2014-02-20 13:15:09 -08:00
jeffmo
a4d6796705 Add support for npm test 2014-02-20 13:10:05 -08:00
Ben Alpert
89d4d352e1 Tweak tutorial wording to be more accurate 2014-02-20 11:40:14 -08:00
Paul O’Shannessy
f3c1383af9 Add context deprecation to changelog, reformat 2014-02-20 10:32:21 -08:00
Shaun Trennery
c32e398a5c Addition of 'this.context' component breaking change
this.context on components is now reserved for internal use by React

closes #1141
2014-02-20 10:32:12 -08:00
Paul O’Shannessy
95edc396df version bump to 0.10.0-alpha 2014-02-19 22:53:29 -08:00
Paul O’Shannessy
26cd595a98 update changelog 2014-02-19 22:17:28 -08:00
Paul O’Shannessy
8840ee32f1 Updated Authors 2014-02-19 22:11:50 -08:00
Paul O’Shannessy
bb729a5784 Merge pull request #1131 from spicyj/rel-notes-0.9-2
React v0.9 blog post
2014-02-19 21:47:29 -08:00
Paul O’Shannessy
b99705f690 Merge branch 'joshduck-patch-1'
Closes #989
2014-02-19 18:10:20 -08:00
Paul O’Shannessy
7e7aa21e24 tweak object property warning. 2014-02-19 18:07:24 -08:00
Ben Alpert
1de77f1fbe Ensure className={false} turns into string 'false'
Fixes inconsistency shown by http://jsfiddle.net/zpao/qeXLm/.
2014-02-19 13:47:35 -08:00
Ben Alpert
01b68c0e76 React v0.9 blog post 2014-02-19 12:05:47 -08:00
Paul O’Shannessy
e59daa8ed8 Add descriptions to package.jsons
Otherwise, npm just reads the first non-header of our readmes, which doesn't
match up accurately or cleanly (no markdown parsing).
2014-02-19 11:35:11 -08:00
Paul O’Shannessy
9b405fba24 Merge pull request #1135 from spicyj/testutils-docs
Update Simulate docs and reorg a little bit
2014-02-19 11:19:27 -08:00
Ben Alpert
99b80938af Update Simulate docs and reorg a little bit 2014-02-19 11:16:55 -08:00
Cheng Lou
e13977c0c2 Merge pull request #939 from spicyj/simulate-synthetic
Simulate synthetic events using ReactTestUtils
2014-02-19 10:58:54 -08:00
Ben Alpert
42473b2df1 Merge pull request #1133 from martinandert/repo-owner-change
complementary-tools repo owner changed
2014-02-19 00:48:15 -08:00
martinandert
970ae44c1f complementary-tools repo owner changed 2014-02-19 09:34:33 +01:00
Ben Alpert
a447d30a2e Rebuild simulators after injecting plugins 2014-02-19 00:28:34 -08:00
Ben Alpert
36e97bac21 Simulate synthetic events using ReactTestUtils
Most of the time this is what you want to do, so I've renamed what was Simulate to be SimulateNative.

Now Simulate.change does what you expect, so this fixes #517 and fixes #519.
2014-02-19 00:04:16 -08:00
Ben Alpert
9f9ee697f3 Simpler ReactTestUtils.simulateEventOnDOMComponent 2014-02-18 23:37:11 -08:00
Pete Hunt
58ffd39abf Merge pull request #1132 from petehunt/docs-clonewithprops
clone docs
2014-02-18 23:27:25 -08:00
petehunt
30faba394d clone docs 2014-02-18 23:26:51 -08:00
Pete Hunt
93e7778d5f Merge pull request #1112 from petehunt/testutils-addons
Add ReactTestUtils to addons
2014-02-18 22:58:30 -08:00
Pete Hunt
b7836c4da6 Merge pull request #1059 from petehunt/rtg-docs
Document ReactCSSTransitionGroup
2014-02-18 22:58:15 -08:00
petehunt
c2904b978e fix docs 2014-02-18 22:57:41 -08:00
petehunt
8122cadeb4 Add ReactTestUtils to addons 2014-02-18 22:54:24 -08:00
petehunt
ea803c47ba docs fixes 2014-02-18 22:51:51 -08:00
petehunt
42c837e4dd remove child factories 2014-02-18 22:48:52 -08:00
petehunt
cadd6cbb6c add ReactCSSTransitionGroup to addons and document it 2014-02-18 22:47:53 -08:00
Paul O’Shannessy
c0660ea6e0 Merge pull request #1100 from plievone/mapchildren-docs
Fix docs for React.Children.map, .forEach, .only.
2014-02-18 21:43:30 -08:00
Paul O’Shannessy
cb1f8247e5 Merge pull request #1130 from spicyj/if-attr-value
Don't break if no attribute value
2014-02-18 18:20:42 -08:00
Ben Alpert
e0dbca1168 Don't break if no attribute value
Fixes the transformation of things like `<button disabled>`.
2014-02-18 18:10:46 -08:00
Paul O’Shannessy
f81d16960c Merge pull request #1128 from spicyj/media-attrs
Add media element attributes
2014-02-18 18:04:43 -08:00
Paul O’Shannessy
8a47813baa Update copyrights for 2014.
grep -rl 'Copyright 2013 Facebook' static_upstream | xargs perl -pi -w -e s/Copyright 2013 Facebook/Copyright 2013-2014 Facebook/g;'

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

I didn't add `volume` because it requires more complicated logic to control properly and I didn't add `paused` because to set it we need to call play() or pause() -- perhaps a mutation method is appropriate.
2014-02-18 12:30:14 -08:00
Paul O’Shannessy
c79974db3a Merge pull request #1122 from spicyj/gh-1120
Strip calls to warning() in __DEV__
2014-02-17 19:44:53 -08:00
Ben Alpert
5795376961 Strip calls to warning() in __DEV__
Fixes #1120.
2014-02-17 19:01:45 -08:00
Pete Hunt
8ac5975ad8 Merge pull request #1106 from spicyj/gh-1105
Prevent error thrown when removing event target
2014-02-17 17:53:51 -08:00
Ben Alpert
d8fd1af4a0 Pool ancestors list so event system is reentrant 2014-02-17 16:37:15 -08:00
Ben Newman
f457df275d Merge pull request #1117 from andreypopp/envify-bump
Update envify to 1.2.0
2014-02-17 19:10:13 -05:00
Andrey Popp
39c9b539e9 Update envify to 1.2.0 2014-02-18 03:38:58 +04:00
Ben Alpert
ae7e44ec84 Add download and hrefLang attributes
Fixes #1115.
2014-02-17 15:13:14 -08:00
Pete Hunt
f73b894c37 Update complementary-tools.md 2014-02-17 10:42:09 -08:00
Pete Hunt
4642a70277 Update complementary-tools.md 2014-02-17 10:41:48 -08:00
Ben Alpert
2f0bb69708 Prevent error thrown when removing event target
Fixes #1105.
2014-02-17 10:33:34 -08:00
Pete Hunt
916776753f Merge pull request #1110 from dustingetz/master
Add wingspan-forms to complimentary tools docs
2014-02-17 09:51:43 -08:00
Dustin Getz
1b5af6b405 Add wingspan-forms to complimentary tools docs 2014-02-17 11:48:42 -06:00
Ben Alpert
9e160df868 Blog post for 0.9 release candidate 2014-02-16 18:47:04 -08:00
Paul O’Shannessy
9125f68194 0.9.0-rc1 2014-02-16 17:38:52 -08:00
Ben Alpert
9ebb40f013 Rename dir to npm-jsx_whitespace_transformer 2014-02-16 14:40:03 -08:00
Ben Alpert
7b5da078c6 Make transitions example use CSSTransitionGroup 2014-02-16 14:11:42 -08:00
Ben Alpert
1167aeb453 Expose cloneWithProps on addons
closes #1066
2014-02-16 14:08:05 -08:00
Paul O’Shannessy
6780b47526 Add CSSTransitionGroup to addons
Stealing part of #1059.
2014-02-16 14:04:29 -08:00
Paul O’Shannessy
3e77f64141 Merge pull request #1097 from spicyj/es3ify
Run es3ify over unminified builds
2014-02-16 12:49:16 -08:00
plievone
827c44fcd3 Fix docs for React.Children.map, .forEach, .only. 2014-02-16 22:41:30 +02:00
Pete Hunt
b7ba0f173e Update complementary-tools.md 2014-02-16 12:11:54 -08:00
Ben Newman
634e41788a Merge pull request #1099 from benjamn/make-ReactWebWorker-test-less-flaky
Make ReactWebWorker-test.js less flaky.
2014-02-16 13:58:00 -05:00
Ben Newman
47ae865428 Make ReactWebWorker-test.js less flaky.
Two improvements: make sure we set `done = true` when an error message is
received, so that the test output contains the error message instead of
eventually timing out and displaying nothing useful; and increase the
timeout for this particular test from 5000ms (the default) to 20000ms.
2014-02-16 12:57:14 -05:00
Ben Alpert
0d4213001b Fix typo in latest round-up 2014-02-15 22:53:42 -08:00
Ben Newman
1e7bdc79e1 Upgrade Commoner dependency to v0.9.1 to fix mkdirP bug. 2014-02-15 20:49:17 -05:00
Ben Alpert
e87c8a2aa4 Run es3ify over unminified builds
Makes no difference to react.js and react-with-addons.js; quotes .static in four
places for JSXTransformer.js:

https://gist.github.com/spicyj/aada5352e813752a4667
2014-02-15 16:32:36 -08:00
Paul O’Shannessy
d3c12487fd Update copyright header in browserify config
Part of #1006, but sooner.
2014-02-15 16:24:13 -08:00
Paul O’Shannessy
32e1d76612 Update AUTHORS for 0.9 2014-02-15 16:21:51 -08:00
Jonas Gebhardt
78ac842b4a Add community round-up #16 2014-02-15 15:50:30 -08:00
Paul O’Shannessy
9ebde97c14 Merge pull request #1096 from spicyj/comma-splice
Fix comma splice
2014-02-15 14:07:33 -08:00
Ben Alpert
2013db23d3 Fix comma splice 2014-02-15 13:58:57 -08:00
Paul O’Shannessy
e872cd0a7c Update vendored modules, delete unused
Closes #1090
2014-02-15 13:50:56 -08:00
Paul O’Shannessy
a34eed508a Merge pull request #1095 from jeffmo/sync_transforms
Sync out transforms from fb internal
2014-02-15 12:53:42 -08:00
JeffMo
adcbf0806c Sync out transforms from fb internal 2014-02-15 12:35:32 -08:00
Jeff Morrison
64afa545dd Merge pull request #1094 from jeffmo/jsx_whitespace_codemod_fixup
Pull in syranides jsx whitespace codemod transform fixes
2014-02-15 11:51:54 -08:00
JeffMo
f66f8f0310 Pull in syranides jsx whitespace codemod transform fixes 2014-02-15 11:20:32 -08:00
Jason Bonta
9ba014fbf1 Merge pull request #1081 from spicyj/textcontent
Avoid innerText for better newline behavior
2014-02-15 02:22:54 -06:00
Cheng Lou
d71736b3ed include mixin keys whose values are falsy
the previous behavior is to skip mixin keys whose values are `undefined`, `null`, `''` and (this is a bug) 0. Now, every key is included.
2014-02-14 16:53:34 -08:00
Pete Hunt
529c971db3 Merge pull request #1088 from petehunt/fixtests
Fix CSSTransitionGroup tests
2014-02-14 13:10:38 -08:00
petehunt
b65f5a4d30 fix tests 2014-02-14 12:55:03 -08:00
Cheng Lou
123ed1f442 Fix IE8 bug during unitless CSS props creation
IE8 goes into an infinite loop if we add props to the obj we're iterating through.
2014-02-14 12:41:44 -08:00
Ben Alpert
31bc18d39e Add simple docs on statics to reference section
Fixes #1056.
2014-02-14 11:54:58 -08:00
Cheng Lou
f4798ebee1 [Docs] Add Object.keys to list of shims 2014-02-14 09:52:04 -08:00
Ben Alpert
67c5d76321 Add missing commas in propTypes docs 2014-02-13 23:19:41 -08:00
Pete Hunt
a8af11b46d Merge pull request #1086 from spicyj/new-proptypes
Add docs for new prop types
2014-02-13 23:03:42 -08:00
Ben Alpert
30646c9c1e Add docs for new prop types 2014-02-13 22:59:48 -08:00
Ben Alpert
8c3ac3203d Merge pull request #940 from chenglou/tips-val
[docs] Document newly added unitless css props in tips
2014-02-13 22:40:51 -08:00
Cheng Lou
559933655a [Docs] Document newly added unitless css props in tips 2014-02-13 22:39:30 -08:00
Ben Alpert
0a9eaab61f [docs] Add properties that were in 0.8 too
This time I actually generated it from the DefaultDOMPropertyConfig file.
2014-02-13 22:02:06 -08:00
Paul O’Shannessy
cebc49e5e6 Merge pull request #1022 from spicyj/multichild-throw
Refactor ReactMultiChild to not throw errors too
2014-02-13 21:51:52 -08:00
Ben Alpert
f8349f9614 Add formNoValidate and noValidate too 2014-02-13 21:50:17 -08:00
Ben Alpert
80cbdea144 [docs] Update supported attributes list
Fixes #1008.
2014-02-13 21:47:49 -08:00
Ben Alpert
1991e46f1a [docs] Capitalize all nav titles for consistency 2014-02-13 21:41:09 -08:00
Ben Alpert
b98f1adf1a Avoid innerText for better newline behavior
Fixes #1080.
2014-02-13 21:31:32 -08:00
Paul O’Shannessy
05ee61d763 Merge pull request #1084 from spicyj/jsx-wh
Various fixes to whitespace transformer
2014-02-13 21:10:49 -08:00
Ben Alpert
cc010e3287 Support transforming multiple files at once 2014-02-13 19:15:59 -08:00
Ben Alpert
49ddf905b1 Use graceful-fs to avoid EMFILE errors 2014-02-13 19:15:59 -08:00
Ben Alpert
ecfd0c1473 Run over *.jsx as well 2014-02-13 19:15:59 -08:00
Ben Alpert
4a76b52751 Resolve paths relative to pwd, not npm install dir 2014-02-13 19:15:59 -08:00
Ben Alpert
940c86964d Rename run to run.js to avoid not-found errors 2014-02-13 19:15:39 -08:00
Ben Alpert
ac1c90e864 Tweak whitespace README to show other change 2014-02-13 19:01:04 -08:00
Jason Bonta
47645854f9 un-revert textContent, support multi-line strings in modern browsers
reverts 23ab30ff87 because the issue it fixed doesn't seem to be a problem
anymore. textContent should be better for more things anyway, as the
original 309a88bcf6 indicates. It should be faster because innerText
requires layout.

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

see https://github.com/facebook/react/issues/1080
2014-02-13 18:21:35 -08:00
Josh Duck
acbba1ae67 Updates to perf
ReactDefaultPerf:

* Show times as float instead of string. This means they're sortable.
* Add count columns to all types and average to exclusive time.
* Include mountComponent where updateComponent time is measured.
* Increment count on _renderValidatedComponent instead of update.

ReactDefaultPerfAnalysis:

* Return counts with all summaries.
2014-02-13 18:21:17 -08:00
Cheng Lou
5c953a7bdd Remove aural CSS numerial styles from CSSProperties
Those styles are not implemented in known browsers.
2014-02-13 18:21:03 -08:00
Paul O’Shannessy
d1a337b9db Move jsx_whitespace_transform
Also add readme and more details to package.json so it can be published.
2014-02-13 15:58:19 -08:00
Paul O’Shannessy
1012b2ff4b Merge pull request #979 from jeffmo/jsx_whitespace_codemod_tool
jsx whitespace codemod utility
2014-02-13 15:03:11 -08:00
Pete Hunt
6573a726ba Merge pull request #1075 from spicyj/defperf
Measure root component render in ReactDefaultPerf
2014-02-13 10:49:19 -08:00
Pete Hunt
a5c518f69a Merge pull request #855 from syranide/onerror
Add onError to ReactDOMImg to complement onLoad
2014-02-13 10:48:57 -08:00
Pete Hunt
f02c3c07d3 Merge pull request #1067 from spicyj/sandbox-seamless
Add seamless and sandbox properties for iframe
2014-02-13 10:48:37 -08:00
Pete Hunt
b04df6335a Merge pull request #1069 from spicyj/gh-1028
Assert that event listeners are real functions
2014-02-13 10:48:20 -08:00
Pete Hunt
fff48c5921 Merge pull request #1076 from spicyj/button-warn
Don't warn about onChange for button inputs
2014-02-13 10:48:07 -08:00
Andreas Svensson
cda1d8c779 Add onError to ReactDOMImg to complement onLoad 2014-02-13 10:43:03 +01:00
Ben Alpert
6f305505a7 Remove old whitespace doc warning
This was fixed by #480.
2014-02-13 01:37:06 -08:00
Ben Alpert
cd87848b7d Don't warn about onChange for button inputs 2014-02-13 01:16:37 -08:00
Ben Alpert
55be7a71c5 Measure root component render in ReactDefaultPerf
Fixes #1074.
2014-02-13 00:59:02 -08:00
Ben Alpert
f37474b75b Merge pull request #1034 from nadeeshacabral/patch-1
Fixed sample code fence highlight
2014-02-12 23:23:49 -08:00
Ben Alpert
b0757c5182 Assert that event listeners are real functions
Fixes #1028.
2014-02-12 23:21:46 -08:00
Ben Alpert
d0502cf3c1 Add seamless and sandbox properties for iframe
Fixes #1057.
2014-02-12 21:06:43 -08:00
Pete Hunt
3895353326 [perf] Refactor ReactDefaultPerf and add DOM operation tracing
Split the summary functions into a separate module, and add the ability to view a lot of all DOM operations. Removed DOM timing since it was incorrect. Will potentially replace with a
dropped frame counter in the future.
2014-02-12 16:35:24 -08:00
Jason Bonta
5abcce5343 add lineClamp, vendor prefixes to CSSProperty.isUnitlessNumber 2014-02-12 16:35:09 -08:00
Pete Hunt
75b58d2ad2 [perf] Wasted time metrics
This logs DOM ops for a given reconcile. Based on which components rendered and which ones *actually* caused DOM updates we can find
opportunities to add shouldComponentUpdate() methods.
2014-02-12 16:34:37 -08:00
Pete Hunt
94ef6c51fb [perf] Better inclusive measurements
Inclusive time is still not that helpful w/o looking at what actually resulted in DOM ops. However, this is better than what we have today and will serve as a building block.

I blacklisted everything but composite components -- hopefully that's OK.
2014-02-12 16:34:24 -08:00
Pete Hunt
439bca78ed [perf] New ReactDefaultPerf
Simplified version of https://github.com/facebook/react/pull/962. More goodies coming soon since the inclusive time isn't very helpful right now.
2014-02-12 12:30:02 -08:00
Pete Hunt
9ac27cb551 Rewrite ReactTransitionGroup
The key idea here is that you're always rendering `this.state.children`, not
`this.props.children`. When combined with `cloneWithProps()` this means we can
keep them in the DOM as long as we want. We add new children and reactively
update existing ones using `setState()` inside of `componentWillReceiveProps()`
so `this.state.children` always has the latest versions of components. Since we
may be keeping old components around that are no longer in
`this.props.children` we need a way to figure out where they should be inside
of the combined `this.state.children` list.  `ReactTransitionChildMapping` does
this for us.

Based on that infrastructure we can build the interface we always wanted: enter
and leave lifecycle hooks.

When a component is added to the DOM, `componentWillEnter(callback)` gets
called. Call the callback when you're done animating and `componentDidEnter()`
will be called.

When a component is about to be removed from the DOM,
`componentWillLeave(callback)` gets called. Call the callback when you're done
animating and `componentDidLeave()` will be called and the component will
*actually* be removed from the DOM. It won't be removed until you call the
callback.

These also handle "concurrent" changes. If you "stack" enter/leaves of a single
component before the animation has completed, it will block out all of those
animations until the current animation completes, and then finally it will
animate 0 or 1 times to get itself into the desired current state. This is what
differentiates `componentWillEnter()` from `componentDidMount()`.

The next step would be to build `componentDidReorder()`.

I've built `ReactCSSTransitionGroup` which is identical to the old
`ReactTransitionGroup` and codemodded the callsites.
2014-02-12 12:29:58 -08:00
Pete Hunt
a6749a686f [perf] Change how ReactDefaultPerf is injected
ReactDefaultPerf should inject itself when require()'d. This continues to support the ?react_perf use case for logging on initial page load.
2014-02-12 12:29:00 -08:00
Pete Hunt
12ebf33f89 [perf] Measure flush time
This is so we can look at a given flush to determine total time spent in React vs DOM, and which components ended up generating DOM ops.
2014-02-12 12:28:20 -08:00
Pete Hunt
d547374847 [perf] Log DOM time
Log the time it takes to perform all DOM operations
2014-02-12 12:27:53 -08:00
Pete Hunt
756bd975b1 [perf] Measure exclusive render time
Piece of https://github.com/facebook/react/pull/962
2014-02-12 12:27:18 -08:00
Paul O’Shannessy
da587b15d5 Merge pull request #1046 from spicyj/errutils
Disable guarding in ReactErrorUtils
2014-02-12 09:48:10 -08:00
Pete Hunt
db6ff14e7d Update videos.md
There is a better video clip for the Meteor devshop
2014-02-11 22:57:56 -08:00
Ben Alpert
8f298fbd69 Disable guarding in ReactErrorUtils
With #1021 and #1022, I believe this makes it so React never wraps user code in a try/catch. I left in the calls to ReactErrorUtils.guard because it sounds like FB code finds them useful.
2014-02-11 17:10:57 -08:00
Paul O’Shannessy
49747347fb Merge pull request #1048 from spicyj/form-onreset
Add onReset event for forms
2014-02-11 14:42:15 -08:00
Ben Alpert
35d9286781 Refactor ReactMultiChild to not throw errors too
Missed these when I fixed up Transaction; with the exception of ReactErrorUtils, this should be everything.
2014-02-11 10:14:20 -08:00
Paul O’Shannessy
8cf5882447 Merge pull request #1021 from spicyj/close-finally
Set isInTransaction to false even if close throws
2014-02-11 09:27:09 -08:00
Paul O’Shannessy
3f243bc4f9 Merge pull request #1055 from spicyj/jsx-transformer-ie8
Disable source maps when defineProperty is missing
2014-02-11 09:20:29 -08:00
Sebastian Markbage
fc2805fe03 Add warnings when accessing properties/methods on unmounted components
This creates a membrane around the React component prototype. It warns if you
try to access properties on the component before it's unmounted. Before it's
mounted, it should be considered a descriptor and not an actual instance.

The workaround, for unknown types, is to access the constructor using
component.type which has static methods on it.
2014-02-11 09:13:03 -08:00
Ben Alpert
89bcecc76f Disable source maps when defineProperty is missing
Fixes #1053.
2014-02-11 00:10:06 -08:00
Cheng Lou
0f4cc6ee84 [Docs] Hide compiled js tab in jsx-compiler.html
Fixes #1049
2014-02-10 23:22:59 -08:00
Pete Hunt
25e56a4540 Update complementary-tools.md 2014-02-10 21:16:13 -08:00
Paul O’Shannessy
66b290c32f Merge pull request #1042 from adelevie/master
Small grammar fix in ReactComponent.js
2014-02-10 16:18:55 -08:00
Paul O’Shannessy
6e5956195d Remove references to autoflow, error wrapper
Fixes #1023
2014-02-10 14:39:57 -08:00
Pete Hunt
c544b01cad Delete useless shit in ReactMount
lol
2014-02-10 14:31:15 -08:00
Pete Hunt
5f1d4d7c14 ReactInjection
Consolidate everything we can inject in core into one place. Does not expose publicly -- this is an internal moving of shit around.
2014-02-10 14:30:59 -08:00
Paul O’Shannessy
c1c2dd9a89 Add noValidate and corresponding formNoValidate
Fixes #988
2014-02-10 12:01:28 -08:00
Paul O’Shannessy
acfef143ae Merge pull request #1045 from spicyj/srcdoc
Add HTML5 srcdoc property for iframes
2014-02-10 12:00:43 -08:00
Ben Alpert
30fd3a30b0 Add onReset event for forms
Test Plan:
Tested in Chrome and IE8.
2014-02-10 11:12:26 -08:00
Pete Hunt
2e17144ac0 Update complementary-tools.md 2014-02-10 10:37:59 -08:00
Ben Alpert
40547125f8 Add HTML5 srcdoc property for iframes 2014-02-09 21:03:37 -08:00
Pete Hunt
eb3d516f40 Update complementary-tools.md 2014-02-09 19:18:11 -08:00
Alan deLevie
1194a040f9 remove comma in comment 2014-02-08 19:26:36 -05:00
Alan deLevie
42e65ddb3e Small comment grammar fix in ReactComponent.js 2014-02-08 19:25:49 -05:00
Paul O’Shannessy
141f3a8ac8 Merge pull request #1040 from zpao/react-tools-revamp
react-tools revamp
2014-02-07 13:59:56 -08:00
Paul O’Shannessy
d00b11ef03 Remove React from react-tools package
All of this is provided by the react package now, so there's no point in having
it available in multiple places. We *may* go back on that in the future for
shipping test utils, but for the time being, this is better for all.
2014-02-07 13:59:19 -08:00
Paul O’Shannessy
463f940c7f Build react-tools package on build, upload to builds site 2014-02-07 13:59:18 -08:00
Paul O'Shannessy
26fb009e0c fix comment 2014-02-07 13:51:39 -08:00
Cheng Lou
9ae002503c Ensure a pooled class releases back into the pool an instance of that class
Also added tests for PooledClass.

Noticed that some places use `ReactReconcileTransaction.release(transaction)`, when `transaction` might be of another class, say `ReactServerRenderingTransaction` (still a Github PR). This catches that.
2014-02-07 13:51:14 -08:00
Paul O’Shannessy
b199de29a0 Cleanup jsx tasks
debug and release are now identical, so there's no need to have both.
2014-02-07 10:21:19 -08:00
Ben Alpert
bc27325d31 Merge pull request #1003 from rdworth/patch-1
Update tutorial.md to still have jQuery script tag in later code sample
2014-02-07 00:08:22 -08:00
Paul O’Shannessy
d8700f04da Actually upload react.tgz to builds server 2014-02-06 23:59:58 -08:00
Ben Alpert
721ac85bf8 Merge pull request #1039 from imagentleman/patch-2
Update broken link in "Why React" post
2014-02-06 21:18:56 -08:00
imagentleman
3141bc5084 Update broken link in "Why React" post
The AngularJS docs have been updated since the post was originally published.

It should point to the docs from that date (June 5th).
2014-02-06 23:41:48 -05:00
Ben Alpert
bc1e950a41 Merge pull request #1038 from imagentleman/patch-1
Docs: Fixed reference to unreachable url.
2014-02-06 20:40:47 -08:00
imagentleman
e9e44773ee Docs: Fixed reference to unreachable url. 2014-02-06 21:32:30 -05:00
Paul O’Shannessy
94d11ecf05 build npm-react module, upload to builds page 2014-02-06 15:06:10 -08:00
cpojer
71c10b9f45 Add PropTypes.ArrayOf and clean up ReactPropTypes.js 2014-02-06 11:28:51 -08:00
Nadeesha Cabral
5f941628e0 Fixed missing lighted line
The line number added had been changed from the previous representation of the code fence, but was not highlighted. Therefore, fixed.
2014-02-06 19:11:19 +05:30
Ben Alpert
497dab2ad9 Merge pull request #1033 from bripkens/tostring-docs
docs(ServerRendering): Reflect renderComponentToString changes
2014-02-05 22:59:13 -08:00
Ben Ripkens
4c1a737343 docs(ServerRendering): Reflect renderComponentToString changes 2014-02-06 07:56:37 +01:00
Pete Hunt
73b4f954f2 DOMIDOperations -> BackendIDOperations 2014-02-05 19:47:54 -08:00
Paul O’Shannessy
4ebdb2c0ac Merge branch 'spicyj-uncontrolled-select'
Closed #907
2014-02-05 16:42:32 -08:00
Paul O’Shannessy
e0262d50f9 Skip assignment, just call updateOptions directly 2014-02-05 16:41:57 -08:00
Paul O’Shannessy
647e65525c Center twitter embeds differently. again.
This time, just target the iframe. display: table was weird in webkit.
2014-02-05 16:25:13 -08:00
Paul O’Shannessy
8360da2937 Don't use <center> for twitter embeds 2014-02-05 15:51:06 -08:00
Jonas Gebhardt
2f812b6f9b Community Round-Up #15; center embedded tweets 2014-02-05 15:19:53 -08:00
Ben Alpert
c7dd8d4217 Refactor updateOptions to take value 2014-02-05 11:46:34 -08:00
Ben Alpert
9c5c1ed902 Make uncontrolled select not set value on update 2014-02-05 11:39:44 -08:00
Paul O’Shannessy
7ad28183b4 Merge pull request #1019 from petehunt/docs99
Update docs for React.Children
2014-02-05 11:37:38 -08:00
Paul O’Shannessy
2031946946 Re-add strict warning to Danger test
Lost in the great reorg
2014-02-05 11:01:29 -08:00
Paul O’Shannessy
b9cd2f0d3d Merge branch 'reorg' 2014-02-04 19:51:55 -08:00
Paul O’Shannessy
2435b66840 Fix version check test 2014-02-04 19:49:58 -08:00
Paul O’Shannessy
a528beeda9 Put ReactWithAddons in browser/ 2014-02-04 19:49:58 -08:00
Pete Hunt
1a39c3143c The great reorg of February 2014 2014-02-04 19:49:58 -08:00
cpojer
a21979404c Add canUseEventListeners to ExecutionEnvironment. 2014-02-04 15:09:41 -08:00
Pete Hunt
9730759322 Fix cloneWithProps() to allow overriding props
This is a clear bug.
2014-02-04 14:37:53 -08:00
Pete Hunt
945f788a41 React.Children helpers
Adds React.Children and map(), forEach() and only().
2014-02-04 14:37:44 -08:00
Paul O’Shannessy
8d1d29286a Merge pull request #1013 from bripkens/lint
Fix use strict warnings
2014-02-04 12:39:41 -08:00
Ben Alpert
17f602f924 Set isInTransaction to false even if close throws
If a transaction wrapper's closer throws (such as flushBatchedUpdates in ReactDefaultBatchingStrategy) then we still want to properly deinitialize the transaction by setting isInTransaction to false. Without this, we can't reuse the transaction object (in this case, all future batched updates would fail because nested transactions aren't allowed).
2014-02-04 12:03:29 -08:00
Pete Hunt
7aaa3a4ed1 Merge pull request #922 from spicyj/submit-submit
Fix double-binding to submit event
2014-02-04 10:25:34 -08:00
Pete Hunt
3642b6ea62 Merge pull request #982 from bripkens/async-tostring
fix(ServerRendering): execution should be async
2014-02-04 10:24:22 -08:00
Paul O’Shannessy
bced44533f Merge pull request #967 from syranide/noie8catch
Remove unnecessary catch-clauses for try-finally
2014-02-04 10:11:06 -08:00
Andreas Svensson
f9bb6e46f1 Remove unnecessary catch-clauses for try-finally 2014-02-04 18:07:34 +01:00
Ben Ripkens
e14555caed Use lowercase "string" so that the documentation complies with typecheckers 2014-02-04 09:05:52 +01:00
petehunt
aebfd641aa more references 2014-02-03 23:33:20 -08:00
petehunt
9e1c6950b1 update docs for React.Children 2014-02-03 23:28:49 -08:00
Ben Ripkens
220687abda Add new lines above use strict and keep directives at the top 2014-02-04 07:47:35 +01:00
Pete Hunt
0dc0b45f3c Merge pull request #1018 from stoyan/patch-2
joe -> la web speed
2014-02-03 22:31:23 -08:00
Stoyan
c8a2018228 Update videos.md 2014-02-03 22:09:00 -08:00
Paul O’Shannessy
19ff353fdd Merge pull request #975 from spicyj/transaction-no-catch
Refactor Transaction to not rethrow errors
2014-02-03 21:43:27 -08:00
Paul O’Shannessy
4992423547 Merge pull request #1005 from jjt/boolattr
Fix boolean attributes as per HTML5 spec
2014-02-03 18:17:46 -08:00
Ben Newman
6d4b470cfc Merge pull request #1016 from benjamn/revert-pure-cjs-until-0.9
Revert commits switching from browserify to pure-cjs (on hold until after v0.9 ships).
2014-02-03 16:09:37 -08:00
Ben Newman
9f1ed709d0 Revert "Switched from browserify to pure-cjs bundler."
This reverts commit bff9731b66.
2014-02-03 19:05:22 -05:00
Ben Newman
77c53dd5d4 Revert "More optimizations and fix for JSXTransformer build"
This reverts commit f1b7db9aef.
2014-02-03 19:05:15 -05:00
Ben Newman
e994e06c54 Revert "Removed redundant uglification"
This reverts commit 86373d924c.
2014-02-03 19:05:09 -05:00
Ben Newman
806e879566 Merge pull request #1002 from RReverser/pure-cjs
Switch from browserify to pure-cjs bundler.
2014-02-03 16:01:13 -08:00
Pete Hunt
fa046ca04e Merge pull request #963 from bobeagan/patch-1
Replace "comments.json" with this.props.url in the docs tutorial code snippet
2014-02-03 15:08:17 -08:00
azure provisioned user
86373d924c Removed redundant uglification
Removed uglification for separate files since it significantly slowed down build (browserify:min became 26 sec instead of 110, same for :addonsMin) while gave economy in ~70 bytes for min+gz version.
2014-02-03 22:06:38 +00:00
Cheng Lou
5dabba999b add missing 'use strict' to getTestDocument 2014-02-03 12:52:46 -08:00
Cheng Lou
57bf7d21f3 fix transaction comment from componentDidRender to componentDidUpdate 2014-02-03 12:52:36 -08:00
Ben Newman
ce95c3d042 [React] Don't attach to document in ReactTestUtils.renderIntoDocument. 2014-02-03 12:51:34 -08:00
Ben Ripkens
92fdc1562d Use strict in tests 2014-02-03 20:29:33 +01:00
Ben Ripkens
4e9352f8f8 Fix use strict warnings 2014-02-03 13:11:51 +01:00
Ben Ripkens
cd2aecc377 fix(ServerRendering): execution should be sync
The documentation states that React.renderComponentToString
'uses a callback API to keep the API async', but the
implementation is actually synchronous. In order to maintain
this contract the callback should always be called
asynchronously or be change to a synchronous API.

As per the discussion of pull request 982, the API should
be changed to a synchronous one.
2014-02-03 11:39:09 +01:00
Pete Hunt
85270ae154 Merge pull request #1012 from jaredly/patch-1
adding a link to react-router
2014-02-02 13:34:58 -08:00
Jared Forsyth
92a20220e7 adding a link to react-router 2014-02-02 01:23:12 -07:00
Pete Hunt
e4d1618f63 Update example-apps.md 2014-02-01 18:43:12 -08:00
Christopher Chedeau
78f3addd01 Merge pull request #1011 from petehunt/complementary-tools
Add a complementary tools page
2014-02-01 18:36:45 -08:00
Christopher Chedeau
036303ee90 Merge pull request #1010 from petehunt/meteorvid
Add link to meteor talk
2014-02-01 18:35:43 -08:00
petehunt
26c6ea961b add example apps page 2014-02-01 18:11:00 -08:00
petehunt
aaada5e212 Add a complementary tools page 2014-02-01 17:43:56 -08:00
Pete Hunt
f18bda51d6 Update videos.md 2014-02-01 17:01:52 -08:00
petehunt
3119d66e26 Add link to meteor talk 2014-02-01 17:01:19 -08:00
Ben Alpert
98432365d9 [docs] Fix comma splice 2014-01-31 22:30:38 -08:00
Ben Alpert
a2e805b26e Disable CodeMirror smart indentation
Fixes #966.
2014-01-31 22:10:37 -08:00
jjt
f7949c1c23 Fix boolean attributes as per HTML5 spec 2014-01-31 17:24:48 -08:00
Paul O’Shannessy
fce6d114fe Merge pull request #973 from syranide/hidethekill
Fix references to the old ReactID syntax
2014-01-31 15:33:57 -08:00
Ingvar Stepanyan
f1b7db9aef More optimizations and fix for JSXTransformer build
* Dropped dependency on emulation of Node.js native modules.
* Added deamdify step for JSXTransformer build.
2014-01-31 21:53:08 +02:00
Christopher Chedeau
f1b54bc310 s/Mock DOM/Virtual DOM/
Let's be consistent with the naming
2014-01-31 10:57:06 -08:00
Richard D. Worth
e58064a8db Update tutorial.md to still have jQuery script tag in later code sample 2014-01-31 12:13:52 -06:00
Ingvar Stepanyan
bff9731b66 Switched from browserify to pure-cjs bundler. 2014-01-31 18:25:09 +02:00
Sebastian Markbåge
1666935878 Merge pull request #1001 from kmeht/renderComponentDocs
Add documentation about React.renderComponent
2014-01-30 17:29:59 -08:00
Kunal Mehta
43a242b67f Add documentation about React.renderComponent
Recently learned that components passed into `React.renderComponent` may not be the ones actually mounted. Also learned that it returns the mounted component. Added some documentation describing this.
2014-01-30 17:14:59 -08:00
Josh Duck
5d7563f706 Fix warning for numeric properties
Number('.1') === 0.1, and react uses dot-prefixed keys
for children. Whoops. Nuke the non-numeric requirement, and just
check a regex. This seems performant enough in micro-benchmarks:
http://jsperf.com/numericlike
2014-01-30 16:54:01 -08:00
Pete Hunt
4cbc4b58f6 Support children and ref for cloneWithProps()
We're not handling these correctly.
2014-01-30 16:53:47 -08:00
Pete Hunt
b225b34f91 Merge pull request #985 from petehunt/remove-react-page
Remove references to react-page
2014-01-30 10:40:48 -08:00
Pete Hunt
32f69713fc Merge pull request #995 from Contra/patch-1
fix grammar mistake (reconciliation docs)
2014-01-30 10:40:28 -08:00
Eric Schoffstall
cf1089fa0e fix grammar mistake 2014-01-29 20:19:51 -07:00
Josh Duck
00f2a053f0 Warn for numeric object properties
Numeric keys will be ordered sequentially in Chrome/Firefox.

Warn the user if such keys are set on a child.
2014-01-29 14:08:23 -08:00
Ben Newman
65490a09e6 Use querySelectorAll instead of getElementsByName in ReactDOMInput.
We've been able to use `querySelectorAll` in all the browsers that we
support for some time now, but we haven't been able to test code that uses
it in the older version of `jsdom` that we were using, until recently.

Besides the general goal of modernizing our code, the impetus for this
specific change is that I'm trying to support testing without having to
render nodes into an actual document. The `.getElementsByName` method is
only defined on `document` and only works if the nodes you care about are
contained by the document.

On the other hand, `querySelectorAll` works on any DOM node, and allows a
more precise selection of just the `<input type="radio">` elements that
have the appropriate name.

IE8's implementation of `querySelectorAll` supports attribute-based
selectors, which is all we need here.
2014-01-29 14:08:21 -08:00
Paul O’Shannessy
d8e9eb978b Fix animation example code
key should never be index into an array or there are bugs. Especially in
transitions.

Fixes #853
2014-01-29 13:06:22 -08:00
Pete Hunt
46c6ac5bb0 Update 09.2-form-input-binding-sugar.md 2014-01-29 12:45:46 -08:00
Pete Hunt
132e8b3c43 Merge pull request #880 from jbaiter/reactlink_checkbox
Support two-way binding for checkboxes in LinkedValueMixin via 'checkedLink' property
2014-01-29 12:44:30 -08:00
Ben Alpert
4894055114 Fix docs typo 2014-01-29 11:19:45 -08:00
Josh Duck
b5dbbd5b2d Add warning about object property order.
It's easy to misuse the properties-as-keys feature and end up with children rendered out of order. Add a note and example of how to avoid this.
2014-01-29 10:53:21 -08:00
petehunt
470a7d11ee remove references to react-page 2014-01-28 16:02:16 -08:00
Ben Newman
34e6a51e19 Merge pull request #981 from benjamn/upgrade-commoner-to-remove-output-directory-locking
Upgrade Commoner to v0.9.0 to get rid of output directory locking.
2014-01-27 19:21:32 -08:00
Ben Newman
933681b42c Upgrade Commoner to v0.9.0 to get rid of output directory locking.
Closes #957.
2014-01-27 19:07:00 -08:00
Ben Newman
0bca41fc93 Merge pull request #980 from benjamn/issue-856-delete-build-modules
Remove build/modules/ at beginning of `grunt` and `grunt test`.
2014-01-27 18:01:18 -08:00
Ben Newman
864366d082 Remove build/modules/ at beginning of grunt and grunt test.
Little-known fact: instead of writing copies of compiled module files to
build/modules/, the bin/jsx-internal script actually just makes hard links
to the master versions of files in the .module-cache/, so re-populating
build/modules/ is very inexpensive.

Closes #856.
2014-01-27 16:46:01 -08:00
JeffMo
f368f18b61 jsx whitespace codemod utility 2014-01-27 13:08:36 -08:00
Ben Newman
36fd1def84 Move grunt/config/jsx/jsx.js to grunt/config/jsx.js.
There used to be more files in that subdirectory.
2014-01-27 12:09:55 -08:00
Paul O’Shannessy
0e5dfd3fec Merge pull request #964 from bobeagan/patch-2
fix incorrect link
2014-01-27 11:26:33 -08:00
Ben Alpert
d300df51e1 Refactor Transaction to not rethrow errors
Rethrowing errors makes debugging harder. This makes it so that an exception in a render method can be caught using the purple stop sign (or the blue one, of course) in Chrome.
2014-01-26 15:51:37 -08:00
Andreas Svensson
989eb2e7d9 Fix references to the old ReactID syntax 2014-01-26 21:26:58 +01:00
Pete Hunt
526be1570e Fix memory leak with renderComponentToString()
This is leaking memory. Move event registration to mount time.
2014-01-24 18:23:51 -08:00
Bob Eagan
e3342f31b2 add hash link for lifecycle section of working with the browser page 2014-01-24 16:46:09 -07:00
Bob Eagan
4aececb645 fix incorrect link 2014-01-24 11:10:16 -07:00
Bob Eagan
7614af3c9a replace "comments.json" with this.props.url 2014-01-24 08:52:00 -07:00
Pete Hunt
4975113f20 Merge pull request #958 from aymanosman/master
Fix typo
2014-01-24 03:38:14 -08:00
Jeff Morrison
ce92efefc0 Codemod for whitespace change
This codemods to shim any old-style JSX whitespace so that it renders the same as before.
Basically it sticks explicit `{' '}` spaces in where spaces are no longer implicit.
2014-01-23 13:52:38 -08:00
Paul Shen
4a5a6ad733 Transfer the key prop in cloneWithProps
`cloneWithProps` uses `ReactPropTransferer`, which ignores the `key`
prop. See https://github.com/facebook/react/pull/713

However, this is not the case with `cloneWithProps` because when someone
is cloning a component and provides a key, they mean for the clone to
take it.
2014-01-23 13:48:39 -08:00
Pete Hunt
62b52e008e Don't reconcile children unneccessarily
We've talked about this perf optimization for a while now. This prevents us from re-reconciling components that are above the component being
reconciled in the owner hierarchy.
2014-01-23 13:48:36 -08:00
Ben Newman
b1e6c4d0dd Merge pull request #959 from benjamn/commoner-multiple-file-support
Upgrade Commoner to v0.8.14 for multiple file support.
2014-01-23 13:10:17 -08:00
Jeff Morrison
db04043eaa Merge pull request #480 from syranide/whitespace
JSX whitespace coalescing rules
2014-01-23 12:32:57 -08:00
Ben Newman
1e702f7258 Upgrade Commoner to v0.8.14 for multiple file support.
See [Commoner's README.md](
https://github.com/benjamn/commoner#generating-multiple-files-from-one-source-module)
for further explanation of the new functionality.

Among other potential benefits, this upgrade allows us to generate source
maps as standalone files rather than appending them inline to every
compiled module file under `build/modules/` (see #833).
2014-01-23 15:25:20 -05:00
Ayman Osman
97518fd664 Fix typo 2014-01-23 19:21:20 +00:00
Paul O’Shannessy
38491c7c93 Merge pull request #952 from jeanlauliac/patch-1
Update broken link in 'why react' article
2014-01-23 09:40:28 -08:00
Johannes Baiter
ad9c5e9242 Use Simulate.click instead of Simulate.input for simulating input on
checkbox.
2014-01-23 10:53:36 +01:00
Johannes Baiter
91ef878ca8 Fix comparison in _handleLinkedCheckChange 2014-01-23 10:53:36 +01:00
Johannes Baiter
2521b47707 Fix typo in ReactDOMInput-test 2014-01-23 10:52:55 +01:00
Johannes Baiter
79995a05c7 Add invariant if both checkedLink and valueLink are provided 2014-01-23 10:52:54 +01:00
Johannes Baiter
7b047111a0 Support two-way binding for checkboxes in LinkedValueMixin via 'checkedLink' property 2014-01-23 10:49:02 +01:00
Jean Lauliac
b872100be6 Normalize internal links in 'why react' article 2014-01-22 22:01:20 +01:00
Jean Lauliac
14cb99c9aa Update broken link in 'why react' article 2014-01-22 21:53:36 +01:00
Andreas Svensson
c16b5659a0 Implement stricter whitespace rules 2014-01-22 21:00:10 +01:00
Pete Hunt
0af9c3ebe7 Merge pull request #748 from spicyj/private-getvalue
Change LinkedValueMixin to a util class
2014-01-22 10:54:13 -08:00
Ben Alpert
95a80591dd Change LinkedValueMixin to a util class
This makes it clear that .getValue() is not a public API.
2014-01-22 09:57:59 -08:00
Paul O’Shannessy
f0b01d0faa Merge pull request #885 from syranide/natext
Remove unnecessary 'NA'-fallback for getTextContentAccessor()
2014-01-21 17:22:48 -08:00
Paul O’Shannessy
1d1a790df0 Merge pull request #901 from syranide/80chars
Fix lines longer than 80 chars
2014-01-21 17:09:24 -08:00
cpojer
ca02a068b8 Update propTypes documentation. 2014-01-21 16:45:34 -08:00
cpojer
8b12670ef9 Perf Test for the propTypes change. 2014-01-21 14:05:38 -08:00
cpojer
2cac321b27 Change ReactPropTypes invariant's to console.warn. 2014-01-21 14:05:33 -08:00
Paul O’Shannessy
9c91546451 Merge pull request #918 from spicyj/npm-react-rec
Fix copying files to build/npm-react recursively
2014-01-21 13:03:57 -08:00
Paul O’Shannessy
494f6e9c34 Merge pull request #921 from spicyj/grunt-jsx-no-dev
Remove unused grunt jsx config options
2014-01-21 11:40:43 -08:00
Pete Hunt
e3248efe92 Merge pull request #934 from syranide/minid
Shortened generated "data-reactid"
2014-01-20 13:26:42 -08:00
Andreas Svensson
559cd46181 Shortened generated "data-reactid" 2014-01-20 22:03:25 +01:00
Ben Alpert
e931dba107 Merge pull request #731 from fabiomcosta/jsxtransform-filename
Adds filename to JSXTransform error messages
2014-01-20 12:18:37 -08:00
Fabio M. Costa
de7a92afa7 Updating error message to also show part of the code, making it easier to find the error 2014-01-20 11:57:35 -08:00
Fabio M. Costa
d829d1ab9b Adding current page's url for inline code and code improvement 2014-01-20 11:57:34 -08:00
Fabio M. Costa
b1a949ed45 Adds the filename to JSXTransform error message, making it easier to debug JSX syntax errors. 2014-01-20 11:55:17 -08:00
Cheng Lou
4b392f19a8 Merge pull request #861 from andrewdavey/unitless-css-props
Unitless css props
2014-01-17 21:49:24 -08:00
Ben Alpert
ffc31ed77b Merge pull request #914 from chenglou/jsx
tweak frontpage first example code
2014-01-17 18:27:51 -08:00
Paul O’Shannessy
df8d092609 Merge pull request #924 from zpao/update-deps
Update build dependencies
2014-01-17 18:01:43 -08:00
Paul O’Shannessy
ca930efa7c Upgrade (explicitly) grunt
They deprecated the use of some packaged modules and suggest using those modules
directly. http://gruntjs.com/blog/2013-11-21-grunt-0.4.2-released

Lodash was the only use we had.
2014-01-17 18:00:40 -08:00
Paul O’Shannessy
9558285f09 Update other dependencies 2014-01-17 18:00:40 -08:00
Paul O’Shannessy
c5f0e14985 Update browserify
Also update bundle.transform call site, which now takes options
2014-01-17 18:00:40 -08:00
Cheng Lou
d8d4120614 [docs] Tweak frontpage first example and jsx-compiler example 2014-01-17 17:53:44 -08:00
Ben Alpert
ea711f1d62 Simplify live editor execution logic 2014-01-17 17:42:53 -08:00
Ben Alpert
4440486a24 Properly clear live editor on JSX compile failure 2014-01-17 17:42:40 -08:00
Nick Thompson
0d2510ad9c Add span property to React DefaultDOMPropertyConfig
So that the `span` attribute on <colgroup> tags isn't swallowed by
React.
2014-01-17 17:17:31 -08:00
Tim Yung
79beb71d69 Fix ChangeEventPlugin Dependencies
When React moved to attaching top-level event listeners on-demand, not all of the dependencies for `ChangeEventPlugin` were set. This led to `onChange` events not firing under certain circumstances. For example, listening to `onChange` on a checkbox will not work because it relies on `onClick` (unless something else on the page was listening to `onClick`).
2014-01-17 17:17:31 -08:00
Cheng Lou
d489637a4f Merge pull request #931 from spicyj/master
Update homepage for new JSX/JS editor
2014-01-17 16:56:40 -08:00
Ben Alpert
2ac36178c6 Update homepage for new JSX/JS editor 2014-01-17 16:46:50 -08:00
Paul O’Shannessy
487f633643 Normalize line endings 2014-01-17 16:28:32 -08:00
Paul O’Shannessy
8abca77381 .gitattributes to ensure LF line endings when we should 2014-01-17 16:25:53 -08:00
Cheng Lou
71b585325c docs add jsx->js tab to live editors 2014-01-17 15:49:59 -08:00
Sebastian Markbåge
a05cef4a40 Merge pull request #852 from spicyj/no-store-mount-image
Don't store mount image on component instance
2014-01-17 15:44:57 -08:00
Cheng Lou
4f53f58754 docs fix back link in Examples 2014-01-17 15:21:49 -08:00
Paul O’Shannessy
ef4bda326e Merge pull request #822 from chenglou/setstate
better error for bad setState arguments and mergeHelpers
2014-01-17 13:05:06 -08:00
Pete Hunt
804280275b Merge pull request #928 from nick-thompson/componentWillMount-descrip
Clarify componentWillMount behavior
2014-01-17 12:46:47 -08:00
Nick Thompson
c2d57dff4b Clarify componentWillMount behavior 2014-01-17 12:44:21 -08:00
Ben Alpert
c72e906841 Fix double-binding to submit event
Fixes #916.
2014-01-17 03:00:08 -08:00
Ben Alpert
703a29c0b2 Remove unused grunt jsx config options
Since 5466d0a063, the `__DEV__` isn't used any more. I can't find anything that uses the `debug` flag either.
2014-01-17 02:02:47 -08:00
Ben Alpert
76a7e2de75 Fix copying files to build/npm-react recursively
The intention of the `npm-react/**/*` rule was to copy recursively but it would have flattened any nested directory structure. I changed the `build/modules` rule to copy recursively as well, which is necessary for `ReactTestUtils` to be able to require `test/mock-modules.js` successfully. (`ReactTestUtils` isn't included in a clean `npm-react` build currently but it will be in the future.)

This also makes running ART tests more practical.
2014-01-17 01:15:15 -08:00
Christopher Chedeau
2562813c63 Document isMounted
Text from @petehunt
2014-01-16 10:08:53 -08:00
Jeff Morrison
89819de4f2 Kill last remaining use of $ in React
It's only used here, so let's just inline this and get rid of the additional module.
Also it will make people like this guy happy: https://github.com/facebook/react/issues/900

(of course he might be even more happy if he wasn't using MS TFS....but that's a much bigger diff, and not one I can write...)
2014-01-15 16:46:11 -08:00
Alex Zelenskiy
b5f905523b Adding 'scope' to list of standard html attributes in react
scope is used for screen readers, so it would be nice to have. Documentation here: http://www.w3.org/TR/WCAG20-TECHS/H63
2014-01-15 16:44:28 -08:00
Isaac Salier-Hellendag
4bdea53d6e Add topContextMenu to the event dependencies for SelectEventPlugin 2014-01-15 16:43:41 -08:00
Christopher Chedeau
9ade3c26d3 Introduce PropTypes.shape
This diff introduces PropType.shape which lets you type an object. PropType.object was already defined and since it isn't a function I couldn't really overload the meaning to also accept a type list. Instead of doing hackery, I decided to name it `shape`.

An example where this could be used is style:

```
  propTypes: {
    style: PropTypes.shape({
      color: PropStyle.string,
      fontSize: PropTypes.number
    })
  }
```
2014-01-15 16:42:04 -08:00
Cheng Lou
0906d282ec throw when using component/component class as mixin
throw invariant error to help people new to mixins, so that they don't get misled into trying to mixin components into another component
2014-01-15 16:41:45 -08:00
Paul O’Shannessy
8ca62bd022 [docs] Remove commented out ghbtns 2014-01-15 11:40:36 -08:00
Paul O’Shannessy
a69f98b834 [docs] Add timezone to _config
This way we hopefully won't churn the feed when genereated in
a different time zone (eg France).
2014-01-15 11:14:15 -08:00
Paul O’Shannessy
e1f4357ff7 Remove stray "117", combine lines in polyfill docs 2014-01-15 11:08:10 -08:00
Pete Hunt
615dedc3e2 Merge pull request #881 from spicyj/checkbox-not-checked
"checkbox" not "checked"
2014-01-15 11:04:36 -08:00
Pete Hunt
94727f8223 Merge pull request #897 from spicyj/gh-208
Wrap _performComponentUpdate call in try/finally
2014-01-15 10:38:26 -08:00
Christopher Chedeau
a821f03cf4 Merge pull request #892 from rtfeldman/update-shim-docs
Mention need for `es5-sham.js` in docs
2014-01-15 09:15:59 -08:00
Andreas Svensson
fd02f2c1cd Fix lines longer than 80 chars 2014-01-15 15:19:14 +01:00
Richard Feldman
c3a2ea2256 Rewrite Older Browsers polyfill section for clarity. 2014-01-14 21:59:53 -08:00
Timothy Yung
977b60c1ed Fix "Uncontrolled Components" documentation 2014-01-14 21:13:27 -08:00
Ben Alpert
091534c376 Wrap _performComponentUpdate call in try/finally
Fixes #208. If you attempt a state update with a bad state then the render will fail (and the DOM won't change) but if you switch back to a valid state later then it'll rerender properly.
2014-01-14 20:30:07 -08:00
Pete Hunt
17de85689e Merge pull request #895 from spicyj/zomgperf
Make findComponentRoot faster with more nodeCache
2014-01-14 18:58:54 -08:00
Paul O’Shannessy
b131da3869 Merge pull request #884 from spicyj/tut-datatype
Add dataType to all $.ajax calls for consistency
2014-01-14 18:48:05 -08:00
Ben Alpert
d96c6914c7 Make findComponentRoot faster with more nodeCache
This is an alternative, less-invasive, fix for #891.

Test Plan:
On http://jsbin.com/OqOJidIQ/2/edit, got timings like

[75, 56, 30, 36, 27, 27, 28, 32, 27, 27, 28, 31]

instead of the old

[75, 729, 46, 32, 28, 34, 26, 27, 27, 30, 26, 26].

I also added a counter to getID and saw it was called 3014 times instead of the old 636264. (3014 is the number of nodes (3000) plus 3 calls that happen for the initial render and 1 for each of the 11 renders after that.)
2014-01-14 18:32:40 -08:00
Richard Feldman
f62ec225e0 Fix typo in docs. 2014-01-14 17:09:39 -08:00
Richard Feldman
9420e86480 Update docs to mention that you need both es5-shim.js and es5-sham.js to use React with IE8. 2014-01-14 16:57:27 -08:00
cpojer
c885abbf21 Allow null return values for functions to-be-merged. 2014-01-14 13:05:31 -08:00
Andreas Svensson
6c7697a1a9 Remove unnecessary 'NA'-fallback for getTextContentAccessor() 2014-01-14 11:41:23 +01:00
Ben Alpert
eb2ac7f2f2 Add dataType to all $.ajax calls for consistency
Fixes https://groups.google.com/forum/#!topic/reactjs/WWA3ZqU6y4w.
2014-01-13 19:54:09 -08:00
Pete Hunt
d9b959884b Merge pull request #878 from spicyj/mount-unmounted
Improve "Can only mount when umounted" message
2014-01-13 14:38:07 -08:00
Ben Alpert
5857eb884c "checkbox" not "checked"
I can only assume this was a typo.
2014-01-13 14:28:56 -08:00
Ben Alpert
2f027fce2d Improve "Can only mount when umounted" message 2014-01-13 13:26:24 -08:00
Isaac Salier-Hellendag
ad70848e80 Use fallback data for composition events if necessary 2014-01-13 13:15:17 -08:00
Pete Hunt
c6f91ee6e8 Merge pull request #864 from spicyj/transition-key-set-faster
Rewrite mergeKeySets to be O(n) instead of O(n^3)
2014-01-13 12:50:42 -08:00
Christoph Pojer
ca1ecc626b Merge pull request #876 from spicyj/cb-ctx
Always call callback in component context
2014-01-13 09:04:33 -08:00
Ben Alpert
1825f30353 Always call callback in component context
This brings these other call sites in line with line 67 of ReactUpdates.js:

callbacks[j].call(component);
2014-01-13 08:59:48 -08:00
Christoph Pojer
124096a9fe Fix #845, Trivial year change
This was accidentally pulled into gh-pages.
2014-01-13 08:56:20 -08:00
Christoph Pojer
ad6a982cd0 Fix #874: Edit thinking-in-react
Accidentally pulled #874 into gh-pages.
2014-01-13 08:51:29 -08:00
Cheng Lou
3d47177596 fix propTypes.any.weak test
accidentally copied over `.string.weak` and didn't change it
2014-01-12 20:47:16 -08:00
Pete Hunt
ddcab8be99 Merge pull request #871 from fernandoacorreia/jquery-mobile-example
jQuery Mobile React Example
2014-01-12 13:03:36 -08:00
Fernando Correia
425fd2ca08 jQuery Mobile React Example 2014-01-12 17:04:42 -02:00
Paul O’Shannessy
59cba3e9f7 Add missing semicolon I missed in #865 2014-01-11 23:29:35 -08:00
Paul O’Shannessy
6ebb1cb3ee Merge pull request #865 from jergason/link-to-docs-on-keys-warning
link to docs in unique key prop warning
2014-01-11 23:21:46 -08:00
Jamison Dance
972acb4581 link to docs in unique key prop warning 2014-01-11 22:17:06 -07:00
Paul O'Shannessy
2c335b0e57 Quieter devtools upsell
Check that we're not in a iframe before upselling.
2014-01-10 21:11:33 -08:00
Cheng Lou
d14ce00dc3 add React.PropTypes.any
add the ability for React propTypes to accept an `any` type: `someProp: React.PropTypes.any`.
This is more useful when combined with `.isRequired`, to enforce that _something_ is passed:
`someProp: React.PropTypes.any.isRequired`
2014-01-10 21:11:11 -08:00
Pete Hunt
d8a8f6a881 Upsell dev tools
People probably don't know these exist. Add some information about React
dev mode as well as a link to the developer tools when using Chrome.
2014-01-10 21:10:54 -08:00
Tim Yung
bcacd17f8b Better LinkedValueMixin Warning
Input elements of type `checkbox`, `hidden`, or `radio` can have a `value` without `onChange`. Also, if the input is `disabled`, who cares that it doesn't have an `onChange`?
2014-01-10 21:10:01 -08:00
Tim Yung
f71dbab31a Fix Undefined ownerDocument Fatal in IE8
This fixes a JS fatal in IE8 when `topLevelTarget.ownerDocument` is sometimes undefined.
2014-01-10 21:07:23 -08:00
Tim Yung
73d9d286ee Fix EnterLeaveEventPlugin Test in jsdom
This is a follow-up to #803.

In jsdom (used for internal testing), `<iframe>` does not properly create a default document. This makes the `EnterLeaveEventPlugin` tests work for jsdom, too.

Open source does not need this because it uses PhantomJS.
2014-01-10 21:04:39 -08:00
Paul O’Shannessy
49d6d2169d Remove trailing whitespace 2014-01-10 21:04:39 -08:00
Ben Alpert
1efb14bcf6 Rewrite mergeKeySets to be O(n) instead of O(n^3) 2014-01-10 15:31:15 -08:00
Andrew Davey
d6afb5285e CSS column-count property is unitless 2014-01-10 19:12:58 +00:00
Pete Hunt
979ee27e2b Merge pull request #862 from cpojer/docs-proptypes
Document PropTypes.renderable and PropTypes.component
2014-01-10 09:55:19 -08:00
cpojer
d73f80ecb2 Document PropTypes.renderable and PropTypes.component 2014-01-10 09:36:22 -08:00
Andrew Davey
423380f9c3 Unitless CSS flex properties 2014-01-10 11:16:06 +00:00
Andrew Davey
b70c3ef4bb Refactor unit test 2014-01-10 11:16:06 +00:00
Andrew Davey
ac0373ccae More unitless CSS properties
volume, stress, pitch-range, richness
2014-01-10 11:16:06 +00:00
Andrew Davey
095eea3241 CSS widows property is unitless
Ref #836
2014-01-10 11:16:05 +00:00
Timothy Yung
338ce603f9 Merge pull request #797 from spicyj/should-update
Fix cases where owner warning is shown
2014-01-09 18:50:21 -08:00
cpojer
95cb79a93e Remove CallbackRegistry 2014-01-09 16:58:48 -08:00
cpojer
b713c2c696 Add PropTypes.component to demand a single React component. 2014-01-09 16:58:47 -08:00
Ben Alpert
f5a48f1ff4 Fix cases where owner warning is shown
In b0431a5 I added the check in the wrong place which could cause the warning to be shown because of key changes rather than owner changes like the warning suggests.
2014-01-09 16:48:58 -08:00
Timothy Yung
f47238be41 Merge pull request #803 from spicyj/gh-788
Use proper window object for iframe in enter/leave
2014-01-09 16:35:07 -08:00
Timothy Yung
851f08bdc2 Merge pull request #780 from syranide/newhasevent
Further cleanup of isEventSupported
2014-01-09 16:34:57 -08:00
Timothy Yung
68bac7fbf0 Merge pull request #778 from syranide/flipwheel
Fix WheelEvent incorrectly flipping sign of deltaY
2014-01-09 16:34:47 -08:00
Timothy Yung
dea6063dc9 Merge pull request #771 from spicyj/gh-694
Don't get selection if no active element
2014-01-09 16:34:27 -08:00
cpojer
8dbc530d1c Add --harmony option to jsx. 2014-01-09 15:21:48 -08:00
Paul O’Shannessy
1f5c8d21d8 Merge pull request #786 from spicyj/gh-781
Fix potential memory leak when unmounting
2014-01-09 13:08:07 -08:00
Timothy Yung
2c93cd0267 Merge pull request #640 from spicyj/immutable-props-2
Don't mutate passed-in props, take 2
2014-01-09 12:52:58 -08:00
Christopher Chedeau
e3e3b477d3 Merge pull request #850 from spicyj/docs-ref-unmount
Document return value of unmountComponentAtNode
2014-01-09 09:21:39 -08:00
Ben Alpert
4d3a9c87d1 Don't store mount image on component instance 2014-01-08 22:53:59 -08:00
Ben Alpert
87a95155be Document return value of unmountComponentAtNode 2014-01-08 21:56:59 -08:00
Cheng Lou
3c40fb2e01 better error message for mergeHelpers and setState 2014-01-08 21:56:48 -08:00
Ben Alpert
2716f38861 Spy on purgeID instead of unmountIDFromEnvironment 2014-01-08 21:48:48 -08:00
Ben Alpert
e2f094614f Fix potential memory leak when unmounting
Fixes #781.
2014-01-08 21:43:52 -08:00
Paul O’Shannessy
09011493c5 Merge pull request #718 from syranide/npmenvify
Fix npm react having wrong version dependency for envify
2014-01-08 15:33:59 -08:00
Paul O’Shannessy
0c3628cd8d Merge pull request #757 from spicyj/ng
Don't tack on EventPluginHub globally
2014-01-08 15:23:47 -08:00
Ben Alpert
1db788b62c Don't tack on EventPluginHub globally 2014-01-08 15:20:05 -08:00
Christopher Chedeau
2052caf0cc Merge pull request #846 from spicyj/docs-nomin
Remove two more react.min.js references
2014-01-08 11:45:25 -08:00
Ben Alpert
76a0a9cba7 Remove two more react.min.js references 2014-01-08 11:40:53 -08:00
Paul O’Shannessy
46f7163f62 Don't use the min build in getting started guide 2014-01-08 11:38:34 -08:00
Paul O’Shannessy
8d0885e0d8 Merge pull request #844 from xixixao/patch-1
Fix URL in displayName description
2014-01-08 11:24:55 -08:00
Michal Srb
b4f4f10478 Fix URL in displayName description 2014-01-08 14:55:27 +01:00
Paul O'Shannessy
23ab30ff87 Revert textContent
Reverts 309a88bcf6 because this is causing
issues internally. I'll try to get a repro soon.
2014-01-07 21:10:03 -08:00
Pete Hunt
b1597ab2d7 Warn for common forms misuse 2014-01-07 21:08:13 -08:00
Paul O’Shannessy
be42d94f12 Don't set max_line_length for *.md 2014-01-07 20:46:46 -08:00
Jeff Morrison
33fe8eebda Merge pull request #799 from spicyj/display-name
Add display name in more cases
2014-01-07 12:58:23 -08:00
Ben Alpert
f0fdabae7b Add display name in more cases 2014-01-07 09:36:47 -08:00
Ben Alpert
a2ecee5353 Use proper window object for iframe in enter/leave
Fixes #788.
2014-01-07 08:36:42 -08:00
Ben Alpert
657602135c Don't mutate passed-in props, take 2 2014-01-06 21:42:04 -08:00
Ben Newman
4f57515f91 Fix some odd spacing inconsistencies in ReactRenderDocument-test. 2014-01-06 21:13:25 -08:00
Sebastian Markbåge
59bd45d594 Merge pull request #772 from spicyj/gh-444
Set event type on enter/leave events
2014-01-06 20:10:26 -08:00
Sebastian Markbåge
c28e1f24df Merge pull request #768 from spicyj/findcomponentroot-err
Remove sometimes-confusing console error
2014-01-06 18:57:18 -08:00
Tom Occhino
ba6c82a326 Merge pull request #829 from spicyj/transitiongroup-null-child
Make ReactTransitionGroup work with a null child
2014-01-06 18:40:35 -08:00
Timothy Yung
e23c06a60c Merge pull request #773 from spicyj/select-event-ff
Check for selection on keyup instead of deferring
2014-01-06 18:40:20 -08:00
Pete Hunt
70a0746e9f Fix react tests 2014-01-06 18:35:54 -08:00
Pete Hunt
1e980a146f Fix bug in cloneWithProps() 2014-01-06 18:35:54 -08:00
Pete Hunt
57f208e402 Merge pull request #821 from subtleGradient/subtlegradient/perf-task
benchmark runner & comparison tool with grunt commands and travis integration
2014-01-06 18:32:51 -08:00
Paul O’Shannessy
f9551d709e Merge pull request #808 from spicyj/prefer-textContent
Prefer textContent to innerText
2014-01-06 18:08:38 -08:00
Ben Alpert
c75899f277 Make ReactTransitionGroup work with a null child 2014-01-06 17:40:50 -08:00
Ben Alpert
09c8ec51bf Check for selection on keyup instead of deferring
This is essentially what we do for the change event in IE8 and IE9 already.
2014-01-06 16:37:27 -08:00
Paul O’Shannessy
6fdf36af13 Merge pull request #827 from spicyj/jstransform-202
Bump jstransform version to 2.0.2
2014-01-06 16:26:42 -08:00
Ben Alpert
5968571952 Bump jstransform version to 2.0.2
Necessary for JSXTransformer.js to work after 7675611.
2014-01-06 16:25:05 -08:00
Christopher Chedeau
e9484adf65 Merge pull request #774 from spicyj/img-onload
Add support for onLoad event to <img />
2014-01-06 16:24:25 -08:00
Ben Alpert
fb858a8fc2 Set event type on enter/leave events
Fixes #444.
2014-01-06 16:21:46 -08:00
Sebastian Markbåge
4f09a54a1d Merge pull request #741 from spicyj/flatten-nonull
Don't return null children from flattenChildren
2014-01-06 16:21:34 -08:00
Timothy Yung
8f2509e169 Merge pull request #789 from spicyj/gh-785
Set target properties explicitly for enter/leave
2014-01-06 16:16:35 -08:00
Ben Alpert
79c9025f17 Add support for onLoad event to <img /> 2014-01-06 16:16:21 -08:00
Christopher Chedeau
9454282bfc Merge pull request #819 from mtharrison/add-more-svg-tags
Added support for 4 extra SVG tags
2014-01-06 15:44:15 -08:00
Paul O’Shannessy
147506a911 Merge pull request #826 from spicyj/invariant-license
Add back license header to invariant
2014-01-06 15:36:37 -08:00
Ben Newman
b7b4bcfd2e Merge pull request #764 from spicyj/browser-source-maps
Add source map support to browser transformer.
2014-01-06 14:38:00 -08:00
Ben Alpert
808f60f8a0 Add back license header to invariant 2014-01-06 14:19:23 -08:00
Matt Harrison
bd575eb7c8 Updated getMarkupWrap.js to include the new SVG elements 2014-01-06 21:48:40 +00:00
Paul O’Shannessy
c2be8ba42d Sync vendored modules from upstream 2014-01-06 11:55:37 -08:00
Timothy Yung
627d7eb669 Merge pull request #754 from spicyj/over-and-out
Add onMouseOver and onMouseOut events
2014-01-06 10:28:54 -08:00
Tim Yung
182a237fa7 Separate Module for Key Normalization
This moves key normalization into its own module so that it can be re-used elsewhere.
2014-01-06 10:07:49 -08:00
Christoph Pojer
22ba8b67f1 Silence console.error in ReactDOMInput-test
This test is expected to throw but because of ReactErrorUtils.guard
which uses console.error in __DEV__ it also logged the invariant error
to the console. This change fixes it by temporarily stubbing out
console.error.

Fixes #531
2014-01-06 10:07:49 -08:00
Tim Yung
e65726cd04 Cleanup ReactEventEmitter Variable Naming
Minor follow-up to 80d7d2d0f8.
2014-01-06 10:07:49 -08:00
Isaac Salier-Hellendag
1584aaf746 Change global to window in SyntheticClipboardEvent
Replace `global` reference with `window` in `SyntheticClipboardEvent`.
2014-01-06 10:07:49 -08:00
Pete Hunt
089a494a1f Forbid full-page rendering without server rendering
Final part of server rendering cleanup. We should only support full-page rendering when server rendering is involved since
otherwise it's slow and can crash browsers when you start adding and removing document roots. This diff removes the magic
innerHTML code (since that will be handled by the server rendering piece) and adds the right assertions and errors.

Because there's no longer a dangerous of accidentally nuking the whole page, I removed allowFullPageRender which is yet another
internal we no longer need to expose.
2014-01-06 10:07:48 -08:00
Pete Hunt
9b3342ed34 Throw when unmounting <html>, <head>, <title> or <body>
These are dangerous from a cross-browser perspective. I think supporting efficient reactive updates will be prohibitively
expensive and we'll never prioritize it. Instead of killing this capability entirely, let's just throw on the dangerous cases.
There will be a few follow-up diffs
2014-01-06 10:07:48 -08:00
Christopher Chedeau
7630e56971 Merge pull request #804 from spicyj/examples-no-browserify
Remove mentions of browserify in examples
2014-01-06 10:03:10 -08:00
Christopher Chedeau
9cce0c2752 Merge pull request #823 from spicyj/key-docs
Add charCode/keyCode/which to key event docs
2014-01-06 09:40:18 -08:00
Thomas Aylott
91821007ed benchmark runner 2014-01-06 12:26:40 -05:00
Christopher Chedeau
6dd62b0e4f Merge pull request #688 from vjeux/community_14
Community Round-up #14
2014-01-06 09:11:09 -08:00
Matt Harrison
42262f5361 Aphabetized and wrapped tags/attributes docs 2014-01-06 08:15:46 +00:00
Timothy Yung
2c1a25411f Merge pull request #747 from spicyj/currentTarget
Set currentTarget on synthetic events
2014-01-05 20:41:48 -08:00
Timothy Yung
13230a3044 Merge pull request #643 from spicyj/scroll-pos
Fix scrollLeft/scrollTop warning in latest Chrome
2014-01-05 20:41:35 -08:00
Ben Alpert
b366e36367 Add charCode/keyCode/which to key event docs 2014-01-05 21:24:17 -07:00
Christopher Chedeau
ed3d5add76 Merge pull request #809 from passy/patch-1
Add gulp-react to Helpful OSS Projects
2014-01-05 18:16:20 -08:00
Christopher Chedeau
0e5b62a4c3 Merge pull request #818 from Daniel15/link-htmltojsx
Add link to HTML to JSX converter to “JSX In Depth” page
2014-01-05 18:16:06 -08:00
Cheng Lou
5b43a2e6d7 throw error when setState's arguments are bad 2014-01-05 18:01:07 -08:00
Matt Harrison
c01f0a0487 Updated docs with new SVG elements 2014-01-05 12:18:30 +00:00
Matt Harrison
c4d918aca0 Added support for 4 extra SVG tags: stop, defs, linearGradient, radialGradient 2014-01-05 11:17:04 +00:00
Daniel Lo Nigro
ae9188db50 Change “not allowed” back to “discouraged” since you technically *can* use props called class or for 2014-01-04 23:33:02 -08:00
Daniel Lo Nigro
202a3f184d Add link to HTML to JSX converter to “JSX In Depth” page 2014-01-04 23:25:28 -08:00
Christopher Chedeau
605b42e622 Merge pull request #811 from xixixao/issue793
Document displayName
2014-01-04 10:41:56 -08:00
xixixao
ee0a4acfac Document displayName 2014-01-04 17:34:16 +01:00
Pascal Hartig
e92d769a50 Add gulp-react to Helpful OSS Projects
Add @sindresorhus' JSX task for Gulp to the "Helpful Open-Source Projects" section of the tooling integration docs.
2014-01-04 11:20:45 +01:00
Ben Alpert
33dcf8a0b5 Set currentTarget on synthetic events
Fixes #658, fixes #659.
2014-01-04 00:27:11 -07:00
SanderSpies
80d7d2d0f8 Listen to events on demand
Fixes #381

This is a squashed version of https://github.com/facebook/react/pull/462
2014-01-03 23:09:59 -08:00
Ben Alpert
309a88bcf6 Prefer textContent to innerText
Fixes #807.
2014-01-04 00:01:03 -07:00
Pete Hunt
a575e93ecd Merge pull request #806 from spicyj/patch-4
Fix typo
2014-01-03 22:19:35 -08:00
Ben Alpert
ea40a6aedd Fix typo 2014-01-03 23:19:04 -07:00
Pete Hunt
047e962a55 Merge pull request #805 from spicyj/docs-mention-react-art
Mention react-art where we talk about SVG
2014-01-03 22:17:51 -08:00
Ben Alpert
fdfd7c1853 Mention react-art where we talk about SVG 2014-01-03 23:15:50 -07:00
Ben Alpert
be75e3be66 Remove mentions of browserify in examples 2014-01-03 22:58:51 -07:00
Timothy Yung
c11d6d79f5 Merge pull request #721 from spicyj/change-bubble-ie
Make controlled components and bubbling work in IE
2014-01-03 18:10:16 -08:00
Nick Thompson
d270e2b1c7 Don't add displayName in transform if already defined
This ensures we don't add displayName in the transform if it's already been
defined. This is especially important when in strict mode, where duplicate
properties in an object is an exception.
2014-01-03 16:07:10 -08:00
Christopher Chedeau
e3e24500ae Merge pull request #795 from philix/master
Add jsx-requirejs-plugin to the tooling-integration page
2014-01-03 11:09:59 -08:00
Felipe Oliveira Carvalho
86f2dbe55d Remove the require-jsx plugin from the tooling-integration page
In favor of the r.js friendly jsx-requirejs-plugin
2014-01-03 16:03:42 -03:00
Felipe Oliveira Carvalho
344b5998a8 Add jsx-requirejs-plugin to the tooling-integration page 2014-01-03 15:45:03 -03:00
Andreas Svensson
4de2d39f63 Fix WheelEvent incorrectly inverting sign of deltaY 2014-01-03 19:09:09 +01:00
Andreas Svensson
7264cbcdfb Further cleanup of isEventSupported 2014-01-03 19:02:20 +01:00
Jeff Morrison
1b67ac90f2 Make sure the mock is cleared in the EventEmitter test 2014-01-02 20:09:50 -08:00
Isaac Salier-Hellendag
29190a2c79 Support clipboardData in IE
Use the `clipboardData` object available on `window`, if it's not available on the event object. This allows us to support including the `clipboardData` in cut/copy/paste events in IE.
2014-01-02 20:05:07 -08:00
Christoph Pojer
bcfb476366 More tests for 77697f26e3 2014-01-02 20:05:03 -08:00
Ben Newman
1ee7f8131c Let components specify tag for ReactTestUtils.mockComponent to use.
If you're writing a test that involves a mocked component that normally
returns a `<li>` tag from its `render` method as the root element, mocking
it with a dummy `<div>` probably won't work, so you'll want to set

  MyListItemComponent.mockTagName = 'li';

The change to the `.mockImplementation` line makes sense because
`ConvenienceConstructor` is more or less synonymous (for these purposes)
with the wrapper that was previously used:

  function() {
    // This `this` used to be `null`, technically, but
    // ConvenienceConstructor doesn't pay attention to `this` anyway.
    return ConvenienceConstructor.apply(this, arguments);
  }
2014-01-02 20:03:55 -08:00
Ben Newman
a00e4c840c Support ReactTestUtils.mockComponent. 2014-01-02 20:03:40 -08:00
Sebastian Markbage
cbefc5a968 Add display names to controlled components
These show up as Unknown in the DevTools. They also wrap a native component,
so they show up double.
2014-01-02 20:03:26 -08:00
Fabio Costa
f3e774559f adding warning about the lack of support for onScroll on IE8
Adding `console.warn` about the lack of support for `onScroll` event on IE8
Related to this issue on github https://github.com/facebook/react/issues/631
2014-01-02 20:01:33 -08:00
Pete Hunt
1733d42ded Rework ReactRootIndex generation
This had a higher probability of collision than originally thought (bad math). This makes the strategy injectable and provies a
no-collision version on the client and an unlikely-to-collide version on the server.
2014-01-02 20:00:30 -08:00
Pete Hunt
cc005668b5 cloneWithProps()
what if you want to change the props of a child? This is my first attempt which lets you clone a child and transfer some custom props to it.

There is a fundamental issue with refs here. Since the component is cloned the ref will be broken. And since we can clone multiple times, it might not make sense to support repairing refs.
2014-01-02 19:46:50 -08:00
Pete Hunt
5661d5168e Add svg polygon 2014-01-02 19:45:55 -08:00
Ben Alpert
fb8277c819 Set target properties explicitly for enter/leave
Fixes #785.
2014-01-02 17:03:11 -07:00
Ben Newman
5aae5a7b1d Merge pull request #783 from benjamn/upgrade-commoner
Upgrade commoner build tool to v0.8.12.
2014-01-02 12:09:26 -08:00
Christopher Chedeau
acf0c5c646 Merge pull request #784 from vjeux/react_dev_tools
React Chrome Developer Tools
2014-01-02 12:04:53 -08:00
Vjeux
e915294b68 React Chrome Developer Tools 2014-01-02 21:04:09 +01:00
Ben Newman
1755d43add Upgrade commoner build tool to v0.8.12.
Fixes #394.
Fixes #615.
2014-01-02 14:54:13 -05:00
Ben Newman
04ad3bfcc3 Merge pull request #725 from cpojer/getInitialState-invariant
Add invariant to check getInitialState return value. Fixes #397.
2014-01-02 06:59:50 -08:00
Christopher Chedeau
a78f6f7f94 Merge pull request #779 from chenglou/live-err
docs better error display for live editor and JSX compiler
2014-01-01 19:58:26 -08:00
Cheng Lou
f0b5219df9 docs better error display for live editor and JSX compiler 2014-01-01 19:41:08 -05:00
Christopher Chedeau
3396654a6f Merge pull request #775 from chenglou/doc-fix
docs tips fix small typo and code
2014-01-01 14:05:21 -08:00
Cheng Lou
e244df510d docs tips fix small typo and code 2014-01-01 15:28:44 -05:00
Ben Alpert
7a9e5443b7 Don't get selection if no active element
Fixes #694.

Previously, it could be that there was an active element that was removed in between mousedown and mouseup.
2013-12-31 17:27:05 -07:00
Ben Alpert
261926303d Remove sometimes-confusing console error
Fixes #767. This essentially reverts 738de8c.

We could store some sort of flag to silence the console error here but since we've made significant improvements in markup wrapping, this error is fairly rare now. We'll also have validation of node structure soon in #735.
2013-12-31 13:37:15 -07:00
Christopher Chedeau
e91a8a1bc3 Merge pull request #765 from spicyj/editorconfig-80
.editorconfig: Set line length to 80
2013-12-31 12:22:14 -08:00
Ben Alpert
3defe88192 .editorconfig: Set line length to 80
And alphabetize properties.
2013-12-31 12:59:06 -07:00
Ben Alpert
7675611e5f Add source map support to browser transformer 2013-12-31 12:03:34 -07:00
Pete Hunt
9a4f011f6c Merge pull request #763 from spicyj/gh-762
Add info about dev vs. prod builds
2013-12-31 09:57:10 -08:00
Ben Alpert
c877451887 Add info about dev vs. prod builds
Also moved the dev builds first because that's what most people will want.
2013-12-31 10:35:49 -07:00
Christopher Chedeau
96782fc836 Merge pull request #755 from spicyj/cm-scroll
Upgrade codemirror and enable line wrapping
2013-12-30 20:56:59 -08:00
Christopher Chedeau
1155aa9ac0 Merge pull request #758 from chenglou/docs-kill-wiki
docs remove link to wiki page
2013-12-30 20:40:05 -08:00
Cheng Lou
41526091a0 docs remove link to wiki page
Also some minor writing changes.
2013-12-30 23:38:01 -05:00
Ben Alpert
b2e51c6e01 Upgrade codemirror and enable line wrapping
Fixes #678.
2013-12-30 18:06:00 -07:00
Ben Alpert
a2e352ea76 Add onMouseOver and onMouseOut events
Fixes #340.

Test Plan:
Ported @danielstocks's jsfiddle (linked in the issue) to React and the hover effect worked properly.
2013-12-30 17:38:15 -07:00
Christopher Chedeau
55b7a57e07 Merge pull request #753 from vjeux/virtual_dom_docs
Making 'native DOM' nodes more explicit in documentation
2013-12-30 16:37:51 -08:00
Vjeux
1d4d1a0be6 Making 'native DOM' nodes more explicit in documentation 2013-12-31 01:34:42 +01:00
Christopher Chedeau
7dca85a9b1 Merge pull request #752 from spicyj/docs-ie8-css
IE8 style fixes
2013-12-30 16:24:26 -08:00
Ben Alpert
1c90172cd0 IE8 style fixes
- Add html5shiv so that HTML5 elements like header, footer, etc can be styled
- Remove a couple uses of :first-child/:last-child which IE8 doesn't support
2013-12-30 17:17:17 -07:00
Christopher Chedeau
f871147b4d Merge pull request #750 from chenglou/docs-clean
docs tips small refactorings
2013-12-30 15:12:43 -08:00
Cheng Lou
1671efb53a docs tips small refactorings 2013-12-30 17:54:41 -05:00
Christopher Chedeau
8915f1b85d Merge pull request #749 from spicyj/docs-ie8
Make React website work in IE8
2013-12-30 14:28:19 -08:00
Ben Alpert
92b440b1d7 Make React website work in IE8
Fixes #406.

Empty conditional comment is for http://www.phpied.com/conditional-comments-block-downloads/.
2013-12-30 15:25:26 -07:00
Christopher Chedeau
3b0f705658 Merge pull request #623 from chenglou/tips-communication
docs tips parent-child communication 2
2013-12-30 14:09:01 -08:00
Cheng Lou
23eac0bbbb docs tips expose component function 2013-12-30 17:07:24 -05:00
Christopher Chedeau
50d190f111 Merge pull request #746 from petehunt/tip-update
Update parent/child communication tip
2013-12-30 10:23:19 -08:00
petehunt
47fe931549 Update parent/child communication tip 2013-12-30 13:22:10 -05:00
Paul O’Shannessy
b3e1697aad Merge pull request #739 from jhiswin/master
live_editor.js using deprecated function

Fixes #738 #666
2013-12-30 10:04:51 -08:00
Christopher Chedeau
4190d0a7bb Merge pull request #687 from vjeux/community_13
Community Round-up #13
2013-12-30 09:28:13 -08:00
Vjeux
40e2d8a064 Community Round-up #13 2013-12-30 18:27:31 +01:00
Ben Alpert
e1ec9a6c65 Don't return null children from flattenChildren
This simplifies ReactMultiChild a little bit and will make it more practical to coalesce adjacent text strings.
2013-12-29 12:19:10 -07:00
jhiswin
e2ebbeac07 live_editor.js using deprecated function
unmountAndReleaseReactRootNode -> unmountComponentAtNode
breaks html-jsx.html
2013-12-29 09:42:35 -05:00
Pete Hunt
eab2ededdf Merge pull request #736 from spicyj/minify-before-browserify
Minify both before and after browserify
2013-12-28 23:17:52 -08:00
Pete Hunt
7e29f4607b Merge pull request #737 from spicyj/docs-ajax-state
Move initial $.ajax out of getInitialState
2013-12-28 23:17:34 -08:00
Ben Alpert
cce91611aa Move initial $.ajax out of getInitialState
We want to encourage people to make pure getInitialState functions.
2013-12-29 00:14:05 -07:00
Ben Alpert
76c9d8465e Switch to using uglifyify 2013-12-29 00:03:26 -07:00
Ben Alpert
abee8b0476 Minify both before and after browserify 2013-12-28 23:41:54 -07:00
Pete Hunt
82c4e897dc Merge pull request #733 from ivan/master
Use explicit $.ajax dataType and add error callback
2013-12-28 22:15:08 -08:00
Ivan Kozik
17f14d523b console.log -> console.error 2013-12-29 06:12:45 +00:00
Pete Hunt
f5f464b16a Merge pull request #734 from ivan/tut-jsx-header
Tell user to keep the @jsx declaration at the top of the script
2013-12-28 22:08:19 -08:00
Ivan Kozik
0647c2ee98 Add a warning about the @jsx declaration 2013-12-29 05:51:07 +00:00
Ivan Kozik
f03d6e212a Use explicit $.ajax dataType and add error callback 2013-12-29 05:32:46 +00:00
Pete Hunt
918c5134e1 Merge pull request #732 from chenglou/doc-pragma
docs add warning to add jsx pragma
2013-12-28 20:05:33 -08:00
Cheng Lou
8f5ef0fdf2 docs add warning to add jsx pragma 2013-12-28 23:04:34 -05:00
Christopher Chedeau
84cacaf5b6 Merge pull request #717 from syranide/testkeytransfer
Add unit test for transferPropsTo, "key" should never transfer
2013-12-27 18:54:56 -08:00
Christopher Chedeau
72fd24662e Merge pull request #716 from bitshadow/hotfix
Issue #383 : Error message for using refs outside of render() is difficult to underst...
2013-12-27 18:53:36 -08:00
Christopher Chedeau
fdf64919f3 Merge pull request #730 from syranide/lint80
Added max line length = 80 for jshint
2013-12-27 17:59:45 -08:00
Christopher Chedeau
ff9ca2ecb2 Merge pull request #700 from syranide/100%autofocus
Patch missing autoFocus-support in older browsers
2013-12-27 17:47:24 -08:00
Christopher Chedeau
f627bc52b0 Merge pull request #714 from syranide/escapekey
Escape component keys used in reactid
2013-12-27 17:14:16 -08:00
Christopher Chedeau
9f10bb4aca Merge pull request #729 from syranide/dragevent
Add SyntheticDragEvent with "dataTransfer" property
2013-12-27 17:12:00 -08:00
Andreas Svensson
a6b888b214 Escape component keys used in reactid 2013-12-28 01:58:59 +01:00
Andreas Svensson
cbd6d8a46c Added max line length = 80 for jshint 2013-12-28 01:49:04 +01:00
Andreas Svensson
01b4b23118 Polyfill/normalize autoFocus across all browsers 2013-12-27 22:44:43 +01:00
Andreas Svensson
9e6456ba41 Add SyntheticDragEvent with "dataTransfer" property 2013-12-27 21:01:30 +01:00
Pete Hunt
a4bb44f1e2 Merge pull request #728 from spicyj/gh-724
Allow changing transitionLeave from false to true
2013-12-27 10:59:22 -08:00
Pete Hunt
fac676073a Merge pull request #722 from wincent/typo-fix-01
Fix a typo in the working-with-the-browser docs
2013-12-27 10:09:02 -08:00
Ben Alpert
5e6e332d67 Allow changing transitionLeave from false to true
Fixes #724.
2013-12-27 10:22:48 -07:00
cpojer
77697f26e3 Add invariant to check getInitialState return value. Fixes #397 2013-12-27 16:36:08 +01:00
Wincent Colaiuta
79b00591f1 Fix a typo in the working-with-the-browser docs 2013-12-26 22:22:00 -08:00
Ben Alpert
556065937b Make controlled components and bubbling work in IE
Fixes #708.

Test Plan:
In IE9, tested a controlled text input with the event handler on a containing element, as in the fiddle linked in the original issue. Also tested a controlled radio button as the logic there differs within ReactDOMInput. In both cases, I was able to interact with the controls.
2013-12-26 23:06:40 -07:00
Andreas Svensson
411f0bd7c3 Fix npm react having wrong version dependency for envify 2013-12-26 18:12:23 +01:00
Paul O’Shannessy
f877c6224f Merge pull request #695 from luigy/patch-1
Fix "Dynamic Children" example
2013-12-26 09:04:21 -08:00
Andreas Svensson
f9947dec2a Add unit test for transferPropsTo, "key" should never transfer 2013-12-26 16:42:39 +01:00
Jignesh Kakadiya
e35f4c29bb fix params 2013-12-26 12:29:01 +05:30
Jignesh Kakadiya
ecf9f8ef6d Adjust params 2013-12-26 12:17:36 +05:30
Jignesh Kakadiya
2b0dc71e3d Error message for using refs outside of render() is difficult to understand 2013-12-26 12:00:19 +05:30
Pete Hunt
cc229eb749 Merge pull request #591 from spicyj/mount-key
Respect 'key' prop for object identity
2013-12-25 22:15:13 -08:00
Ben Alpert
633125fd0d Use innerHTML not innerText in test 2013-12-25 22:47:10 -07:00
Ben Alpert
30f566392b Extract out wrapUserProvidedKey for clarity 2013-12-25 22:32:43 -07:00
Ben Alpert
6fae670d19 Make shouldUpdateReactComponent key logic clearer
...and inline getComponentKey into traverseAllChildren.js.
2013-12-25 22:25:20 -07:00
Ben Alpert
b0431a51ca Respect 'key' prop for object identity
Now when a `key` prop appears, its value is always honored. This means that in the root component or as an only child, changing key will cause remounting; in a `children` object, the `key` prop will be joined with the object key to form a two-part key.

Fixes #590.
2013-12-25 22:24:10 -07:00
Christopher Chedeau
02e47ebd00 Merge pull request #713 from syranide/nokeytransfer
transferPropsTo should never transfer the "key" property
2013-12-25 20:46:30 -08:00
Andreas Svensson
374c9ba658 transferPropsTo should never transfer the key property 2013-12-26 00:12:22 +01:00
Pete Hunt
adff7c0238 Update README.md 2013-12-24 02:21:06 -05:00
Christopher Chedeau
7e0c6bc952 Merge pull request #705 from chenglou/rm-vid
docs remove video at the bottom
2013-12-23 22:44:00 -08:00
Cheng Lou
0519734ea5 docs remove video at the bottom 2013-12-24 01:42:45 -05:00
Pete Hunt
b385b580a6 Merge pull request #704 from vjeux/talks_doc
Add a talks section to the docs
2013-12-23 22:21:56 -08:00
Vjeux
91780d1c58 Add a talks section to the docs 2013-12-24 07:20:42 +01:00
Christopher Chedeau
a6d8c00b1a Merge pull request #702 from syranide/lessmice
Removed unnecessary cleanup in isEventSupported
2013-12-23 19:30:16 -08:00
Pete Hunt
1070d12732 Merge pull request #701 from fabiomcosta/react-video-version-note
Note about react's version on the video talk
2013-12-23 16:54:33 -08:00
Pete Hunt
a8216e78b1 Merge pull request #703 from fabiomcosta/onscroll-doc-ie8-note
Adding note about onScroll on IE8
2013-12-23 16:46:52 -08:00
Fabio M. Costa
c211767d47 language update as suggested by @petehunt 2013-12-23 16:45:44 -08:00
Fabio M. Costa
34660eccf9 updating text as suggested by @petehunt 2013-12-23 16:41:41 -08:00
Fabio M. Costa
874122bad4 Adding note about onScroll on IE8 2013-12-23 16:40:41 -08:00
Andreas Svensson
63ca84e5af Removed unnecessary cleanup in isEventSupported 2013-12-24 01:02:24 +01:00
Fabio M. Costa
d22874d039 Note about react's version on the talk, since somethings have already changed since then 2013-12-23 15:37:06 -08:00
Pete Hunt
128a35dff9 Merge pull request #642 from Cartas/master
ReactTransitionGroup can handle components being re-added before 'leave' transition has completed.
2013-12-23 15:36:28 -08:00
Timothy Yung
9e0987cd9b Merge pull request #607 from syranide/html5key
Polyfill and normalize HTML5 "key", deprecates which and keyCode
2013-12-23 11:11:12 -08:00
Ben Newman
82a26ada65 Merge pull request #684 from syranide/ie8dangerousinnerhtml
Use feature detection and more robust recovering of whitespace for innerHTML in IE8.
2013-12-23 11:07:51 -08:00
Christopher Chedeau
9fa759173e Merge pull request #699 from vjeux/fix_typo
typo
2013-12-23 09:53:53 -08:00
Vjeux
a31a8c35c2 typo 2013-12-23 18:45:53 +01:00
Christopher Chedeau
47f24f26aa Merge pull request #698 from vjeux/fix_compiler
Fix html-jsx compiler
2013-12-23 09:31:19 -08:00
Vjeux
6bd9f35bf3 Fix html-jsx compiler
It changed React Playground to add a required props but unfortunately didn't update the call sites of the front-page. I don't think it should be required so I'm just making it optional and providing the correct default value.

Test Plan:
 - Open the front page and make sure examples are working
 - Open /react/jsx-compiler.html and make sure it is working
 - Open /react/html-jsx.html and make sure it is working
2013-12-23 18:24:22 +01:00
Christopher Chedeau
590a5498ab Merge pull request #686 from vjeux/community_12
Community Round-up #12
2013-12-23 09:04:03 -08:00
Vjeux
d1e955c37b Community Round-up #12 2013-12-23 18:03:42 +01:00
Paul O’Shannessy
1783e54eb0 Merge pull request #692 from loganfynne/master
Added property attribute to non-standard attributes
2013-12-22 21:30:03 -08:00
Christopher Chedeau
0bbf535b7b Merge pull request #411 from vjeux/diff_algorithm
Document the Diff algorithm
2013-12-22 11:36:26 -08:00
Andreas Svensson
1f2d57d6a4 Use feature detection and more robust recovering of whitespace for innerHTML in IE8 2013-12-22 20:30:59 +01:00
Vjeux
59f72bd991 Document the Diff algorithm
We often refer to it but never did actually explain it.
2013-12-22 20:09:02 +01:00
Ben Newman
9f3c4da588 Merge pull request #662 from benjamn/replace-envify
Upgrade envify to a version that uses recast.
2013-12-22 09:39:02 -08:00
Ben Newman
9da3f92853 Upgrade envify dependency to v1.0.1.
This version uses Recast for source transformation:
https://github.com/hughsk/envify/pull/4
2013-12-22 11:58:56 -05:00
Luigy Leon
814faed08f Fix "Dynamic Children" example 2013-12-22 10:37:09 -05:00
Pete Hunt
c7fbaa4966 Merge pull request #691 from Daniel15/hackathon40-htmltojsx-master
Simple HTML to JSX converter
2013-12-22 00:07:15 -08:00
Logan Allen
ab88dd19d3 Added property to non-standard attributes
Fixes issue #655
2013-12-21 22:24:31 -05:00
Daniel Lo Nigro
eab1f4d366 Simple HTML to JSX converter, built during Hackathon 40 at Facebook.
See /react/html-jsx.html. Not directly linked from the site yet as there may still be some minor issues with it.
2013-12-21 17:44:38 -08:00
Vjeux
c7c72d1a7a Community Round-up #14 2013-12-21 20:48:28 +01:00
Mouad Debbar
d914522ae4 A new prop type for React Components
Since we can use props to pass React Components, we should have a better way of validating these props than just `object`. Having a prop type `component` will allow us to safely assume that the passed prop IS a component.
2013-12-20 18:13:21 -08:00
Tim Yung
3431e3f847 Add createMarkupForID
This is a follow-up the to previous commit and does two things:

 - Moves `ReactMount.ATTR_NAME` to `DOMProperty.ID_ATTRIBUTE_NAME`.
 - Adds `DOMPropertyOperations.createMarkupForID` and uses it.
2013-12-20 18:12:48 -08:00
Tim Yung
9d119577ea Consolidate ID Attribute Markup Generation
We have this really nice method for safely creating markup for an HTML
attribute, `DOMPropertyOperations.createMarkupForProperty(...)`. Let's
use it to create the ID attribute markup, too.
2013-12-20 18:12:37 -08:00
Paul O’Shannessy
65e0970c41 Merge pull request #673 from quark-zju/fix-select-multiple
Some options cannot be selected alone in <select multiple />
2013-12-20 16:24:37 -08:00
Keito Uchiyama
03ab108a77 Change my canonical e-mail address in .mailmap 2013-12-20 13:59:53 -08:00
Jun, WU
3c5710193c Fix a perf issue of <select multiple />
`indexOf` was used inside a loop. Use an object and
`hasOwnProperty` instead.
2013-12-21 01:04:31 +08:00
WU Jun
9a4a8aa71a Do not automatically select other options
For <select multiple />, `value` is an array and should not be
converted to a string.
2013-12-21 01:04:31 +08:00
Cheng Lou
30672654c5 docs make all link start with /react/docs 2013-12-19 17:15:01 -05:00
Paul O’Shannessy
039124bd07 0.8 starter kit 2013-12-19 13:21:27 -08:00
Paul O’Shannessy
5c9f96d12f v0.8 blog post 2013-12-19 13:21:27 -08:00
Paul O’Shannessy
2595cbc676 Update materials for 0.8.0 2013-12-19 13:21:27 -08:00
Paul O’Shannessy
6a8542a6e9 Fix npm-react build task, add to release 2013-12-19 13:21:27 -08:00
Paul O’Shannessy
a1699bdb88 Update AUTHORS for 0.8 2013-12-19 13:21:27 -08:00
Paul O’Shannessy
a4595f0b32 Add newest starter-kit downloads to docs 2013-12-18 16:51:23 -08:00
Paul O’Shannessy
c0c5cb8e2c Changelog, blog post for 0.5.2, 0.4.2 2013-12-18 16:45:17 -08:00
Paul O’Shannessy
aabfe79442 Update readme for 0.5.2 2013-12-18 16:45:17 -08:00
Paul O’Shannessy
01c4a706a3 Add starter-kit zip files to repo
These should be included so that anybody can build and update the docs
with as little confusion as possible.

I've left the directory in .gitignore so additions need to be
intentional as part of a release.
2013-12-17 22:02:31 -08:00
Pete Hunt
9a049d9774 Merge pull request #675 from chenglou/special-attrs
docs section for non-dom attributes and more in dom differences
2013-12-17 21:51:21 -08:00
Cheng Lou
47f2cacc6b docs add input attrs for Dom Differences 2013-12-18 00:46:59 -05:00
Cheng Lou
be17771270 docs section for non-dom attributes
Also added documentation for `dangerouslySetInnerHTML`.
2013-12-18 00:31:17 -05:00
Pete Hunt
294bac537d Merge pull request #668 from nicholasbs/fix-docs-typo
Fix typos
2013-12-17 18:39:14 -08:00
Pete Hunt
b7feb6f6eb Merge pull request #650 from jaredly/patch-1
rename this tip to be less confusing
2013-12-17 18:22:34 -08:00
Pete Hunt
20d736db4c Merge pull request #674 from squidsoup/tutorial-jquery-src
Documentation (minor): template missing jquery reference
2013-12-17 18:21:53 -08:00
Kit Randel
08babd2541 Tutorial template markup needs a reference to jquery for the ajax calls
from step 13 onwards.
2013-12-18 15:13:45 +13:00
Tim Yung
41230ef5dd A new helper for tests: createHierarchyRenderer
We aren't using this in any of the React tests, but we've found it
useful testing product code.
2013-12-17 18:07:53 -08:00
Jared Forsyth
e539c8c6c4 one liner 2013-12-17 17:12:21 -07:00
Jared Forsyth
bf6951687d changes as requested 2013-12-17 17:10:02 -07:00
Jared Forsyth
b5cfc72870 adding note about initializing state w/ props 2013-12-17 16:16:50 -07:00
Ben Newman
0bf9910ae9 Merge pull request #672 from benjamn/upgrade-populist
Upgrade populist dependency to v0.1.6.
2013-12-17 13:49:51 -08:00
Ben Newman
b805eff032 Upgrade populist dependency to v0.1.6.
This reduces the time taken by `grunt populist:test` from 7s to 550ms,
which should make @spicyj especially happy.

Relevant commits from the `populist` and `ast-types` repositories:
9863ad16c0
dabef2a4ac
2013-12-17 16:26:51 -05:00
Ben Newman
df3bd393eb Merge pull request #661 from benjamn/upgrade-recast
Upgrade recast dev dependency to v0.5.6.
2013-12-17 11:54:27 -08:00
Ben Newman
f3a6775098 Upgrade recast dev dependency to v0.5.6.
Paving the way for source maps.
2013-12-17 14:50:36 -05:00
Paul O’Shannessy
c215bc3cd4 Update npm-react readme to point to autoflow 2013-12-17 11:21:08 -08:00
Paul O’Shannessy
adfb5f1eae Update npm-react error to point to autoflow 2013-12-17 11:18:27 -08:00
Pete Hunt
d663d42d23 Merge pull request #670 from subtleGradient/subtlegradient/escape-the-things
the things, escape them
2013-12-17 09:03:01 -08:00
Thomas Aylott
7f3d4f0340 fixes ReactTextComponent rootID unescapedness 2013-12-17 05:07:49 -05:00
Thomas Aylott
346c8f5e6e test case for ReactTextComponent rootID escaping 2013-12-17 05:05:28 -05:00
Nicholas Bergson-Shilcock
93eb6a5637 Fix typo in comments (ot -> to) 2013-12-15 12:12:38 -05:00
Nicholas Bergson-Shilcock
760cdd35c9 Fix typo (ot -> to) 2013-12-15 12:11:47 -05:00
Pete Hunt
3ad2938dfa Merge pull request #657 from zpao/grunt-version-check-cleanup
Grunt version check cleanup
2013-12-15 01:45:30 -08:00
Paul O’Shannessy
5a5137ded4 Merge pull request #651 from fabiomcosta/patch-2
Improving never seen error message
2013-12-13 10:23:46 -08:00
Paul O’Shannessy
c2920ba84c Merge pull request #653 from fabiomcosta/patch-3
match -> test
2013-12-12 15:33:31 -08:00
Fabio M. Costa
39037eedd1 URL -> url 2013-12-12 15:29:29 -08:00
Ben Newman
7c95194ec0 Merge pull request #637 from cpojer/use-rest-params
Use Rest Parameters where it makes sense
2013-12-12 14:53:50 -08:00
Paul O’Shannessy
8fda127748 Check src file for version-check task
This lets the task run stand-alone without building
2013-12-11 17:06:06 -08:00
Paul O’Shannessy
54bac2f07f Move version-check task into own file
Gruntfile.js is really messy :(
2013-12-11 17:01:18 -08:00
Josh Duck
8b0af9b5de Fix SelectEventPlugin
mouseup was not fired when context menu showed, so select events stopped being fired.
2013-12-11 13:46:11 -08:00
Tim Yung
02de96f012 Fix Merging propTypes, contextTypes, and childContextTypes
This fixes merging of `propTypes`, `contextTypes`, and `childContextTypes` so that we actually merge (instead of only taking the component or last mixin).
2013-12-11 13:45:55 -08:00
Ben Alpert
e92ce38cf1 Add loop property 2013-12-11 11:46:16 -08:00
cpojer
decb49a202 Use rest parameters whenever it makes sense. 2013-12-11 10:30:10 -08:00
Fabio M. Costa
c7129fd377 match -> test
Using RegExp method `test` because this is what is wanted
2013-12-11 00:43:31 -08:00
Fabio M. Costa
4b3fa413a1 Improving never seen error message
Removing repeating "support it" and fixing camelCase method name
2013-12-10 21:07:41 -08:00
Jared Forsyth
043a986ba9 fixing capitalization 2013-12-10 11:59:29 -07:00
Jared Forsyth
7640e53102 rename this tip to be less confusing
Using props to initialize state is completely fine; the issue is using state as a "cache" for values calculated based off of props. This title makes it more clear.
2013-12-10 11:50:44 -07:00
Paul O’Shannessy
b268f95e1f Merge pull request #648 from bricooke/patch-1
Update highlighted lines in tutorial
2013-12-09 23:44:51 -08:00
Paul O’Shannessy
8dfdd1d106 Make travis quieter on IRC 2013-12-09 16:03:47 -08:00
Paul O’Shannessy
80e0e2a13f Clean trailing space and lint 2013-12-09 15:54:16 -08:00
Paul O’Shannessy
5c65abfbac Merge remote-tracking branch 'syranide/textarearows' 2013-12-09 15:51:38 -08:00
Paul O’Shannessy
904cf15972 Merge pull request #646 from spicyj/lint2
Fix lint error (unused variable)
2013-12-09 15:49:02 -08:00
Brian Cooke
42dee34146 Update highlighted lines in tutorial
Minor issue, but I found it distracting that the highlighted lines were not accurate. I *believe* this fixes them up.
2013-12-09 15:16:37 -08:00
Ben Alpert
277abbfe7b Fix lint error (unused variable) 2013-12-09 12:29:03 -08:00
Thomas Aylott
00c8160f8e Merge pull request #628 from subtleGradient/subtlegradient/travis-task-cleanup
add browser testing to travis
2013-12-09 12:19:33 -08:00
Thomas Aylott
feeebfbc51 removed complexity report until it's fixed 2013-12-09 14:55:21 -05:00
Thomas Aylott
55f50ca4d1 enable code coverage and code complexity reports 2013-12-09 14:55:21 -05:00
Thomas Aylott
0c366ce648 fix lint 2013-12-09 14:55:21 -05:00
Thomas Aylott
1b477fa40c move sauce labs config out of the Gruntfile 2013-12-09 14:55:21 -05:00
Thomas Aylott
a41c20d43b sets each IE separately for now 2013-12-09 14:55:20 -05:00
Thomas Aylott
fe8008e67c PICK ALL THE NITS!!!1! 2013-12-09 14:55:20 -05:00
Thomas Aylott
4af362b751 combine iOS and IE matrix tests 2013-12-09 14:55:20 -05:00
Thomas Aylott
8e3cb7bd9d tests fail in Safai now. unblocking for now.
Add these back in as build blockers once those issues are fixed.
2013-12-09 14:55:20 -05:00
Thomas Aylott
c6f99c3a84 iOS is failing again. Will debug separately 2013-12-09 14:55:20 -05:00
Thomas Aylott
b8ee94d999 define public saucelabs info for everything to use 2013-12-09 14:55:20 -05:00
Thomas Aylott
3308137d8d run tests in old iOS, but allow failures 2013-12-09 14:55:20 -05:00
Thomas Aylott
e944b68e8c new grunt test:full task tests in many browsers
Moved the travis specific stuff back into the travis file
2013-12-09 14:55:20 -05:00
Thomas Aylott
e560229c83 secure tokens aren't available for pull requests
Now you can use the saucelabs jazz locally also.
2013-12-09 14:55:20 -05:00
Thomas Aylott
18459deb77 enable IE browser testing in travis 2013-12-09 14:55:20 -05:00
Thomas Aylott
a13bd1e251 simplify travis script 2013-12-09 14:55:20 -05:00
Ben Alpert
7325189890 Fix scrollLeft/scrollTop warning in latest Chrome
Chrome gives the warnings

```
body.scrollLeft is deprecated in strict mode. Please use 'documentElement.scrollLeft' if in strict mode and 'body.scrollLeft' only if in quirks mode.
body.scrollTop is deprecated in strict mode. Please use 'documentElement.scrollTop' if in strict mode and 'body.scrollTop' only if in quirks mode.
```

the first time getUnboundedScrollPosition is invoked. This fixes it. (All modern browsers support `pageYOffset`; IE 8 doesn't but works properly with `document.documentElement.scrollTop` except in quirks mode which React doesn't support.)
2013-12-07 15:57:23 -08:00
Paul O’Shannessy
153b75f186 Bump version to 0.9.0-alpha
This is trunk, which will be 0.9. We'll have to cherry-pick this whole
thing into a 0.8 branch.
2013-12-06 15:11:25 -08:00
Paul O’Shannessy
a42b61fa85 Fix botched rebase 2013-12-06 15:10:57 -08:00
Paul O’Shannessy
ce0f244c54 Move npm-react-core to npm-react, fix tasks accordingly 2013-12-06 15:10:15 -08:00
Paul O’Shannessy
9fdf589976 Update react package readme 2013-12-06 12:03:16 -08:00
petehunt
ef339c9cc4 Version bump, make tests work 2013-12-06 11:56:30 -08:00
petehunt
e5c4a3c7d5 update README 2013-12-06 11:56:30 -08:00
petehunt
036e621467 version bump to 0.8 to get on top of react.js 2013-12-06 11:56:30 -08:00
petehunt
0b97c6438e rename to with associated warnings 2013-12-06 11:56:30 -08:00
petehunt
6269cbf482 rename to with associated warnings 2013-12-06 11:56:30 -08:00
petehunt
82f211f6b8 revert muffinize :( 2013-12-06 11:56:30 -08:00
petehunt
90e2258791 response to code review 2013-12-06 11:56:30 -08:00
petehunt
d197992dc8 update npm-react-core package.json 2013-12-06 11:56:30 -08:00
Paul O’Shannessy
9162cb8abe react-core npm module 2013-12-06 11:56:29 -08:00
petehunt
e839405202 muffinification 2013-12-06 11:56:29 -08:00
petehunt
5466d0a063 first work: __DEV__
fix invariant

Get browserify working

remove dead code elimination step since it is not needed due to minifier

use industry standard NODE_ENV
2013-12-06 11:56:29 -08:00
Paul O’Shannessy
9270d3d56e Merge pull request #592 from spicyj/guard-fn
ReactErrorUtils: In prod, just return the original
2013-12-06 11:31:02 -08:00
Cartas
7d8190f56e Updated the animation-fix to account for transitionEnter being false. 2013-12-06 15:37:38 +01:00
Cartas
c313a1045d Nodes that have had their child removed already, but then get given a new one no longer bug-out.
In the case of having an animated node which is, after the leave-transition has been activated, then re-added in a render call causes React to 'break'.  This is especially noticeable if you spam to removal and re-addition of an item in a ReactTransitionGroup.

This fix simply stops the leave transition and restarts the enter transition.
2013-12-06 14:46:33 +01:00
Ben Alpert
1be9a9e986 Bump version of wd
wd 0.2.2 gives `TypeError: Cannot call method 'jsCondition' of undefined` since #551; 0.2.6 is the latest and works so switch to that.
2013-12-05 17:13:52 -08:00
Paul Shen
12e765dd27 Revert "Don't mutate passed-in props"
This reverts https://github.com/facebook/react/pull/576

This approach mutates the default props for the instance on each update,
which causes incorrect behavior. discussed with @balpert. can look into
cloning but this unbreaks.
2013-12-05 16:53:43 -08:00
Paul O’Shannessy
a7f6082c9c Merge pull request #636 from cpojer/rest-parameters-react
Add more useful ES6 transforms to jsx-internal.
2013-12-05 16:47:31 -08:00
Paul O’Shannessy
2ebbbc5145 Followup fix for lint 2013-12-05 15:55:49 -08:00
Paul O’Shannessy
7db8f818bc Merge remote-tracking branch 'spicyj/depth-not-owner' 2013-12-05 15:51:39 -08:00
Thomas Aylott
55e3b64ff4 Merge pull request #635 from subtleGradient/subtlegradient/fixes-webdriver-test
fixes webdriver issues
2013-12-05 14:55:52 -08:00
Thomas Aylott
d035268c41 Merge pull request #617 from subtleGradient/subtlegradient/complexity-task
NEW `grunt complexity` reporting task
2013-12-05 14:55:17 -08:00
Ben Alpert
d0883c8cc7 Use depth (not owner) to check for root components
Fixes #557.
2013-12-05 13:36:29 -08:00
Thomas Aylott
2807202ee7 bump webdriver timeouts
fixes #634
fixes #551
2013-12-05 16:27:26 -05:00
Thomas Aylott
60f2e45d2d fixes test runner for IE8 2013-12-05 16:27:26 -05:00
Thomas Aylott
c222c46146 filter out tests from complexity report 2013-12-05 16:27:10 -05:00
Thomas Aylott
2b3e97b5a4 NEW grunt complexity reporting task 2013-12-05 16:27:10 -05:00
Andreas Svensson
27b8e7a6f4 corrections 2013-12-05 19:40:48 +01:00
cpojer
31359e9962 Add more useful ES6 transforms to jsx-internal. 2013-12-05 10:20:24 -08:00
Andreas Svensson
4d6d4b54d6 Fix ReactDOMTextarea missing "rows" and "cols" attribute, incorrect "size" property 2013-12-05 18:36:48 +01:00
Andreas Svensson
e060eabb01 Add HAS_POSITIVE_NUMERIC_VALUE to DOMProperty and normalize behavior of null values
Uniformly remove null values, rather than sometimes set/remove, could potentially assign 'null' or 'undefined'
2013-12-05 18:36:46 +01:00
Paul O’Shannessy
09bdcefd4f Notify travis build results in IRC channel
If this gets noisy, we can change to only notify on change.
2013-12-04 21:19:24 -08:00
Paul O’Shannessy
2bbc42ce41 Update package devDependencies 2013-12-04 21:07:16 -08:00
Marshall Roch
d17bd176a2 Remove support for putting mixins, propTypes, etc. in 'statics'
This leaves statics as a way to define static methods and properties
that will be accessible on the return value of `React.createClass`
without changing the current spec.
2013-12-04 20:27:44 -08:00
Sean Kinsey
c2e48740fc [ReactTransitionGroup] Add onTransitionEnter and onTransitionLeave
It is valuable to know when the number of children in a TransitionGroup is going
to increase or decrease, since we might want to apply extra animations.
For instance, when used with overflow:auto, we might want to apply different css
based on it overflowing or not - to do this we need to calculate this after new
nodes has entered and after nodes has been removed.
2013-12-04 20:27:28 -08:00
John Watson
bf24dc33f7 Separate replaceState invariant violations
It'd be nice if we knew which error we were hitting when this invariant hit.
2013-12-04 20:27:24 -08:00
Marshall Roch
e3ad088ff3 Remove deprecation warning for React statics 2013-12-04 20:27:19 -08:00
Paul O'Shannessy
1b8bdbe177 Remove deprecated React.unmountAndReleaseReactRootNode 2013-12-04 20:27:15 -08:00
Marshall Roch
79b9d5af62 Introduce 'statics' for class specification
This moves the static properties off of the root object and into
a 'statics' property. Then they are made available on the constructor so
they can be used directly and in mixins.
2013-12-04 18:39:44 -08:00
Ben Newman
66f6cbad56 Merge pull request #535 from benjamn/commoner-cache-buster
Establish a convention for forcing jsx rebuilds.
2013-12-04 13:54:29 -08:00
Ben Newman
057c88ce52 s/jsxConfig/commonerConfig/g 2013-12-04 16:47:13 -05:00
Ben Newman
3527d9d91c Establish a convention for forcing jsx rebuilds.
Pull request #526 updated the behavior of vendor/constants.js without
changing any source files or the bin/jsx-internal script, so files that
should have been rebuilt (like utils/__tests__/ImmutableObject-test.js)
were not automatically rebuilt (unless you knew to do `grunt clean` or
`rm -rf .module-cache` manually).

This commit allows us to bump a version number when we know the transform
toolchain has been altered in a way that will not be visible to
commoner/jsx.

With this convention, if we reset to an older revision (e.g. during a git
bisect) and the appropriate cached module files are still in the
.module-cache/, they can be used without rebuilding. That's why I prefer
this approach to just deleting the .module-cache/.

Closes #104.
Closes #496.
Closes #530.
2013-12-04 16:36:59 -05:00
Ben Newman
affe7f98b5 Merge pull request #367 from benjamn/findComponentRoot-memory-usage-improvements
Space optimizations for ReactMount.findComponentRoot.
2013-12-04 13:20:29 -08:00
Paul O’Shannessy
bcd7b5d194 Merge pull request #630 from spicyj/remove-updatePropertiesByID
Remove unused updatePropertiesByID
2013-12-04 10:34:35 -08:00
Ben Alpert
9d443542f9 Remove unused updatePropertiesByID 2013-12-03 19:22:36 -08:00
Ben Newman
87db648f3e Address pull request feedback. 2013-12-03 16:43:37 -05:00
Ben Newman
6b9fc81b64 Space optimizations for ReactMount.findComponentRoot. 2013-12-03 16:43:37 -05:00
Vjeux
e4909d0f2e Add video at the bottom of the front page 2013-12-03 12:11:12 -08:00
Paul O’Shannessy
9d18956b09 Merge pull request #624 from spicyj/remove-registrationNamesKeys
Remove unused event plugin registrationNamesKeys
2013-12-02 16:03:36 -08:00
Paul O’Shannessy
cd3bfe64d4 Fix blog pagination
I missed this in the Jekyll upgrade.
2013-12-02 15:46:20 -08:00
Paul O’Shannessy
241f4d29b2 [docs] Fix download links to addons builds 2013-12-02 15:13:49 -08:00
Pete Hunt
3851462b80 Fix lint warnings 2013-12-02 13:32:09 -08:00
Paul O’Shannessy
76e3294c8f Merge pull request #609 from subtleGradient/subtlegradient/fixes-ios-crasher
fixes iOS crasher
2013-12-02 13:25:40 -08:00
Paul O’Shannessy
d64256fb65 Merge pull request #626 from spicyj/getUnboundedScrollPosition-license
Add missing license header
2013-12-02 09:07:07 -08:00
petehunt
00adabc20d Fix frontpage example to retain selection 2013-12-02 04:04:45 -08:00
Ben Alpert
1cb402c410 Add missing license header 2013-12-02 01:12:20 -08:00
Pete Hunt
e923e22c16 Merge pull request #625 from spicyj/patch-3
Tweaks to README
2013-12-01 23:06:51 -08:00
Ben Alpert
55cd8bee35 Tweaks to README
Most significant change is updating the leading copy to match #440.
2013-12-01 22:49:46 -08:00
Ben Alpert
4323ab095f Remove unused event plugin registrationNamesKeys 2013-12-01 22:28:19 -08:00
Pete Hunt
22dc8fa765 Merge pull request #602 from chenglou/tips-bind
docs tips pass arguments to callbacks
2013-12-01 19:07:14 -08:00
Cheng Lou
e98244adb5 docs tips parent-child communication 2013-12-01 21:39:22 -05:00
Pete Hunt
92b62bf1fe Merge pull request #576 from spicyj/immutable-props
Don't mutate passed-in props
2013-12-01 18:26:41 -08:00
Pete Hunt
2a84b6c6b2 Merge pull request #537 from hojberg/dont_animate_undefined_children
ReactTransitions: Don't animate undefined children
2013-12-01 14:21:11 -08:00
Pete Hunt
285e3a8929 Merge pull request #440 from petehunt/new-taglines
New marketing copy
2013-12-01 14:00:13 -08:00
Pete Hunt
ab36b114fc Merge pull request #581 from chenglou/docs-select-value
docs `select` `value` to control chosen option
2013-12-01 13:53:12 -08:00
Paul O’Shannessy
d8a1dbb19c Merge pull request #618 from chenglou/didmout-didUpdate-new
docs remove rootNode for componentDidMount/Update
2013-11-27 18:50:10 -08:00
Cheng Lou
cffb115480 docs remove rootNode for componentDidMount/Update 2013-11-27 21:46:02 -05:00
Paul O’Shannessy
98b9e2faeb Merge pull request #599 from chenglou/dl-addons
docs add download links for react-with-addons
2013-11-27 14:48:42 -08:00
Cheng Lou
11638b7824 docs add download links for react-with-addons 2013-11-27 17:31:27 -05:00
Paul O’Shannessy
8fbdb50a9d Merge pull request #597 from spicyj/gh-527
Don't use .returnValue if .defaultPrevented exists
2013-11-27 14:28:26 -08:00
Paul O’Shannessy
5fbd8109f8 Merge pull request #598 from spicyj/gh-516
Be resilient to fn.name not existing in IE
2013-11-27 14:28:02 -08:00
Paul O’Shannessy
126ef094fc Merge pull request #593 from spicyj/run-lint
Run lint on Travis in a matrix
2013-11-27 14:14:33 -08:00
Thomas Aylott
916ee6b394 jsx & JSDOM support 2013-11-27 17:04:40 -05:00
Ben Alpert
2104327ba1 Run lint automatically on Travis (in a matrix) 2013-11-27 16:53:57 -05:00
Paul O’Shannessy
42eef0e9d6 Merge pull request #610 from chenglou/jsx-js
make docs jsx compiler highlight transpiled js code
2013-11-27 12:22:51 -08:00
Paul O’Shannessy
e31fdfd0b3 Merge pull request #616 from davidhellsing/patch-1
Backbone example: changed key from Math.random() to todo.cid
2013-11-27 12:14:40 -08:00
Marshall Roch
697a9113c0 ReactPropTypes: add oneOfType to support union types
Summary:
e.g.

  propTypes: {
    foo: React.PropTypes.oneOfType([
      React.PropTypes.string,
      React.PropTypes.number
    ]);
  }

to do this, I exposed a `.weak` chainable validator that returns instead of throws, e.g.

  React.PropTypes.string.isRequired.weak
  React.PropTypes.string.weak

which returns true or false. Technically, `React.PropTypes.string.weak.isRequired` also exists, but `oneOfType` will never call it. Might be useful to people creating custom validators though.
2013-11-27 12:10:50 -08:00
Marshall Roch
351dcfed01 Validate propTypes, contextTypes, childContextTypes
who watches the watchmen?
2013-11-27 12:10:50 -08:00
Pete Hunt
fcfe516a2e Less verbose ReactPropTypeLocations logging
Since we use keyMirror() and invariant() messages are only shown in __DEV__, we don't have to do manual constant->string translation. Also fixes a few
undefined keys that just happened to work before.
2013-11-27 12:10:50 -08:00
Paul O’Shannessy
9886e40395 Merge pull request #594 from spicyj/skip-spec
Allow running one spec/suite in the web interface
2013-11-27 11:54:31 -08:00
Paul O’Shannessy
a7811fb75b Merge pull request #595 from spicyj/old-logger
Remove reference to old browser logger
2013-11-27 11:46:15 -08:00
David Hellsing
a79ef7fc29 Changed key from Math.random() to todo.cid
It doesn’t make much sense to generate a random key for each todo render, because it will re-draw all todo’s DOM nodes on each model change. I changed it to the unique identifier ``todo.cid`` already supplied by the backbone model.
2013-11-26 18:07:56 +01:00
Andreas Svensson
15ce8ecfe9 Polyfill and normalize HTML5 "key", deprecates which and keyCode 2013-11-26 10:09:50 +01:00
Cheng Lou
92ea31c7b7 make docs jsx compiler highlight transpiled js code 2013-11-25 19:04:28 -05:00
Thomas Aylott
f4753030a2 IE support 2013-11-25 16:02:01 -05:00
Thomas Aylott
3bfb687de3 remove warning comment about createHTMLDocument 2013-11-25 15:08:00 -05:00
Thomas Aylott
eebad16636 Use an iframe to create a testDocument…
instead of `createHTMLDocument` since it isn't fully support by the browsers we care about.

fixes #606
fixes #454
2013-11-25 15:05:35 -05:00
Thomas Aylott
564c8669f8 Merge pull request #596 from spicyj/gh-532
'getElementsByClassName' doesn't exist in IE8
2013-11-25 09:29:52 -08:00
Pete Hunt
a7f0afceec Merge pull request #589 from balanceiskey/master
Minor spelling correction in docs
2013-11-24 20:53:35 -08:00
Ben Newman
1f8f0ae2d6 Merge pull request #601 from spicyj/commoner-088
Update commoner to 0.8.8 for Windows support.
2013-11-24 13:06:59 -08:00
Ben Alpert
0e2840abce Update commoner to 0.8.8 for Windows support
benjamn/commoner#44 fixed commoner to work on Windows when module path relativization isn't used; with this, the `jsx` binary should work properly on Windows (though `jsx-internal` still won't).

Fixes #316, fixes #391, fixes #567.
2013-11-24 16:02:01 -05:00
Ben Alpert
685dec022a Be resilient to fn.name not existing in IE
Fixes #516.
2013-11-24 01:53:53 -05:00
Ben Alpert
e6e71a4953 ReactErrorUtils: In prod, just return the original
This will save a stack frame (nice when in a debugger) and presumably be a bit faster.
2013-11-24 01:47:15 -05:00
Ben Alpert
4bd0a40037 Don't use .returnValue if .defaultPrevented exists
`.defaultPrevented` exists in IE9+. I checked in IE9, Chrome, and Firefox that it does default to `false`.

Fixes #527.
2013-11-24 01:35:49 -05:00
Ben Alpert
b99fd93684 'getElementsByClassName' doesn't exist in IE8
Fixes #532.
2013-11-24 01:22:00 -05:00
Ben Alpert
67c851792a Remove reference to old browser logger
The file was removed in 37bb9b76aba0deb445874273b93955ffb1c18bf8; this was giving a 404.
2013-11-24 01:04:09 -05:00
Ben Alpert
3a75d70501 Allow running one spec/suite in the web interface
This is the proper way to make it filter the spec list:

https://github.com/pivotal/jasmine/blob/1_3_x/spec/runner.html

I submitted the jasmine-jsreporter change as a pull request here:

https://github.com/detro/jasmine-jsreporter/pull/2

Fixes #563.
2013-11-24 00:53:29 -05:00
Sundeep Malladi
b7ef221b27 Minor spelling correction in docs 2013-11-22 14:32:53 -06:00
Pete Hunt
d51ae6b8bc Merge pull request #575 from spicyj/owner
Move __owner__ off of props
2013-11-21 17:44:48 -08:00
Ben Alpert
61abc645e5 Move __owner__ off of props 2013-11-21 17:34:52 -08:00
Ben Newman
2a66c9b089 Merge pull request #586 from benjamn/reinstate-ReactEventEmitter-mocking
Add back mocking removed to make ReactEventTopLevelCallback-test pass.
2013-11-21 11:07:57 -08:00
Ben Newman
52d3b47f48 Add back mocking removed to make ReactEventTopLevelCallback-test pass.
This is a partial reversion of commit 9937f0c8bd.
2013-11-21 10:57:24 -08:00
Ben Newman
97bbd852b2 Merge pull request #584 from spicyj/mock
Mock modules properly in test runner.
2013-11-21 10:31:59 -08:00
Ben Alpert
af95b35f27 Have faith in var hoisting 2013-11-21 10:31:20 -08:00
Ben Alpert
c7bb3af760 Mock modules properly in test runner
As an added bonus, the jasmine web interface now groups tests by file.

Test Plan:
grunt test passes on b2507066, the parent of 566f8b2e (which committed a workaround for buggy module mocking).
2013-11-21 00:39:37 -08:00
Cheng Lou
0a3d0163d0 docs select value to control chosen option 2013-11-20 22:34:53 -05:00
Ben Newman
566f8b2e85 Merge pull request #573 from spicyj/tests
Make ReactEventTopLevelCallback-test pass
2013-11-20 16:54:15 -08:00
Paul O’Shannessy
b2507066b6 Don't call utils.traverse in transform
Accidental change we missed in review of #495.
2013-11-20 15:36:54 -08:00
Christopher Chedeau
e73900dad4 Remove rootNode from componentDidMount and componentDidUpdate
We can already access the DOM node using `this.getDOMNode()`. Passing it as an argument was a bad decision.

Previous API:

```
componentDidMount(DOMElement rootNode)
componentDidUpdate(object prevProps, object prevState, object prevContext, DOMElement rootNode)
```

Next API:

```
componentDidMount()
componentDidUpdate(object prevProps, object prevState, object prevContext)
```
2013-11-20 14:20:35 -08:00
Christoph Pojer
2fe2cd5337 Ensure ReactPerf always uses a string as a URL 2013-11-20 14:19:13 -08:00
Tim Yung
04c3e2e407 Add nextContext to componentWillReceiveProps
Add `nextContext` as an argument to `componentWillReceiveProps`. We can figure out what to rename the method to later.
2013-11-20 14:19:01 -08:00
Christopher Chedeau
a23d43bf05 Use this.getDOMNode() instead of last argument of componentDidMount 2013-11-20 14:18:49 -08:00
Marshall Roch
934ef1d4c2 Fix context in callbacks
callbacks like shouldComponentUpdate, componentDidUpdate, etc. were getting the full, unsanitized context, instead of the one that's been filtered down to only the fields allowed to be visible by contextTypes.
2013-11-20 14:18:28 -08:00
Christopher Chedeau
c8b6fe51d9 Use this.getDOMNode() instead of last argument of componentDidUpdate
Context is adding another argument that shifts all of them by one. Since we can already use this.getDOMNode(), it doesn't really make sense to pass it as an argument to that function.
2013-11-20 14:18:07 -08:00
Marshall Roch
3fd3341ab9 remove transaction argument from componentWillReceiveProps 2013-11-20 14:17:23 -08:00
Paul O'Shannessy
060118c7e4 order object properties consistently 2013-11-20 14:17:13 -08:00
Pete Hunt
3651b8892f Merge pull request #578 from spicyj/patch-2
autoBind -> Autobinding
2013-11-20 11:47:22 -08:00
Ben Alpert
d49d84b250 autoBind -> Autobinding
We don't use the term autoBind anywhere any more.
2013-11-20 11:42:05 -08:00
Pete Hunt
0df4be849f Merge pull request #577 from stillmotion/master
Add explination of autoBind to DOM Event Listener tip
2013-11-20 11:41:11 -08:00
Levi McCallum
ceaf3fba32 Add explination of autoBind to DOM Event Listener tip 2013-11-20 11:29:05 -08:00
Ben Alpert
42c14b8078 Don't mutate passed-in props
Depends on #575; fixes #570.  Now we'll be in trouble if someone tries to share objects between calls to getDefaultProps but that was already true of getInitialState and I haven't heard any complaints there.

This is the same number of allocations as before; we're just copying props in the other direction. (In any case, the copy happens only on mount and there are a couple dozen costlier things we're doing already at that time.)
2013-11-20 01:17:10 -08:00
Ben Alpert
9937f0c8bd Make ReactEventTopLevelCallback-test pass
This module-level mock() seems to have been interfering with other tests (26 specs failing). We don't have any other tests that do a module-level mock() so I'm going to assume it isn't supported in the open-source test runner right now. I changed it so only ReactEventEmitter.handleTopLevel is mocked; doing so made ReactEventEmitter complain that TopLevelCallbackCreator wasn't defined so I switched the ReactMount references to use React directly so that ReactDefaultInjection would kick in properly.

With this, all the tests pass.
2013-11-19 23:46:32 -08:00
Paul O’Shannessy
bd1f5e7e16 Put nav data in "_data"
New in Jekyll 1.3 - http://jekyllrb.com/docs/datafiles/
2013-11-19 15:52:42 -08:00
Paul O’Shannessy
f37fd7a7a3 Fix pagination 2013-11-19 15:25:00 -08:00
Paul O’Shannessy
378a49bf3c Update jekyll to 1.3 2013-11-19 15:18:15 -08:00
Vjeux
96e97c1a87 Community round-up #11 2013-11-19 22:56:34 +01:00
Paul O’Shannessy
5f22259964 Merge pull request #565 from chenglou/className-htmlFor
docs highlight className and htmlFor transforms
2013-11-19 11:01:10 -08:00
Jeff Morrison
ab47e99215 Merge pull request #495 from syranide/fixutils
utils.* is now used everywhere
2013-11-19 10:59:16 -08:00
Cheng Lou
1fcd6412fb docs highlight className and htmlFor transforms 2013-11-18 21:42:51 -05:00
Cheng Lou
ce0eec97db docs classSet semicolons missing 2013-11-18 21:22:14 -05:00
Paul O’Shannessy
5d2f0b4e07 Merge branch 'chenglou-classSet'
closes #463
2013-11-18 18:00:24 -08:00
Paul O’Shannessy
e79079d174 Merge pull request #539 from spicyj/doc-anchors-again
Make doc headers clickable again
2013-11-18 17:45:39 -08:00
Ben Alpert
e94ebee15e Make doc headers clickable again
...without preventing clicks on other things.

Just use an `<a name="...">` tag that doesn't take up any space to make sure that we're not covering up something else.

For whatever reason, doing `position: relative; top: -$navHeight;` doesn't work and causes the anchor target not to be moved up. This solution works in both Chrome and Firefox.
2013-11-18 17:34:44 -08:00
Ben Newman
5d878ce914 Merge pull request #550 from subtleGradient/subtlegradient/code-coverage
Code coverage grunt tasks.
2013-11-18 14:03:56 -08:00
Thomas Aylott
5ae152cdcf simplified the sort function 2013-11-18 16:37:47 -05:00
Thomas Aylott
c6f7fe00fa Lines too long; reformatted 2013-11-18 16:37:47 -05:00
Thomas Aylott
45063aed44 picked all the lint 2013-11-18 16:37:47 -05:00
Thomas Aylott
5feb745b02 fixes the case when coverage isn't turned on 2013-11-18 16:37:47 -05:00
Thomas Aylott
eda56b7af2 new grunt test:coverage task 2013-11-18 16:37:47 -05:00
Thomas Aylott
8f96ec255b new grunt browserify:withCodeCoverageLogging task 2013-11-18 16:37:47 -05:00
Thomas Aylott
ad0d9e4761 consoleLoggerMiddleware handles coverage logs 2013-11-18 16:37:47 -05:00
Thomas Aylott
b5b60a6acf speed up server middleware slightly 2013-11-18 16:37:46 -05:00
Thomas Aylott
cb6b7f37e7 fixes an issue where the list of files to test isn't complete 2013-11-18 16:37:46 -05:00
Thomas Aylott
ef5a02c164 enable coverage logging from the worker 2013-11-18 16:37:46 -05:00
Thomas Aylott
646421f71f batch logs until the end unless ran with --debug 2013-11-18 16:37:46 -05:00
Thomas Aylott
4c881d8487 require coverify 2013-11-18 16:37:46 -05:00
Thomas Aylott
5aa901336c ignore logs and testing stuff 2013-11-18 16:37:46 -05:00
Thomas Aylott
61c1bf0a41 fixes browserify task transforms support 2013-11-18 16:37:46 -05:00
Daniel Lo Nigro
d853c8568e Propagate events to parent components when nested
When events are captured, the nearest React-rendered ancestor is found and events are propagated to its tree. This causes issues when components are nested as only the innermost component receives the events.

This change modifies this behaviour so events propagate all the way up the DOM hierarchy. To reduce the performance cost, this DOM traversal is only done if the component is actually nested (determined by the `containerIsNested` map which is lazily initialised).
2013-11-18 10:56:29 -08:00
Marshall Roch
b91396be8e Contexts
Summary:
adds `this.context` which you can think of as implicit props, which are passed automatically down the //ownership// hierarchy.

Contexts should be used sparingly, since they essentially allow components to communicate with descendants (in the ownership sense, not parenthood sense), which is not usually a good idea. You probably would only use contexts in places where you'd normally use a global, but contexts allow you to override them for certain view subtrees which you can't do with globals.

The context starts out `null`:

  var RootComponent = React.createClass({
    render: function() {
      // this.context === null
    }
  });

You should **never** mutate the context directly, just like props and state.

You can change the context of your children (the ones you own, not `this.props.children` or via other props) using the new `withContext` method on `React`:

  var RootComponent = React.createClass({
    render: function() {
      // this.context === null
      var children = React.withContext({foo: 'a', bar: 'b'}, () => (
        // In ChildComponent#render, this.context === {foo: 'a', bar: 'b'}
        <ChildComponent />
      ));
      // this.context === null
    }
  });

Contexts are merged, so a component can override its owner's context **for its children**:

  var ChildComponent = React.createClass({
    render: function() {
      // this.context === {foo: 'a', bar: 'b'} (for the caller above)
      var children = React.withContext({foo: 'c'},() => (
        // In GrandchildComponent#render,
        // this.context === {foo: 'c', bar: 'b'}
        <GrandchildComponent />
      ));
      // this.context === {foo: 'a', bar: 'b'}
    }
  });
2013-11-18 10:56:24 -08:00
Pete Hunt
7df127db31 Better error message for renderComponentToString()
Reported on Twitter by AirBnb (who are integrating React into their open-source JS framework). They made a mistake and passed a string in as the
component. We should have a better error message for that.
2013-11-18 10:54:05 -08:00
Tim Yung
8529f1b053 Remove Obsolete IE8 Compatibility Code
See the TODO comment. Synthetic events have shipped and this is no longer necessary.
2013-11-18 10:54:03 -08:00
Marshall Roch
381a3392c6 Rename receiveProps to receiveComponent
This renames receiveProps and changes it to take the next component to copy props from instead of just the props. That is,

  component.receiveComponent(nextComponent, transaction)

instead of

  component.receiveProps(nextComponent.props, transaction)

This is a precursor to adding contexts, which will also need to get propagated just like props. This change allows ReactCompositeComponent to override `receiveProps` and do something like

  this._pendingContext = nextComponent.context;
2013-11-18 10:53:58 -08:00
Andreas Svensson
a39b8fda70 utils.* is now used everywhere 2013-11-15 11:17:24 +01:00
Pieter Vanderwerff
1e1d7fe770 Set docs menu item to active when viewing a “tips” page 2013-11-15 15:27:31 +13:00
Paul O’Shannessy
e6010bf75e Merge pull request #362 from mcsheffrey/feat-documentation-cookbook
React Tips documentation
2013-11-14 14:59:41 -08:00
Paul O’Shannessy
d1fa53ca03 Cleanup lint warnings from recent testing changes
Also, relaxed a rule for dot notation (and unrelaxed it in src).
2013-11-14 11:24:06 -08:00
Connor McSheffrey
26c142df82 Merge pull request #20 from zpao/tips
Updates to tips
2013-11-14 11:17:34 -08:00
Ben Newman
b61eacd3c5 Explicitly require the assert module in vendor/constants.js. 2013-11-14 13:48:08 -05:00
Paul O’Shannessy
1324eb5556 "use strict" in shouldUpdateReactComponent 2013-11-14 10:37:33 -08:00
Paul O’Shannessy
9cb3a3a182 Remove modules cache with grunt clean 2013-11-14 10:37:07 -08:00
Ben Newman
f9423241d9 Merge pull request #510 from subtleGradient/subtlegradient/run-the-browser-tests-on-saucelabs
Make it easy to run the browser tests on saucelabs.
2013-11-14 10:08:51 -08:00
Simon Højberg
5b1e4c0324 Transitions: Handle undefined input to mergeKeySet
Gracefully handle undefined input to mergeKeySet.
2013-11-13 23:02:06 -05:00
Simon Højberg
acbddd2641 ReactTransitions: Don't animate undefined children 2013-11-13 20:54:22 -05:00
Paul O’Shannessy
c821887160 formatting and syntax on false in JSX tip 2013-11-13 17:43:17 -08:00
Paul O’Shannessy
4367dad669 Update wording on AJAX tip 2013-11-13 17:43:17 -08:00
Paul O’Shannessy
0ebd3d92ba Fix broken link, spacing on events tip 2013-11-13 17:43:17 -08:00
Paul O’Shannessy
80ab7bf4e1 s/Zuck/Rogers/ 2013-11-13 17:43:17 -08:00
Paul O’Shannessy
4a9ed4a204 Fix broken link on componentWillReceiveProps tip 2013-11-13 17:43:16 -08:00
Paul O’Shannessy
f6f3d4262b fix broken link on controlled input tip 2013-11-13 17:43:16 -08:00
Paul O’Shannessy
75383c5c99 Children props tip tweak 2013-11-13 17:43:16 -08:00
Paul O’Shannessy
49261c9392 Fix broken link, formatting on px style tip 2013-11-13 17:43:16 -08:00
Paul O’Shannessy
fe52e059b9 Tweak for self closing tag tip 2013-11-13 17:43:16 -08:00
Paul O’Shannessy
684e5922e8 Tweaks to if-else tip 2013-11-13 17:43:16 -08:00
Paul O’Shannessy
7c1cf0a2dc Small cleanup to style tips 2013-11-13 17:43:16 -08:00
Pete Hunt
dab167c0e3 Merge pull request #460 from chenglou/opacity-1
fix doc & example transition opacity from .99 to 1
2013-11-13 17:31:08 -08:00
Thomas Aylott
326e3a33ac Merge pull request #529 from benjamn/upgrade-populist
Upgrade populist version to v0.1.5 for better error reporting
2013-11-13 14:50:36 -08:00
Ben Newman
d44c07b9a7 Upgrade populist version to v0.1.5 for better error reporting. 2013-11-13 17:42:17 -05:00
Thomas Aylott
22829b5529 remove unnecessary task config 2013-11-13 16:49:08 -05:00
Thomas Aylott
c4cd02efc5 fixes #513 2013-11-13 16:22:11 -05:00
Thomas Aylott
d1fd4058da sauce labs browser configs for running manually 2013-11-13 16:22:11 -05:00
Thomas Aylott
08bd1f98e5 wait a little longer for the page to load 2013-11-13 16:22:11 -05:00
Thomas Aylott
2d6eb3d8fc don't log your password to the console 2013-11-13 16:22:11 -05:00
Thomas Aylott
4daeda1490 log individual test results when in --debug mode 2013-11-13 16:22:11 -05:00
Thomas Aylott
c1925db067 cleanup 2013-11-13 16:22:11 -05:00
Thomas Aylott
cd24cbdbf4 name local saucelabs tests too 2013-11-13 16:22:11 -05:00
Thomas Aylott
d9b7e47824 sped up the webdriver tests 2013-11-13 16:22:11 -05:00
Thomas Aylott
b845134151 user JSON encoding for browser logger
Fixes a strange issue in IE
2013-11-13 16:22:11 -05:00
Thomas Aylott
37bb9b76ab remove old browser logger 2013-11-13 16:22:10 -05:00
Thomas Aylott
39ba5f90b1 no need to pass jasmine through jsx 2013-11-13 16:22:10 -05:00
Thomas Aylott
e3ced21c9d postDataToURL using ajax instead of DOM 2013-11-13 16:22:10 -05:00
Thomas Aylott
66a0f2e7bd Suppress encoding warning in Firefox 2013-11-13 16:22:10 -05:00
Thomas Aylott
7c8b70eedb better error handling for jasmine task 2013-11-13 16:22:10 -05:00
Thomas Aylott
f12c428c78 NEW saucelabs webdriver task 2013-11-13 16:22:10 -05:00
Thomas Aylott
7ee30554ad ignore tunnel logs 2013-11-13 16:22:10 -05:00
Thomas Aylott
6b1042a6f9 fixup sauce-tunnel 2013-11-13 16:22:10 -05:00
Thomas Aylott
ff857efdd2 desiredCapabilities webdriver config 2013-11-13 16:22:10 -05:00
Thomas Aylott
0401a0a67c NEW sauce-tunnel grunt task 2013-11-13 16:22:10 -05:00
Ben Newman
5873ee7691 Merge pull request #526 from benjamn/rewrite-vendor/constants.js
Rewrite vendor/constants.js to use require("recast").types.traverse.
2013-11-13 12:39:53 -08:00
Ben Newman
da717977ed Better comments for vendor/constants.js. 2013-11-13 15:33:10 -05:00
Ben Newman
2b763fc452 Rewrite vendor/constants.js to use require("ast-types").traverse.
Most notably, this new style of transformation gives us access to
this.parent.node, which allows us to avoid replacing identifiers that are
not actually free variables, such as member expression properties.

Closes #496.
2013-11-13 15:33:10 -05:00
Ben Newman
b137a3326e Merge pull request #524 from brainkim/suchfailing-wow-sotest
Fix failing tests
2013-11-13 12:33:00 -08:00
Paul O’Shannessy
970445fc48 Merge pull request #522 from pieter-vanderwerff/blog-footer-position-fix
Added clearfix to blog content holder
2013-11-13 12:28:34 -08:00
Paul O’Shannessy
e716c2ee35 Merge pull request #493 from guidobouman/master
Prevent header anchors from interfering with clickable content in docs.
2013-11-13 12:23:57 -08:00
Brian Kim
e707ec0b1e Fix failing tests
Two of your tests were failing because of commit
1e71df5399
I fixed them by:
1) Using jasmine's spyOn in ReactCompositeComponentError-test.js
2) Inverting the function wrapping in the above commit.
Godspeed.
2013-11-13 05:07:52 -05:00
Pieter Vanderwerff
05d44b2152 Added clearfix to blog content holder 2013-11-13 15:01:32 +13:00
Paul O’Shannessy
797577576e Small cleanup to tips intro 2013-11-12 13:22:55 -08:00
Connor McSheffrey
bd535bd51c Renamed Cookbook references to tips. Reworded intro (sounded weird because it still referenced cookbooks. Updated some entry ID's (some side nav links didn't match entry permalinks) 2013-11-11 21:00:53 -08:00
Connor McSheffrey
166043593d Merge pull request #19 from chenglou/title-case
fix title case for tips everywhere
2013-11-11 20:19:33 -08:00
Tim Yung
9fd28f44df Rename nodeContains to containsNode 2013-11-11 16:39:25 -08:00
Mouad Debbar
1ffe2d0927 Add support for oncontextmenu in React. 2013-11-11 16:39:25 -08:00
Marshall Roch
735b4f0b7c Remove transaction from componentWillUpdate
It wasn't documented and I think the transaction is supposed to be internal.
2013-11-11 16:39:25 -08:00
Felix Kling
1e71df5399 Improve error logging for event handlers of React components.
This guards every auto-bound method and uses the name of the component and method as guard name.
2013-11-11 16:39:25 -08:00
Paul O’Shannessy
48948c91c3 Merge pull request #506 from syranide/wheelie8
Fix wheelDelta misspelled
2013-11-11 14:28:25 -08:00
Fabio M. Costa
1d73efee10 Fixes the name of the component on documentation
AvatarImage -> Avatar
2013-11-10 11:52:41 -08:00
Andreas Svensson
62f7cd213f Fix wheelDelta misspelled 2013-11-10 16:58:55 +01:00
Paul O’Shannessy
91f6684fbf Merge pull request #484 from syranide/jsxie8
IE8 support for JSXTransformer
2013-11-08 14:38:51 -08:00
Andreas Svensson
595b482478 JSXTransformer now supports IE8 2013-11-08 23:04:43 +01:00
Cheng Lou
ff51a23aea update add-ons docs based on feedbacks
- Overview of add-ons for the add-ons page.
- Better title for `ReactLink`.
- Nicer code format for classSet example.
- Better explanation for `classSet`.
2013-11-08 16:55:14 -05:00
petehunt
f7103a8629 Make state immutable in tutorial (eek) 2013-11-08 13:27:20 -08:00
Guido Bouman
4c9f9dafa6 Prevents header anchors from interfering with clickable content. 2013-11-08 15:52:46 +01:00
Pete Hunt
b65e6a0453 Merge pull request #492 from chenglou/move-tooling
move docs tooling from JSX in Depth
2013-11-07 11:36:19 -08:00
Cheng Lou
ca95c8c3a3 move docs tooling from JSX in Depth
Also removes the code wrap around the syntax highlighting link.
2013-11-07 14:25:54 -05:00
Thomas Aylott
3b8af033cd don't try to loadNpmTasks grunt-cli 2013-11-07 13:57:34 -05:00
Ben Newman
b3c87ea017 Merge pull request #451 from subtleGradient/subtlegradient/browser-testing
Browser testing.
2013-11-07 10:20:58 -08:00
Thomas Aylott
241d57aa9e allow directory browsing 2013-11-07 13:12:31 -05:00
Ben Newman
ee8bb07122 Merge pull request #486 from benjamn/jsx-version
Make bin/jsx --version output the React version according to package.json.
2013-11-07 07:52:54 -08:00
Ben Newman
c2ef6e343d Make bin/jsx --version output the React version according to package.json.
Closes #329.
2013-11-07 10:52:02 -05:00
Paul O’Shannessy
192af01952 Merge pull request #488 from spicyj/gh-473
Make submit button default value appear correctly
2013-11-06 22:56:19 -08:00
Paul O’Shannessy
5293a2ab1c Merge pull request #487 from spicyj/multi-proptypes
Make propTypes DEFINE_MANY_MERGED
2013-11-06 22:55:58 -08:00
Ben Alpert
d5c2d5f291 Make submit button default value appear correctly
Fixes #473.
2013-11-06 21:19:44 -08:00
Ben Alpert
4fe784de1f Make propTypes DEFINE_MANY_MERGED 2013-11-06 17:13:25 -08:00
Thomas Aylott
f289e9862a rename sauce-harness to index 2013-11-06 17:29:00 -05:00
Thomas Aylott
5fa707534a ignore generated file
Running the tests shouldn't make git status dirty.
2013-11-06 17:15:38 -05:00
Thomas Aylott
0a120bb5d0 cleanup loadNpmTasks 2013-11-06 17:12:20 -05:00
Thomas Aylott
19a5505c50 making phantomjs version less specific 2013-11-06 17:00:25 -05:00
Thomas Aylott
c9401be38e replace phantom-harness runner with webdriver 2013-11-06 16:44:03 -05:00
Thomas Aylott
b922d8d8a6 move browser test libs to lib folder 2013-11-06 16:43:20 -05:00
Vjeux
b8cf7068c4 Community round-up #10 2013-11-06 12:36:30 -08:00
Thomas Aylott
2d6a8391bf Not necessary anymore 2013-11-06 15:32:39 -05:00
Thomas Aylott
f4d487fb59 removed compiled build files
Not necessary now that we aren't supporting testling.
2013-11-06 15:30:52 -05:00
Thomas Aylott
be7ee1ee65 start a local webdriver server before using it 2013-11-06 15:30:52 -05:00
Thomas Aylott
3e2d3e4837 add logging to webdriver config 2013-11-06 15:30:52 -05:00
Thomas Aylott
dfb4dde8fd keep track of incomplete 2013-11-06 15:30:52 -05:00
Thomas Aylott
159d64ddd3 cleanup 2013-11-06 15:30:52 -05:00
Thomas Aylott
1368b29596 cleanup webdriver jasmine task 2013-11-06 15:30:52 -05:00
Thomas Aylott
c780985d3e wait for all results to finish sending 2013-11-06 15:30:52 -05:00
Thomas Aylott
71772e763a grunt task launch phantomjs as a webdriver server 2013-11-06 15:30:52 -05:00
Thomas Aylott
2d979a9ce9 cleanup 2013-11-06 15:30:52 -05:00
Thomas Aylott
2b273d8568 remove saucelabs for now 2013-11-06 15:30:51 -05:00
Thomas Aylott
b725097409 log using grunt 2013-11-06 15:30:51 -05:00
Thomas Aylott
772af52f4a safer bind 2013-11-06 15:30:51 -05:00
Thomas Aylott
db299ed761 remove sauce labs stuff for now 2013-11-06 15:30:51 -05:00
Thomas Aylott
0f274e5b22 new webdriver-jasmine task and config 2013-11-06 15:30:51 -05:00
Thomas Aylott
e086cbb44b separate grunt task for saucelabs browser testing 2013-11-06 15:30:51 -05:00
Thomas Aylott
93c0a46a1d upgraded sauce harness
Lost jasmine directly instead of using a module builder because it was failing in IE8
2013-11-06 15:30:51 -05:00
Thomas Aylott
2cd663940a don't double-log test results 2013-11-06 15:30:51 -05:00
Thomas Aylott
7bbf6cbfd1 browser support for jasmine-support 2013-11-06 15:30:51 -05:00
Thomas Aylott
46e86df420 move html reporter and its requirements 2013-11-06 15:30:51 -05:00
Thomas Aylott
d64f34b5d8 inserted iframes can be targeted after a delay 2013-11-06 15:30:50 -05:00
Thomas Aylott
f65f7b3bbd IE8 support in jasmine-support 2013-11-06 15:30:50 -05:00
Thomas Aylott
c4727944df Simple test result logger 2013-11-06 15:30:50 -05:00
Thomas Aylott
694cd6e9e8 test runner requires es5-shim 2013-11-06 15:30:50 -05:00
Thomas Aylott
465b8dc646 test server middleware for receiving test results 2013-11-06 15:30:50 -05:00
Thomas Aylott
284d8d67bd Upgrade to the latest version of jasmine
Necessary for IE8 support
2013-11-06 15:30:50 -05:00
Thomas Aylott
b111521f40 Correct SauceLabs tokens 2013-11-06 15:30:50 -05:00
Thomas Aylott
6a7a15cf30 disable testling 2013-11-06 15:30:50 -05:00
Thomas Aylott
3df6942cde SauceLabs Browser testing via Travis 2013-11-06 15:30:50 -05:00
Thomas Aylott
fc572832b1 Absolute urls for less flakiness 2013-11-06 15:30:49 -05:00
Thomas Aylott
46c0aeea67 Fixed paths for phantomjs 2013-11-06 15:30:49 -05:00
Thomas Aylott
a447f53b00 Make it easier to repro tests in the wild 2013-11-06 15:30:49 -05:00
Thomas Aylott
24ec78fd52 Testing-ci can't handle spaces in filenames? 2013-11-06 15:30:49 -05:00
Thomas Aylott
1393e55d53 include the built files for testling 2013-11-06 15:30:49 -05:00
Thomas Aylott
5640d641d6 skip Worker test unless the browser supports them 2013-11-06 15:30:49 -05:00
Thomas Aylott
ecd847cad7 enable testling-ci browser testing 2013-11-06 15:30:49 -05:00
Thomas Aylott
b867aa0410 Format test results as TAP 2013-11-06 15:30:49 -05:00
Thomas Aylott
8205c681eb serve worker.js from its actual relative path 2013-11-06 15:30:49 -05:00
Thomas Aylott
c4ba8f8997 Browser test runner 2013-11-06 15:30:49 -05:00
Thomas Aylott
001bda28d9 Generate the browser test list at built time 2013-11-06 15:30:49 -05:00
Paul O’Shannessy
1e7f3f1aac Merge pull request #483 from spicyj/sm-img
Use smaller blog images and host directly
2013-11-06 10:16:31 -08:00
Pete Hunt
28eddd1670 XML->HTML, because people are fickle. 2013-11-05 19:22:47 -08:00
Ben Alpert
a65f60a008 Use smaller blog images and host directly 2013-11-05 18:54:29 -08:00
Pete Hunt
091425058b Merge pull request #482 from chenglou/data-lowercase
add docs lowercase mention for data- and aria-
2013-11-05 18:10:56 -08:00
Cheng Lou
e89ad6c960 add docs lowercase mention for data- and aria- 2013-11-05 21:02:06 -05:00
Paul Shen
0fed861424 Move merge utility functions from utils to vendor/core 2013-11-05 17:17:47 -08:00
Tim Yung
e78d580c06 Include Ownership in the Ship of Theseus
When we determine whether a React component should be updated (as opposed to destroyed or replaced), we currently only look at whether they share the same constructor. This adds a check for whether they share the same owner component.

I've also consolidated this logic (I cannot believe this was not already done).
2013-11-05 17:14:57 -08:00
Pete Hunt
e78d5b5462 Merge pull request #481 from andreypopp/master
"Thinking in React": fix list formatting
2013-11-05 15:52:53 -08:00
Andrey Popp
20b7faaab7 "Thinking in React": fix list formatting 2013-11-06 03:50:28 +04:00
Paul O’Shannessy
5dad5e92a9 Merge pull request #476 from SanderSpies/unused-onselect
Removing unused useSelect variable.
2013-11-05 15:17:45 -08:00
Paul O’Shannessy
1553bad73a Move header link styling out of documentation only
It's used in blog posts too. I also constrained it to just the anchor
class to avoid any other headers we have.
2013-11-05 15:04:57 -08:00
Pete Hunt
aadb65166d Merge pull request #453 from petehunt/blogpost2
"Thinking in React" blog post
2013-11-05 14:26:25 -08:00
petehunt
c8bc605f9e rename 2013-11-05 14:25:46 -08:00
petehunt
486b60486a rename 2013-11-05 14:23:12 -08:00
petehunt
13f0644aaa make props/state section less intense 2013-11-05 14:21:15 -08:00
petehunt
780442f0b3 blogify 2013-11-05 14:21:15 -08:00
SanderSpies
27fa1f5c9c Removing 'isEventSupported' 2013-11-05 22:53:50 +01:00
SanderSpies
dede55d27d Removing unused useSelect variable. 2013-11-05 22:45:02 +01:00
Paul O’Shannessy
5c6c02fe03 Merge pull request #472 from lrowe/patch-4
Script async and defer properties
2013-11-05 11:48:54 -08:00
Paul O’Shannessy
9f3ef1b6ac Remove jQuery version number from tutorial docs 2013-11-05 11:29:00 -08:00
Ben Alpert
5386cd9665 tutorial: Simplify ajax options
dataType was unnecessary; mimeType was both unnecessary and wrong in this case. Also removed an unnecessary bind and changed pollInterval to 2000 ms for consistency with https://github.com/petehunt/react-tutorial (faster is nicer if you actually try it out!).
2013-11-05 11:17:37 -08:00
Cheng Lou
f2ee3c53a9 fix title case for docs tips everywhere 2013-11-05 09:57:00 -05:00
Laurence Rowe
1bcca22719 Script async and defer properties 2013-11-04 20:40:53 -08:00
petehunt
6c1e8e8a66 Update tutorial to use className 2013-11-04 17:04:25 -08:00
petehunt
9f69b12e5b get rid of composition 2013-11-04 12:22:43 -08:00
Ben Newman
ff3c8ccbe6 Merge pull request #458 from chenglou/rm-wrapup
Remove support for the wrapup packager.
2013-11-04 11:41:59 -08:00
Paul O’Shannessy
da5c61afe4 Oxford comma 2013-11-04 11:34:56 -08:00
Josh Duck
18bf0b80bc Fix ReactDOMSelection for IE 11
IE 11 no longer supports the legacy document.selection API.
Their implementation of window.getSelection() doesn't support
the extend() method, which we were relying on.

If the selection is RTL and selection extend is missing, then just
flip the selection.
2013-11-04 11:34:39 -08:00
Cheng Lou
d220ce71b5 Merge branch 'rm-wrapup' of github.com:chenglou/react into rm-wrapup
Conflicts:
	package.json
2013-11-03 15:43:56 -05:00
Cheng Lou
d6cbc710bd remove examples/wrapup
Apparently it's no longer relevant.
2013-11-03 15:41:40 -05:00
Paul O’Shannessy
10ccd9f103 Merge pull request #465 from matnel/bug388
Clear error message when rendering a nonvalid component
2013-11-01 18:35:50 -07:00
Matti Nelimarkka
9e24257a4e Clear error message when rendering a nonvalid component 2013-11-01 17:32:09 -07:00
Paul O’Shannessy
aedf580a33 [docs] Clarify when getInitialState is called. 2013-11-01 15:29:10 -07:00
petehunt
f713f06c62 less aggro 2013-11-01 11:47:38 -07:00
Cheng Lou
899ae83acb add docs on classSet add-on 2013-10-31 21:59:35 -04:00
Cheng Lou
3c1e0f0a8c split add-ons into subsections
In preparation for documenting `classSet` add-on.
2013-10-31 21:10:19 -04:00
Tim Yung
0dc011c40c Better getUnboundedScrollPosition for windows
Instead of using browser sniffing, `getUnboundedScrollPosition` can do
better and not have to depend on the `getDocumentScrollElement` module.
2013-10-31 15:24:58 -07:00
Cheng Lou
e455e28ff8 fix doc & example transition opacity from .99 to 1
The initial thought was that an opacity animation from 0.01 to 1 causes trouble on some browser. But after testing on opera 12.15, ff 23, ie 10, chrome 30, desktop/mobile safari 7 and chrome android I confirm this works.
2013-10-31 17:35:38 -04:00
JeffMo
a4f8ad1bb0 Switch utility function calls -> namespaced calls 2013-10-31 13:45:16 -07:00
Cheng Lou
0acf5e22bd remove examples/wrapup
Apparently it's no longer relevant.
2013-10-31 15:49:37 -04:00
Ben Newman
df1099649c Merge pull request #457 from benjamn/upgrade-populist
Bump populist version to v0.1.4
2013-10-31 10:22:14 -07:00
Ben Newman
d1ad4a3ff0 Bump populist version to v0.1.4.
The new version includes a fix for this IE8 issue reported by
@subtleGradient: https://github.com/benjamn/populist/issues/4

Closes #456.
2013-10-31 13:03:31 -04:00
Paul O'Shannessy
2cf7d943df Reorder DefaultDOMPropertyConfig
`autoCorrect` belongs with the non-standard properties list.
2013-10-30 16:58:05 -07:00
Mark Richardson
9b44ad6ce5 Add autoCorrect to list of supported DOM properties 2013-10-30 16:57:53 -07:00
Tim Yung
7789a32438 Forward Compatibility w/ WebKit & Blink
Newer versions of WebKit and Blink will support both `document.body.scrollTop` and `document.documentElement.scrollTop`. Therefore, implementing cross-browser compatibility by summing the two will no longer work.

This changes React to use `getUnboundedScrollPosition` so we get the fix and consistency in one change!

See: https://rniwa.com/2013-10-29/web-compatibility-story-of-scrolltop-and-scrollleft/
2013-10-30 16:56:55 -07:00
Connor McSheffrey
551cc01430 Update nav config with new entry names/permalinks 2013-10-30 12:29:38 -07:00
Connor McSheffrey
22058d09da Merge pull request #18 from chenglou/title-case
title case for entry titles; fix two entry names
2013-10-30 12:24:50 -07:00
Cheng Lou
80efa9a33e title case for entry titles; fix two entry names 2013-10-30 15:06:16 -04:00
Connor McSheffrey
6a0976ca9d Merge pull request #17 from chenglou/feat-documentation-cookbook
fix 3 more entries
2013-10-29 18:10:56 -07:00
Connor McSheffrey
5847536c9d Removed grunt task for building live edits and removed js link conditional at bottom of layout since we're no longer conditionally loading live edit js for cookbook pages 2013-10-29 18:04:29 -07:00
Paul O’Shannessy
a5d1e2fd90 blog post for 0.5.1 2013-10-29 13:16:53 -07:00
Paul O’Shannessy
d8e3779010 Update everything for v0.5.1
Cherry-picked from f3db0006e8, excluding
version changes.
2013-10-29 13:15:33 -07:00
Cheng Lou
7d50ab600f ex for entry 7 2013-10-29 14:55:11 -04:00
Connor McSheffrey
e3ec6f5292 Removed JS for live edit 2013-10-29 11:28:28 -07:00
Cheng Lou
9471287794 Merge branch 'feat-documentation-cookbook' of https://github.com/mcsheffrey/react into feat-documentation-cookbook 2013-10-29 14:23:17 -04:00
Cheng Lou
cbec8c1a89 fix 2 more entries 2013-10-29 14:20:04 -04:00
Connor McSheffrey
4a7d8f628e Removed .js extension from Cookbook Introduction description 2013-10-29 11:09:57 -07:00
Connor McSheffrey
b025e4c576 Merge pull request #16 from chenglou/feat-documentation-cookbook
new line at end of nac_docs; update to entry 4
2013-10-29 11:06:14 -07:00
Cheng Lou
ee8fa3760d new line at end of nac_docs; update to entry 4 2013-10-29 14:02:20 -04:00
Connor McSheffrey
efaba68663 Removed Q&A format 2013-10-29 10:42:47 -07:00
Connor McSheffrey
33effd31d5 Removing the grunt task generated live edit JS files since we're holding off on the inline edit feature for now 2013-10-29 10:15:45 -07:00
Cheng Lou
271e7d50cf better grammar 2013-10-29 10:15:45 -07:00
Cheng Lou
c235ec7421 entry on false behavior 2013-10-29 10:15:45 -07:00
Connor McSheffrey
6e28818ba9 Remove cb prefix from cookbook entries since they're already in /cookbook/ directory 2013-10-29 10:15:45 -07:00
Connor McSheffrey
95f3caaaa4 removed cookbook prefix from filenames 2013-10-29 10:15:45 -07:00
Connor McSheffrey
a7dd6e7c70 better regex for filename 2013-10-29 10:15:45 -07:00
Connor McSheffrey
30ab347b78 undo changes to extractCode, using grunt task instead 2013-10-29 10:15:45 -07:00
Connor McSheffrey
9585c407e2 added function that write to the output html file 2013-10-29 10:15:45 -07:00
Connor McSheffrey
9efd1f5e9b added seperate cookbook layout (since URL base of next/prev is hardcoded in layout), added next/prev yaml meta to each cookbook entry until I can find a way of generating them dynamically 2013-10-29 10:15:45 -07:00
Connor McSheffrey
21c5c2a54e update cookbook nav 2013-10-29 10:15:45 -07:00
Cheng Lou
a970957eef remove entry 13 jquery animation; react has animation 2013-10-29 10:14:21 -07:00
Cheng Lou
119e29ff1d one single child in ternary 2013-10-29 10:14:21 -07:00
Cheng Lou
7db760427c add lib integration entry; tweak 1 sentence 2013-10-29 10:14:20 -07:00
Cheng Lou
6d2ea9a200 ajax ex 2013-10-29 10:14:20 -07:00
Cheng Lou
0475834470 fix all links to point to /react as root 2013-10-29 10:14:20 -07:00
Cheng Lou
48f1ee4940 change some wording, add tip for events entry
- No need to mention React, you know you're working with it =).
- Wrap code elements in back ticks, so that they get the "box" styling for md.
- You'd want the snippet to work inside the live editor, so you need to `renderComponent`. As per wiki specification, the DOM element on which to mount is `mountNode`, just like on the front page.
- Don't forget the JSX pragma, or else your `render` fails.
- Nitpick: empty line after the end of md.
- No need for jQuery reference since
  1. The general mood around React is that you don't need jQuery.
  2. The syntax' still clear without jQuery.
  3. We're doing a jQuery integration entry =).
- `getInitialState` was absent.
- You don't need `componentWillMount` here. fetch them in `getInitialState`.
- The non-spoken convention seems to call the event handler `"handle" + eventName`. So `handleResize` clearly indicates it's a `resize` handler while `updateDimensions` might do something else. This latter name might actually be better under circumstances where you use call the method directly somewhere, but since we removed the only direct usage in `componentWillMount` this is fine.
- Went OCD again and tried to keep the code short. `width` is enough of a demo. Removed `height`.
- Distinguish between DOM events and React events. Wish we go full React events in a near future.
2013-10-29 10:14:20 -07:00
Cheng Lou
fb5f69f44e modify some wording 2013-10-29 10:14:20 -07:00
Connor McSheffrey
e0df9cbb01 Add event listeners cookbook entry 2013-10-29 10:14:20 -07:00
Cheng Lou
1e56800543 shrink working on props in state entry 2013-10-29 10:14:20 -07:00
Cheng Lou
28f30b7ef0 props in getInitialState as anti-pattern 2013-10-29 10:14:20 -07:00
Connor McSheffrey
86355eb1ba added grunt task for generating live samples JS 2013-10-29 10:14:20 -07:00
Cheng Lou
bfbcb5362b tip format for intro 2013-10-29 10:14:20 -07:00
Cheng Lou
8d2b4a9a25 all typos 2013-10-29 10:14:20 -07:00
Connor McSheffrey
da722b92c0 Added backgroundImage example to "inline styles" cookbook entry 2013-10-29 10:14:20 -07:00
Connor McSheffrey
a4d7f3f907 minor spelling change on the "controlled input null value" cookbook entry 2013-10-29 10:14:20 -07:00
Cheng Lou
6377b2ed95 entry on willReceiveProps not triggered on mounting 2013-10-29 10:14:19 -07:00
Cheng Lou
dd52ef92a8 entry on controlled input with value null 2013-10-29 10:14:19 -07:00
Cheng Lou
9ed72b43e8 add line-height to unitless css props 2013-10-29 10:14:19 -07:00
Cheng Lou
f4bbe9c296 style prop value shorthand, children prop manip warning 2013-10-29 10:14:19 -07:00
Cheng Lou
814126dc52 entry on returning only one node from render 2013-10-29 10:14:19 -07:00
Cheng Lou
ff9246316f fix permalink, temporarily remove script field of Jekyll 2013-10-29 10:14:19 -07:00
Cheng Lou
b92c433c50 small typo and code tag is now js highlight
Was html before bc github screws up the js highlighting for jsx.
2013-10-29 10:14:19 -07:00
Cheng Lou
7144ba1c10 new entry on self-closing tag 2013-10-29 10:14:19 -07:00
Cheng Lou
0fad22512a new entry for ternary expression in jsx 2013-10-29 10:14:19 -07:00
Cheng Lou
4d9cde43be add tip format for comparison 2013-10-29 10:14:19 -07:00
Cheng Lou
dc24bb63d6 add tip style to style entry 2013-10-29 10:14:19 -07:00
Connor McSheffrey
5f296768a5 Moved cookbook recipes into separate directory. Updated nav_docs to loop through cookbook yaml. Added cookbook directory to js/ to add live editing of code samples 2013-10-29 10:14:19 -07:00
Connor McSheffrey
dd5fbc5859 Added docs for React cookbook section Introduction and Inline Styles React recipe 2013-10-29 10:14:18 -07:00
Laurence Rowe
280eff41f3 Make 'disabled' MUST_USE_ATTRIBUTE for compatibility with CSS [disabled] selectors.
When a ReactDOMComponent is created with the property `disabled: true` subsequently setting the property to `disabled: false` the HTML attribute `disabled="true"` was being left in the DOM.
2013-10-28 18:53:19 -07:00
Paul O’Shannessy
214e9103bf Merge pull request #423 from andreypopp/master
Re-rendering components into a document leaks components
2013-10-28 17:00:19 -07:00
Andrey Popp
ac9dd92272 Fix unmounting components mounted into doc element
If we are to unmount a component mounted into a document element we should
unmount it from document.documentElement and not from document.firstChild which
is a doctype element in this specific case.
2013-10-29 02:49:00 +04:00
Ben Alpert
25ba629098 Move heading anchors 50px up to avoid nav bar
Fixes #447.

We do this by moving the actual anchored element up in the page without moving the actual text. (Apple uses a similar trick in their framed docs.) Now this looks a bit sillier on smaller screens but it's better overall.
2013-10-28 13:52:58 -07:00
petehunt
91d23ffc58 typo 2013-10-28 10:21:11 -07:00
Paul O’Shannessy
10f3d93df7 Update API docs for unmountAndReleaseReactRootNode 2013-10-26 17:42:34 -07:00
Pete Hunt
1c77e1a492 Merge pull request #446 from brianr/master
ReactTransitionGroup example: fix typo and logic bug in handleRemove
2013-10-25 18:13:46 -07:00
Ian Obermiller
fbb741febb Fix ReactTransitionEvents detectEvents 2013-10-25 18:11:58 -07:00
Brian Rue
c5cc145538 ReactTransitionGroup example: fix typo and logic bug in handleRemove 2013-10-25 18:03:31 -07:00
Cat Chen
0ef1ca0024 fixed %d in invariant call 2013-10-25 18:03:26 -07:00
petehunt
0a75a52b4a Changes based on feedback 2013-10-25 11:40:54 -07:00
Josh Duck
0d2d3360d0 Don't reset mouseDown in focus handlers
Focus fires after mouse down on initial click, so we lost the
flag when the user initially began dragging on the input.
2013-10-22 14:09:33 -07:00
petehunt
15de778587 New marketing copy 2013-10-21 22:08:43 -07:00
Keito Uchiyama
eeefe95958 docs: Delete Mutation Events (onCharacterDOMModified) 2013-10-21 19:56:49 -07:00
Paul O’Shannessy
5e65c186aa docs: remove OUTLINE 2013-10-21 15:20:01 -07:00
Cheng Lou
99dcdb87e3 Add clickable anchors to docs headers
Closes #434
2013-10-21 14:27:31 -07:00
Tim Yung
58b3ae3136 Use Default Value for Undefined Props
Currently, default props as defined by `getDefaultProps` are only used if a prop is not specified (using `X in Y` check).

However, this makes it difficult for composing components to pass along the state of not being defined, for example:

  render: function() {
    // If `this.props.someProp` is not set, `InnerThing` should use the default value.
    return <InnerThing someProp={this.props.someProp} />;
  }

This changes the requirement for falling back to the default value to an undefined check (using `typeof X === 'undefined'`).
2013-10-21 13:17:44 -07:00
Pete Hunt
7d6b0dd613 Merge pull request #438 from spicyj/select-range
Make SelectEventPlugin not throw for range inputs
2013-10-21 09:39:39 -07:00
Ben Alpert
893fba8373 Make SelectEventPlugin not throw for range inputs
Accessing .selectionStart on a non-text input will throw (see http://www.w3.org/TR/2009/WD-html5-20090423/editing.html#textFieldSelection), so check that the input has selection capabilities before accessing the property.

Fixes #437.
2013-10-20 14:39:37 -07:00
Paul O’Shannessy
b46b6a8db9 Fix live editor examples on home page.
Remember that one time I wrote release notes and said:

> This is a breaking change - if you were using class, you must change
> this to className or your components will be visually broken.

Good thing I didn't listen to myself!
2013-10-16 17:56:51 -07:00
Paul O’Shannessy
44ad2b55e6 0.5.0 release
Updated README, CHANGELOG, blog post
2013-10-16 11:43:09 -07:00
Paul O’Shannessy
820532b7aa Fix grunt npm:test 2013-10-16 11:42:02 -07:00
Paul O’Shannessy
48281a17e4 bump version to 0.6.0-alpha 2013-10-15 22:39:28 -07:00
Paul O’Shannessy
d8c949e4d8 Update browserify 2013-10-15 21:27:26 -07:00
JeffMo
243a2b816e bump baseline jstransform and esprima dependency versions 2013-10-15 18:54:01 -07:00
Paul O’Shannessy
451176665c Update docs with supported tags and attributes 2013-10-15 18:15:24 -07:00
Paul O’Shannessy
cff62f8d72 Enable linting for bitwise operators 2013-10-15 18:02:28 -07:00
Paul O'Shannessy
3f2ba221ef Use getActiveElement module
We had something that did the same sort of protection. The module
differs slightly (returns document.body instead of undefined) but
looking at the callers, that should be ok.
2013-10-15 18:00:05 -07:00
Paul O'Shannessy
46713c3d7d Fix Lint
Enabling bitwise linting caught another user. Also fixed a semicolon
misuse.
2013-10-15 17:59:14 -07:00
Paul O’Shannessy
b015204938 Updated AUTHORS for 0.5
closes #414
2013-10-15 15:01:14 -07:00
petehunt
24f6bed855 new addons docs
closes #403
2013-10-15 14:09:21 -07:00
Paul O’Shannessy
5325e944e9 Merge pull request #426 from SanderSpies/sspi-fix-jsx-doc-link
In-browser JSX warning linked to wrong anchor (should be lowercase)
2013-10-15 12:04:59 -07:00
Paul O’Shannessy
b488cb3d4b Merge branch 'SanderSpies-sspi-dom-attribute-process' 2013-10-15 12:00:52 -07:00
Paul O’Shannessy
087c2afed1 Make sure DOM components work in JSDOM 2013-10-15 11:38:26 -07:00
Paul O’Shannessy
b0645bd5d3 Be consistent with object naming in tests
This also fixes line length issues our linter was complaining about.
2013-10-15 11:38:26 -07:00
SanderSpies
5a13dd090d Standardize prop -> DOM attribute process
Allow more than strings and numbers to be used as attributes for DOM
nodes. This removes the special casing for `0` and `false` that was
being used in ReactDOMInput and ReactDOMTextarea.

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

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

Fixes #311.

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

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

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

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

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

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

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

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

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

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

renamed ReactOnDOMReady module to ReactMountReady
2013-10-05 01:35:56 -05:00
Vjeux
a9b3139ff8 Community round-up #9
http://fooo.fr:4000/react/blog/2013/10/03/community-roundup-9.html
2013-10-03 15:18:21 -07:00
Vjeux
582b720183 Add app id for comments moderation
This way we can be notified when any new comment appear in the docs/blog and add moderators
2013-10-03 22:32:20 +02:00
Ben Newman
0a02b55d95 Use nodeContains where appropriate. 2013-10-01 17:55:13 -07:00
Tim Yung
20af6a7ce8 Speed Owner Access (by over 9000)
Use a valid identifier (and non-string) to reduce chance of de-optimizing in V8 and Nitro.
2013-10-01 16:32:06 -07:00
Ben Newman
7c0f5c3237 Fix isEventSupported in recent versions of jsdom.
Setting the `eventName` attribute of an element to the empty string is not
enough to cause `typeof element[eventName] === 'function'` in jsdom. The
attribute value actually has to look like a function body.
2013-10-01 16:31:46 -07:00
Paul O'Shannessy
f43449d333 ReactNativeComponent -> ReactDOMComponent
In an effort to break the DOMy parts of React away from the non-DOMy parts, I'm renaming this.
2013-10-01 16:31:32 -07:00
Ben Newman
e66287f92e Copy the nodeContains module from static_upstream. 2013-10-01 19:18:09 -04:00
Paul O’Shannessy
f20626f17a Merge pull request #378 from spicyj/html-reconciliation
Fix reconciling when switching to/from innerHTML
2013-10-01 13:38:08 -07:00
Andrew Zich
ab00f8d15c Removed "ajaxify" from DefaultDOMPropertyConfig
The `"ajaxify"` attribute is Facebook-specific and does not belong in this repo.
2013-10-01 13:34:26 -07:00
Pete Hunt
58de758a32 Sort batched updates by owner depth
If we reconcile components higher in the hierarchy they will likely reconcile components lower in the
hierarchy. If we sort by depth then when we reach those components there will be no more pending state or
props and it will no op.
2013-10-01 13:33:12 -07:00
Paul O’Shannessy
8beaa211fb Merge pull request #387 from spicyj/exec-fix
Actually make exec work
2013-10-01 13:14:56 -07:00
Paul O’Shannessy
7c217324a6 Merge pull request #384 from chenglou/doc-link
Add doc link to DOM differences from JSX gotchas
2013-10-01 11:25:34 -07:00
Paul O’Shannessy
15c1358aaf Merge pull request #386 from chenglou/unitless-line-height
add line-height to unitless css props, test cases
2013-10-01 10:35:21 -07:00
Ben Alpert
0a45325621 Actually make exec work
The spec for eval (http://es5.github.io/x15.1.html#x15.1.2.1) says "If Type(x) is not String, return x." and that's exactly what's happening here -- it gets {code: ...} and does nothing.
2013-09-30 18:51:39 -07:00
Cheng Lou
607eeaed4b Add doc link to DOM differences from JSX gotchas 2013-09-30 20:46:41 -04:00
Paul O’Shannessy
c764adc256 Merge pull request #376 from spicyj/noglobal
Fix lint errors including use of `global`
2013-09-30 14:21:12 -07:00
Cheng Lou
27ee9c6eb0 add line-height to unitless css props, test cases 2013-09-30 13:56:56 -04:00
Pete Hunt
8835e9d99f Update README.md 2013-09-28 19:57:18 -07:00
Ben Alpert
3ca507d73f Fix reconciling when switching to/from innerHTML
There's no way that this can work if _updateDOMChildren doesn't know about dangerouslySetInnerHTML, so tell it.

Fixes #377.
2013-09-27 16:22:46 -07:00
Ben Alpert
3dc1074908 Test that React loads properly in a web worker
This should catch top-level uses of `window` and `document`, while lint rules catch `global`.
2013-09-27 14:38:11 -07:00
Ben Alpert
94d2bbb221 Fix lint errors including use of global 2013-09-26 16:55:26 -07:00
Pete Hunt
84dea7e971 Fix server rendering 2013-09-26 15:49:19 -07:00
Pete Hunt
781bbe2916 Merge pull request #375 from danielmiladinov/master
Change spec policy for getDefaultProps to SpecPolicy.DEFINE_MANY_MERGED
2013-09-26 13:45:34 -07:00
Daniel Miladinov
b0ae800d64 Change spec policy for getDefaultProps to SpecPolicy.DEFINE_MANY_MERGED
This will allow multiple mixins for a component to define
getDefaultProps and their values will be merged.

See also:
https://groups.google.com/d/msg/reactjs/UzSiXw2Vo5s/FxK7AHWOzLMJ
2013-09-25 23:52:29 -04:00
Paul O’Shannessy
848a8e1180 Remove animation "example"
It was never a real example and shouldn't have been checked in.
2013-09-25 11:08:24 -07:00
Paul O’Shannessy
fc0b68af28 Fix 404s to non-existent API docs 2013-09-24 16:00:52 -07:00
Paul O’Shannessy
c6f831e85f Redirect docs/reference.html 2013-09-24 15:47:17 -07:00
Vjeux
58173edb16 Community round-up #8 2013-09-24 14:18:11 -07:00
Pete Hunt
fc73bf0a0a ReactLink: two-way binding for React
This introduces `ReactLink` which is a super lightweight way to do two-way binding for React.

If you want to use a controlled form input today, it's a lot of lines of code:

http://jsfiddle.net/T3z3v/

Look how many times `name` is repeated in there. And you have to remember to wire up event handles and pass the right state and
right event handler for *each* form field. It's really annoying.

With ReactLink, you can "link" a form value to a state field. It's just some simple sugar around the value prop/onChange
convention:

https://gist.github.com/petehunt/6689857

Ah, much nicer! And requires very little core changes or extra bytes. `ReactLink` just wraps the current value and "request
change" handler into a little object and provides some sugar to create some from composite component state.
2013-09-24 12:14:25 -07:00
Marshall Roch
458836abd3 Fix use of 'window' in CompositionEventPlugin
access to `window` needs to be guarded by `ExecutionEnvironment.canUseDOM`.
2013-09-23 23:01:14 -07:00
Josh Duck
5d7633d74c Move composition event to plugin with polyfill
Move compositionstart/compositionend to a new event plugin.

Add a polyfill that listens to key and mouse events and uses selection to
determine which text has changed.
2013-09-23 16:27:01 -07:00
Josh Duck
8f15eea910 Add ReactDOMSelection module
Add a DOM based selection module. This can both be used on its own and
in ReactInputSelection where our current implementation is lacking.

There is still some inconsistency with how IE and modern browsers
handle block nodes. Should be OK if we are just getting and setting
and not trying to set selection based on character offsets.
2013-09-23 16:23:35 -07:00
Paul O’Shannessy
d27746ee0b Docs: Give headers ids for easy linking
This gives markdown headers an id so that we can link directly to
sections of our docs. This is better than the alternative of adding them
all ourselves.
2013-09-23 10:30:51 -07:00
Keito Uchiyama
d13ce702a8 Fix typo in doc 2013-09-22 15:09:36 -07:00
Keito Uchiyama
d262285827 Fix use of "it's" in docs 2013-09-22 13:24:25 -07:00
Jeff Morrison
b5a11a431e Merge pull request #336 from spicyj/jsx-spacing
JSX: Respect original spacing and newlines better
2013-09-20 10:59:21 -07:00
Pete Hunt
832d9de037 Rename unmountAndReleaseReactRootNode() -> unmountComponentAtNode()
This is just a better name; we may revisit the name later.
2013-09-19 14:46:49 -07:00
Josh Duck
578863881f Add composition events to React.
Composition events make it possible to detect IME entry/exit.
https://developer.mozilla.org/en-US/docs/Web/API/CompositionEvent
2013-09-19 14:30:21 -07:00
Paul O’Shannessy
8875e1dc3b Merge pull request #359 from SanderSpies/master
Give the user a warning when using unoptimized JSX code
2013-09-19 13:14:12 -07:00
SanderSpies
cd79ed32cb - removed creation of the id within the tooling integration doc (expect this to be done by @zpao's pull request)
- removed the if statement and now always provide a warning message (as proposed by @spicyj)
- improved the warning message
2013-09-19 06:48:38 +02:00
SanderSpies
1924b7c945 Correcting the markdown anchor 2013-09-19 00:58:37 +02:00
SanderSpies
d2bf50c63d Give the user a warning when using unoptimized JSX code and send the user to the correct location in the documentation to optimize. 2013-09-19 00:55:10 +02:00
Ben Newman
b1dd4149a0 Merge pull request #343 from benjamn/fix-if-statement-pruning
Make constant propagation smarter about pruning if statements
2013-09-18 11:10:56 -07:00
Paul O’Shannessy
208ebd35b7 Don't update the docs version by default
This was leading to a lot of unnecessary churn in the config file since
different YAML versions were serializing differently.
2013-09-18 10:40:12 -07:00
Ben Newman
adda400602 Make constant propagation smarter about pruning if statements. 2013-09-18 13:33:45 -04:00
Pete Hunt
a9d53dae72 Merge pull request #351 from spicyj/api-docs
Flesh out reference documentation, more API info
2013-09-17 16:12:16 -07:00
Tim Yung
ea0cde2cf4 Fix PropTypes Documentation 2013-09-17 16:09:23 -07:00
Sebastian Markbage
e5ba82a44b Fix DOM node warning
bdf2a9bb12 broke the warning that children aren't suppose to be real DOM nodes.
2013-09-17 16:04:44 -07:00
Ben Alpert
364d6029b6 Flesh out reference documentation, more API info 2013-09-17 16:01:57 -07:00
Pete Hunt
735223fc9f Merge pull request #356 from yungsters/master
Add link to third-party `JavaScript (JSX).tmLanguage` in docs.
2013-09-17 13:35:59 -07:00
yungsters
be9ac236fd Add link to third-party JavaScript (JSX).tmLanguage in docs. 2013-09-17 13:30:53 -07:00
Josh Duck
ed7fa0ed22 Stop ReactInputSelection breaking in IE8
In the IE code path the method assumed that the input.value property
was non-null. A quick fix is to use either value or innerText; which means
the same code can be shared for textarea and contentEditable components.

The code is slightly buggy because the range.parentElement() !== input check
will fail for contentEditable components when the focus within a deep DOM tree.
2013-09-14 06:18:03 -07:00
Tim Yung
3e4302e6ae Fix lint errors in tests 2013-09-14 06:17:50 -07:00
Josh Duck
1a38cb9e07 Ensure selection range exists
The selection object doesn't always have ranges. In Chrome the
selection is not updated before 'focus' event handlers are fired. See
http://jsfiddle.net/t4DYA/ for example.

The selection will have rangeCount of 0 and calling getRangeAt(0) will
throw error "Uncaught IndexSizeError: Index or size was negative, or greater
than the allowed value."
2013-09-14 06:16:15 -07:00
Paul O’Shannessy
71ad5cb37a Update wording 2013-09-14 13:48:17 +02:00
Paul O’Shannessy
8a7c977942 Merge pull request #338 from spicyj/fullpage-tests
Fix ReactRenderDocument tests
2013-09-11 16:54:48 -07:00
Paul O’Shannessy
63bacfacfd Merge pull request #339 from spicyj/doc-rendering
Fix full-page rendering
2013-09-11 16:54:31 -07:00
Paul O’Shannessy
c8ec4595bb Merge pull request #344 from benjamn/fix-silent-test-failure-due-to-requiring-React
Use a regular expression to parse out React.version
2013-09-11 16:03:59 -07:00
Ben Newman
133ea3df09 Use a regular expression to parse out React.version.
This fixes a silent failure of the test suite that appears to be due to
the call require('./build/modules/React').
2013-09-11 18:41:56 -04:00
Paul O’Shannessy
f729a28f3c Delete version.js
This file is an artifact of a build process long abandoned.
2013-09-11 14:20:26 -07:00
Paul O’Shannessy
7ff11c3c88 Merge pull request #332 from spicyj/radio-test
Fix radio input test in Chrome
2013-09-11 13:45:47 -07:00
Paul O’Shannessy
5ab68d9a0d Hard code version instead of doing constant replacement
This isn't really ideal, but it makes it so that people managing to
build with @providesModule still get a consistent experience (since this
is what gets packed client-side with react-page-middleware anyway).
2013-09-11 09:51:43 -07:00
Ben Alpert
58fae896fe Fix full-page rendering
Closes #337.

Test Plan:
Opened react-page sample without any JS errors. Also ran grunt test after cherry-picking this changeset on top of #338.
2013-09-11 01:26:49 -07:00
Ben Alpert
fea4fec0bc Fix ReactRenderDocument tests
I am unsure how this was ever supposed to work, as testDocument is guaranteed to be undefined at that point since beforeEach doesn't run synchronously. (I don't think there's any way to have beforeEach halt the tests.)
2013-09-10 22:42:05 -07:00
Paul O’Shannessy
d853bbcf77 Merge pull request #205 from spicyj/version
Add React.version
2013-09-10 18:35:12 -07:00
Paul O’Shannessy
f82f2a0fe2 Merge pull request #274 from chenglou/textarea-patch
fix textarea `value` of number 0
2013-09-10 18:01:33 -07:00
Ben Alpert
f69112cb3f JSX: Respect original spacing and newlines better
Fixes #335.

Now this JSX:

```
/** @jsx React.DOM */
var HelloMessage = React.createClass({
  render: function() {
    return <div>
      Look!
      <a href=
        "http://www.facebook.com/">Facebook
      </a>
    </div>;
  }
});
```

produces

```
/** @jsx React.DOM */
var HelloMessage = React.createClass({displayName: 'HelloMessage',
  render: function() {
    return React.DOM.div(null,
      " Look! ",
      React.DOM.a( {href:
        "http://www.facebook.com/"}, "Facebook "
      )
    );
  }
});
```

rather than the less-desirable

```
/** @jsx React.DOM */
var HelloMessage = React.createClass({displayName: 'HelloMessage',
  render: function() {
    return React.DOM.div(null,
" Look! ",      React.DOM.a( {href:"http://www.facebook.com/"}, "Facebook "      ),
    );
  }
});
```
2013-09-10 17:14:36 -07:00
Paul O’Shannessy
6d77ad4be3 Merge pull request #330 from spicyj/warn-class-for
Warn for 'class' and 'for' property names
2013-09-10 16:21:33 -07:00
Jeff Morrison
7a6a508066 Merge pull request #328 from zpao/no-transform-class
Stop transforming class -> className
2013-09-10 08:23:08 -07:00
Cheng Lou
cd019871e3 Fix input/textarea value of number 0 and false
Previously, setting textarea `value` to number 0 is treated as if `value` wasn't set at all (thus the textarea is cleared from 0 to '' upon `onChange`). `false` also renders as `"false"` instead of `""` for both `defaultValue` and `value`, on textarea _and_ input.
2013-09-10 10:40:53 -04:00
Paul O’Shannessy
63b58cf6b5 AUTHORS
Created a .mailmap file with all of the associations, then used
git + perl to create the AUTHORS file. In theory these should all get
picked up by npm.

I used ABC order so it would remain unbiased and automatable. I wish we
could go back and fill out the history or at least fix the commits we
have from CommitSyncScript, but oh well.

This also includes the script I used to automate this process in the
future.
2013-09-09 23:42:54 -07:00
Ben Alpert
3bbd966a82 Fix radio input test in Chrome
It seems like the `form="pluto"` was throwing it off and making the input live outside the form it should have been contained in, causing it to uncheck A. I added it intending to test the form attribute but ended up not needing it so removing it should be fine. (The tests were passing in phantomjs since it doesn't support the `form` attribute and simply ignored it.)

Test Plan:
grunt test; grunt test --debug
2013-09-09 23:38:05 -07:00
Isaac Salier-Hellendag
5388d70bb1 Add cut, copy, paste
Add clipboard events to React.

For forms, these shouldn't really be necessary -- the onChange event should handle deletions and insertions. For contenteditables, however, we need to be able to access clipboard data.
2013-09-09 23:33:05 -07:00
Ben Alpert
5fd4467bf7 Add React.version
getConfig needs to be a function because grunt.config.data.pkg.version isn't available at the time that grunt/config/jsx/jsx.js is required.

Test Plan:
grunt build, grunt lint, grunt test all work. After building, both react.js and react.min.js contain the version number.
2013-09-09 17:01:06 -07:00
Timothy Yung
aa765e8fa3 Merge pull request #287 from spicyj/noglobal
Remove all uses of ExecutionEnvironment.global
2013-09-09 16:23:20 -07:00
Ben Alpert
232b61044c Warn for 'class' and 'for' property names
Also stroke-linecap, stroke-width, stop-color, stop-opacity.

Test Plan:
grunt test
2013-09-09 15:59:42 -07:00
Ben Alpert
426cdbb3ae Remove all uses of ExecutionEnvironment.global
Closes #271.

All three of these files are DOM-specific so it should be fine to use window. (ReactEventTopLevelCallback isn't obviously DOM-specific but it calls getEventTarget which is so I think we're fine here.)

Test Plan:
grunt test, tried events in a real browser and they seemed to work still.
2013-09-09 15:51:06 -07:00
Paul O’Shannessy
d83fe785c5 Stop transforming class -> className
Update the broken examples too (`git grep class=`)
2013-09-09 15:37:43 -07:00
Ben Newman
888cc309e0 Stop using comments as boundary markers in dangerouslyRenderMarkup.
Jordan warned (and StackOverflow confirmed) that IE8 doesn't respect HTML
comment nodes when setting `.innerHTML`:
http://stackoverflow.com/questions/15006001/inserting-a-comment-in-innerhtml

The virtue of the comment strategy was that the parser did all the work of
maintaining the boundaries between markup chunks, using comments as the
boundary markers.  The new strategy (of tagging the first node with a
special attribute) has a similar virtue, since the parser should preserve
that attribute only for the nodes we care about, and any rendered nodes
that do not have the attribute can be ignored (and complained about by
`console.error`).
2013-09-09 14:59:55 -07:00
Paul O'Shannessy
4ed7b85ed8 Log unknown props only when we have a match
Logging every unknown property got very noisy when combined with use of `transferPropsTo`. I knew this would be a potential issue initially but decided it was worth it. Others disagreed and it's resulting in some confusion.

This changes the logging to ensure that we have a potential correction, so only DOMish properties should result in warnings.
2013-09-09 14:57:56 -07:00
Pete Hunt
647731e399 Supporting mounting into iframes
Sencha says that separating big components into their own iframes was important for performance:
http://www.sencha.com/blog/the-making-of-fastbook-an-html5-love-story.

Today the only thing stopping us is that events don't bubble to our events system from an iframe. This diff
looks at the owning document of the container and adds top-level listeners to it. It should not change
existing behavior and should improve our support for this.
2013-09-09 14:57:33 -07:00
Ben Newman
cd7d863f20 Avoid unnecessary array allocations in dangerouslyRenderMarkup. 2013-09-09 14:56:27 -07:00
Paul O'Shannessy
9d0f3623c3 Cache length of NodeList when updating radios 2013-09-09 11:53:13 -07:00
Pete Hunt
e010a2d90b Fix bugs with CSS3 animation event in webkit
We were incorrectly sniffing the animationend event.
2013-09-09 11:52:59 -07:00
Paul O’Shannessy
d704bc24f4 Initial build of ReactTransitionGroup
This builds `ReactTransitionGroup` with it's own copy of `React`, which
it total clownshoes. This should be technically usable, but definitely
should not be used in any production environment.
2013-09-07 16:18:14 -07:00
Paul O’Shannessy
ff2fc586d5 Merge pull request #324 from chenglou/backbone-todo-ex
Fix backbone todo example bugs.
2013-09-07 14:53:01 -07:00
Cheng Lou
78d305eb16 Fix backbone todo example bugs.
Fixed:
- New todo not submitting correctly (page refreshes. `preventDefault`
wasn't there.
- Old checked todo being removed will leave the checkmark on the next
todo replacing its position.
- Cannot change todo (`value`'s now a controlled field).
- `autofocus` (should be `autoFocus`, how ironic given the current
situation) on new todo input isn't working. Switched to manual
`focus()` in `componentDidMount` for now.
- More consistent breathing space between lines.
- Gutter at 80.

Added:
- Use todomvc-common base.css. The old one had to change ids to
classes. No longer necessary.
- Give `cx` a better name and move it in `Utils`.
- Trim input upon finishing edit.
- Remove todo if the new edited value is empty.
- Submit edited todo value on input blur.
- README to explain the existence of this example. Being able to
maintain a non-compilant version allows nice deviations from the
todomvc specs, such as animations, in the future.
2013-09-07 17:44:05 -04:00
Paul O’Shannessy
6b5c1810c0 Merge pull request #323 from benjamn/simplify-bin/jsx
Simplify bin/jsx to perform just the JSX transform
2013-09-07 14:41:55 -07:00
Paul O’Shannessy
e41912d6d4 Merge pull request #325 from spicyj/elseifdev
Move else if (__DEV__) into two statements
2013-09-07 14:08:03 -07:00
Ben Alpert
97e0926696 Move else if (__DEV__) into two statements
The minification stage doesn't like `else if (__DEV__)`.
2013-09-07 14:03:48 -07:00
Paul O’Shannessy
8df407deb8 Merge pull request #281 from spicyj/radio
Fix controlled radio button behavior
2013-09-07 13:54:57 -07:00
Paul O’Shannessy
2ba405d5f8 Merge pull request #267 from spicyj/warn-props
Warn about unknown property values
2013-09-07 13:06:41 -07:00
Ben Newman
658f41cb30 Simplify bin/jsx to perform just the JSX transform.
We will continue using `bin/jsx-internal`, well, internally.

Note that this version no longer respects `@providesModule`, and it
doesn't do anything special with constants like `__DEV__`, so we can no
longer get to claim that `bin/jsx` can be used to build the core.

I'm happy about this, personally, because it demonstrates the flexibility
of Commoner.
2013-09-06 16:20:25 -04:00
Ben Newman
ebc0d09595 Merge pull request #322 from petehunt/build-animations
Add ReactTransitionGroup to the build
2013-09-06 10:49:30 -07:00
petehunt
f7ea031dac Add ReactTransitionGroup to the build 2013-09-06 10:47:18 -07:00
Ben Alpert
b56b5885d0 Fix controlled radio button behavior
Fixes #242.
2013-09-06 00:57:51 -07:00
Ben Alpert
a4c23d328c Warn about unknown property values
Fixes #255.
2013-09-06 00:33:01 -07:00
Paul O'Shannessy
3cf14e8f9b Remove ReactChildren methods from React object
These are not terribly useful on this object and the naming of
`React.forEachChildren` sucked anyway.
2013-09-05 18:35:59 -07:00
Pete Hunt
c8886a0424 Make mounting on the root of the page work correctly
This was apparently only partially supported. We had issues initially mounting if there was no HTML present and
also had issues if we had to update HTML that was already there. This diff fixes all of these cases and has
tests to prove it. NOTE: I removed a test that was actually erroneous. My bad.
2013-09-05 13:50:18 -07:00
Paul O’Shannessy
4f0dea3e7e Merge pull request #294 from clayallsopp/better_update_msg
More helpful message if you update an unrendered component
2013-09-05 11:54:07 -07:00
Clay Allsopp
9dd8ef4777 fix formatting and test for correct error 2013-09-04 18:13:33 -07:00
Paul O’Shannessy
65c4ef91c7 Sync CSSCore from upstream 2013-09-04 16:47:16 -07:00
Pete Hunt
32d3d7774a Use dumpCache() rather than manual reset
I forgot this module existed until @benjamn reminded we had a way to do it.
2013-09-04 15:54:27 -07:00
Pete Hunt
8664c8ac57 Test cases covering rendering onto document
There were some bug reports here, I couldn't reproduce but wrote tests anyway. We should definitely have these.
2013-09-04 15:54:11 -07:00
Ben Newman
dea0cc01cf Improve error behavior of Danger.dangerouslyRenderMarkup.
HTML comment nodes are now interspersed in the original markup list so
that we can tell which chunks of markup rendered as more or less than one
node, and give a more helpful error message in that case.

Regardless of how many nodes were rendered, we only take the first one. If
zero nodes were rendered, then `resultList` will contain `null` at the
corresponding position.

If we decide to revisit the idea of using document fragments, it will be
very easy to handle the `!== 1` case by returning a document fragment.
2013-09-04 15:54:09 -07:00
Pete Hunt
80f1590265 Add ReactTransitionGroup
This introduces <ReactTransitionGroup>, a component that works a lot
like Angular's ng-animate.

The problem we're currently facing is twofold:
1. We don't really have a great convention surrounding CSS transitions
   in React
2. (harder) we can't animate nodes that are leaving the DOM, as their
   nodes are instantly destroyed.

To solve the first issue I've adopted Angular's convention. It's
implemented in ReactTransitionableChild.

The second part is what's tricky. To do this I've implemented three modules:
- ReactTransitionableChild, which can keep its old children around if they
  change to null
- ReactTransitionKeySet, which can look at a prev and next set of child
  keys and merge them in a reasonable way
- ReactTransitionGroup, which combines ReactTransitionableChild and
  ReactTransitionKeySet to keep nodes that are leaving the DOM in the
  DOM until their animations are complete
2013-09-04 15:54:06 -07:00
Paul O’Shannessy
c25c5b543b Update wording 2013-09-04 15:26:31 -07:00
Cheng Lou
8852b86ad8 Add Stack Overflow link for doc support page. 2013-09-04 16:01:48 -04:00
Paul O'Shannessy
a42fd30fc2 Remove React.autoBind for real
This has been deprecated for a long while now, we should actually remove it.
2013-09-03 14:27:00 -07:00
Pete Hunt
406dcbd8da Fix a few GC leaks in events system
Summary:
    - Weren't pooling the Transaction in the batching strategy
    - Creating a new closure for every event tick due to batchedUpdates()
    - EnterLeaveEventPlugin creates a new array on each event.

I wonder if there is more optimization opportunity in accumulate(). Squinting at the fps graph this seems to be faster and waste less memory but it's hard to conclusively tell. I did verify that these were all hotspots though.
2013-09-03 14:27:00 -07:00
Paul O’Shannessy
de61f9fd81 Merge pull request #298 from vjeux/pagination
Add pagination to blog
2013-09-03 13:35:12 -07:00
Paul O’Shannessy
57fe412619 Merge pull request #305 from brianr/tutorial-explain-showdown
Tutorial: show how to add showdown.js
2013-09-03 13:33:05 -07:00
Pete Hunt
b4ff29ac78 Merge pull request #312 from zpao/docs-redirect
Redirect /docs to the right page
2013-09-03 13:30:16 -07:00
Paul O’Shannessy
ba460de7ed Redirect /docs to the right page
I've hit this a few times where I want to get to docs so I take whatever
my urlbar gives me and strip out the actual page so I can get to the
root, however that's a 404.

This introduces a super easy way to redirect, which could be handy in
the future as docs get rewritten.

I would much rather do this with a real htaccess file or even just
handle 404s gracefully, but that's not currently an option with GitHub
pages (since we generate our own and don't use a custom domain).
2013-09-03 13:25:23 -07:00
Pete Hunt
c7768fde5d Merge pull request #307 from chenglou/todomvc-director
sync with tastejs todomvc
2013-09-02 10:22:58 -07:00
Clay Allsopp
15f84a391d move lifecycle check into replaceProps instead of updateComponent 2013-09-01 18:42:01 -07:00
Cheng Lou
2b9c34b5c7 sync with tastejs todomvc 2013-08-31 21:54:37 -04:00
Brian Rue
403b087e97 Tutorial: show how to add showdown.js 2013-08-30 16:29:01 -07:00
Sebastian Markbage
75aee1714b Expose the instance cache
We need access to the instance cache for debugging tools. Ideally we want to
expose a more stable and supported interface but this seems like a quick win,
for now.
2013-08-30 13:21:04 -07:00
Pete Hunt
c41e86c990 Make ReactDefaultPerf work server-side
We were reading from window which was throwing when ReactDefaultPerf was injected.
2013-08-30 13:20:53 -07:00
Paul O'Shannessy
4d8f0449d9 React.isValidClass
Sometimes you may need to detect if a value is a valid React class constructor. This enables that and prevents future consumers from getting caught in the trap of depending on an internal implementation detail we might change.

Currently this works for classes created with `React.createClass` as well as `React.DOM.*`.
2013-08-30 13:20:51 -07:00
Pete Hunt
0db4077c3a Make React batching strategy injectable 2013-08-30 13:20:48 -07:00
Tim Yung
f88aa35187 Change vendored module isDOMNode -> isNode 2013-08-30 13:20:45 -07:00
Andrew Zich
7d34c09e17 Don't trigger mouse events on native button elements that are disabled
This adds a `ReactDOMButton` module that shims the native `<button>` React component so it doesn't receive mouseup, mousemove, mousedown, click, or double-click events when its disabled property is truthy.
2013-08-30 13:20:40 -07:00
Paul O’Shannessy
e11c4ecbaf [docs] Small tweaks as reported in comments
* highlight `</form>`
* use correct id in `getElementById` call
2013-08-28 14:42:07 -07:00
Paul O’Shannessy
553ed1416c Update package dependencies
Sometimes I look at https://david-dm.org/facebook/react
2013-08-27 14:46:06 -07:00
Paul O’Shannessy
688f5051e6 Sync objMap from upstream 2013-08-27 14:43:46 -07:00
Pete Hunt
adb666e67f Allow getInitialState() for mixins
Today mixins can't easily be stateful because they can't provide getInitialState(). This allows multiple getInitialState() methods as long as they don't return objects that have conflicting keys. In that case, we throw.
2013-08-27 14:17:26 -07:00
Paul O’Shannessy
07e2072692 Support props for <meta> elements.
`content`, `httpEquiv`, `charSet` are all needed. We're currently
working around this in `react-page`.

`content` is the risky one here since we previously supporting using
`content` to set the text content. We removed support for that in
e998041229 so the risk is minimal, there
just might be some lingering old code.

Fixes #292

Test Plan: Visit `data:text/html,<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" charset="utf-8"></head>`

```
var m = document.querySelector('meta');
m.httpEquiv; // Content-Type
m.httpEquiv = 'foo';
m.httpEquiv; // foo

m.charset; // undefined
m.charSet; // undefined
m.getAttribute('charset'); // utf-8
m.setAttribute('charset', 'bar');
m.getAttribute('charset'); // bar

m.content; // text/html; charset=utf-8
m.content = 'baz';
m.content; // baz
```
2013-08-27 11:45:59 -07:00
Vjeux
1c14cd6c8b Add pagination to blog
- Add pagination
- Display full content in /blog
- Truncate Recent posts
- Add permalink that lists all the blog posts
- Add spacing and bullet around recent posts to make it more readable
2013-08-27 02:14:17 +02:00
Paul O’Shannessy
744b54a829 Fix capitalization of Tooling Integration page 2013-08-26 14:53:56 -07:00
Vjeux
a90c463abe Update the tooling page to include pyReact, react-rails and react-page 2013-08-26 14:49:31 -07:00
Vjeux
6bf21f1610 Community round-up #7
http://fooo.fr:4000/react/blog/2013/08/26/community-roundup-7.html
2013-08-26 14:22:16 -07:00
Ben Alpert
364ee1ffae Add missing "use strict" statement to pass lint
Test Plan:
grunt lint; grunt test
2013-08-26 13:46:11 -07:00
Clay Allsopp
88faef3ba9 Add more helpful invariant if you're updating an unrendered component 2013-08-26 10:42:53 -07:00
Eric Clemmons
bcc6b524fb Add rowSpan DOM property 2013-08-25 13:32:38 -05:00
Sebastian Markbage
61b38b9f05 Explicit and Implicit Keys Need Separate Namespaces
There are certain cases where you can end up with a collision with an implicit
key (array index) if your explicit key prop is a number. They should use
different namespaces. Therefore I wrap explicit keys in curlies and implicit
array indices in brackets.

I added a simple test case, but another case came up on the mailing list. Where
undefined entries in an array actually results in an entry and therefore an
implicit key.
2013-08-23 14:05:18 -07:00
Danny Ben-David
fce57abeca Benchmarking tool for React application performance
ReactAppPerf wraps core methods and logs info from them; there's no real
UI at this point
2013-08-23 14:05:11 -07:00
Paul O’Shannessy
946e9b0c80 Merge pull request #289 from jordwalke/ServerRenderingFixes3
Server rendering: rendering of entire document using React.
2013-08-23 13:14:06 -07:00
Jordan Walke
748ed6cd81 adding better test - moving execution env module. 2013-08-23 12:32:35 -07:00
Jordan Walke
49f174cdad Server rendering: rendering of entire document using React.
Summary: Allows rendering of React into the "document" as opposed to into a
particular node. To recap some basics:

document: One level above the <html> tag - like the browser.
document.documentElement: <body>

To support full-page server side rendering, we need to be able to render
*everything* including the HTML/BODY tags. This allows that.
2013-08-23 02:04:07 -07:00
Paul O’Shannessy
6ca8d31c83 [react-tools] Add src/ to files
This is so it's possible to use the original @providesModule source
files in a toolchain that understands those.
2013-08-22 22:35:50 -07:00
Paul O’Shannessy
aa1fa7468b Merge pull request #280 from jeffmo/jstransform_npm
Move to using `jstransform` and `esprima-fb` npm modules
2013-08-22 15:43:59 -07:00
JeffMo
2d048f1f34 Move to using jstransform and esprima-fb npm modules 2013-08-22 15:28:41 -07:00
Clay Allsopp
3d1cc16a9b Add CDNJS to docs. Fixes #244 2013-08-22 11:07:50 -07:00
Paul O’Shannessy
cbe86e04b3 Docs: fix header 2013-08-22 11:02:09 -07:00
Paul O’Shannessy
a558e560bd Use script to find remaining 404s. Fix them. 2013-08-22 10:59:22 -07:00
Clay Allsopp
cfe4152b1d Fix broken tutorial link and change wording 2013-08-21 22:38:44 -07:00
Kunal Mehta
91c2a8d90b Added PyReact blog post. 2013-08-19 14:48:28 -07:00
Christopher Chedeau
2c8f907b2c Merge pull request #277 from stoyan/patch-1
typo fix
2013-08-19 11:45:51 -07:00
Tim Yung
669f4b867f Allow DOM Nodes in ImmutableObject
Currently, `ImmutableObject` will stack overflow while it tries to recurse and deep freeze all the properties of a DOM node.
2013-08-19 11:37:08 -07:00
Stoyan
5fae286cf4 typo fix 2013-08-19 11:35:46 -07:00
Timothy Yung
a2c90aad86 Merge pull request #275 from spicyj/input-private
Make getChecked, getValue, handleChange private
2013-08-19 11:20:52 -07:00
Ben Alpert
898621d0a1 Make getChecked, getValue, handleChange private
Test Plan: grunt test, enter text in ballmer-peak example without any JS errors.
2013-08-17 22:29:41 -07:00
Timothy Yung
e1c1d869de Merge pull request #251 from spicyj/select-value
Fix behavior of ReactDOMSelect with `defaultValue`
2013-08-17 21:50:13 -07:00
Ben Alpert
25e2cd0db6 Fix behavior of ReactDOMSelect
Closes #250.

Test Plan:
With multiple and not, verified: With defaultValue, the correct option is picked initially, user changes change the selection, and changes to defaultValue have no effect. With value, the correct option is picked initially, user changes do nothing, and changes to value change the selection.

Also ran the tests.
2013-08-17 16:57:49 -07:00
Paul O’Shannessy
1f8ef4c903 Sync modules to vendor/core
We haven't done this recently. Nothing has changed significantly, though
this does remove some files we weren't using.
2013-08-16 15:40:23 -07:00
James Ide
d9511d817a Move utils out of React that aren't being used
Many of React's util functions are non-redundant with Facebook's core
libraries, so move them out of React into a central location (out of
this repo).

These files were not getting used by any part of React core, so didn't
actually belong here anyway.
2013-08-16 15:40:11 -07:00
Cheng Lou
2fda70fb4a fix test case for rendering text node number 0 2013-08-16 13:51:17 -07:00
Sebastian Markbåge
02f618d52c Merge pull request #268 from spicyj/bind-null
Make .bind(null, ...) work on autobound methods
2013-08-16 12:06:49 -07:00
Jordan Walke
61c47e4cae Refactor ReactComponent to have no dependency on the DOM.
React is more than just a DOM app library, it is a component
abstraction library. This enforces that.
2013-08-15 10:56:39 -07:00
Jordan Walke
e6b216bdbb Extract out core ReactEmitter functionality.
Other environments can make use of some of the logic in ReactEventEmitter.
2013-08-15 10:56:30 -07:00
Ben Alpert
192727e152 Make .bind(null, ...) work on autobound methods
Fixes #266.
2013-08-15 09:58:38 -07:00
Paul O’Shannessy
cb00d3e66c Upgrade phantomjs to 1.9.1-4
This fixes the install and permissions issues we've been seeing with
other 1.9.1-x versions.
2013-08-13 15:37:26 -07:00
Paul O’Shannessy
987e5e8f13 Merge pull request #258 from chenglou/patch-3
defaultValue of 0 now displayed
2013-08-12 18:20:32 -07:00
Paul O’Shannessy
df0bc8c3af Merge pull request #261 from benjamn/phantomjs-1.9.0-1
Hold PhantomJS version at 1.9.0-1.
2013-08-12 15:21:50 -07:00
Ben Newman
983120102c Hold PhantomJS version at 1.9.0-1.
And don't attempt any chmod magic, either.
2013-08-12 17:47:31 -04:00
Cheng Lou
86c0b69390 separate new tests into respective file 2013-08-12 17:03:10 -04:00
Cheng Lou
d5989a0de4 tests for displaying defaultValue of 0 2013-08-12 16:08:16 -04:00
Cheng Lou
1b747c526c defaultValue of 0 now displayed
previously treated as empty string when passed to input text/textarea
2013-08-09 23:13:44 -04:00
Paul O'Shannessy
5cbabdf4c9 Support autocapitalize DOM Property
It's non-standard, but potentially useful on mobile.

See some discussion in google group: https://groups.google.com/forum/#!topic/reactjs/MBcCFohHHHA

Closes #247
2013-08-06 14:19:49 -07:00
Paul Shen
9ef4e74ba2 ReactChildren
Instead of changing `traverseAllChildren`, keep that around for perf
reasons (for the hot code path `flattenChildren`)

Introduce `ReactChildren.map` and `ReactChildren.forEach`
which mirrors `Array.prototype.map` and `Array.prototype.forEach`. This
involves a rename of `mapAllChildren`
2013-08-06 14:17:33 -07:00
Vjeux
0321171113 Community Round-up #6 2013-08-06 01:31:23 +02:00
Christopher Chedeau
d542621155 Fix 404 in Getting Started 2013-08-04 21:09:15 -07:00
Pete Hunt
4bbf8acc9b Merge pull request #249 from pcottle/fixLinks
Fix Github links in examples
2013-08-04 17:40:00 -07:00
Peter Cottle
a21556314d Fix Github links in examples
Looks like we link to github.com/facebook/react/ instead of react-js. This just fixes the links

`grep -r "facebook/react.js" .` comes up clean now
2013-08-04 16:40:12 -07:00
Paul O'Shannessy
99d3d7f914 Get rid of remaining ReactID references
It's gone. Also compacted a bit of code to match the other usage.
2013-08-01 13:58:28 -07:00
Paul O’Shannessy
86d9e0a97a Merge pull request #245 from chenglou/patch-3
Change ref from ReactID to ReactInstanceHandles
2013-08-01 13:41:10 -07:00
Cheng Lou
db0ff96200 Change ref from ReactID to ReactInstanceHandles 2013-08-01 14:52:08 -04:00
Tim Yung
808e625d9d Use createNodesFromMarkup
Pulled out markup rendering logic for better reuse.
2013-07-31 21:21:06 -07:00
Paul O’Shannessy
dc06704ec7 react-rails blog post 2013-07-30 15:25:44 -07:00
Tim Yung
5ef3c1b09b Fix Reconciling Components to Content
This fixes a reconciliation bug introduced by adffa9b0f4.

The new unit test case exhibits the bug. When a component that has rendered child components is updated to render inline text, we usually:

 # Unmount and remove all child components.
 # Set the new inline text content.

However, with batched child operations, we do not **remove all child components** until later. The current implementation will set the inline text content and blow away those nodes, causing a fatal when `ReactMultiChild` later tries to find and remove those nodes.

This fixes the bug by ensuring that text content changes are also enqueued.
2013-07-29 16:15:30 -07:00
Paul O’Shannessy
fe451c30f8 Merge pull request #241 from gasi/master
Fix incorrect port of standard Python server
2013-07-29 11:09:37 -07:00
Daniel Gasienica
6f2848f4a6 Fix incorrect port of standard Python server
/ht @zpao
2013-07-29 10:59:43 -07:00
Paul O’Shannessy
d63ce62916 Merge pull request #207 from thisishugo/patch-1
update dead jsx link to point to an extant page
2013-07-29 09:11:37 -07:00
Ben Newman
c7d6a5ae4d Merge pull request #237 from yungsters/master
Fix Test Failures
2013-07-28 07:02:17 -07:00
yungsters
d5e970b93f Fix Danger test failures.
The original tests were flawed because the `Danger` module exploits the fact that all React-generated markup has at least one attribute. This allows the module to extract node names from markup strings faster.

However, the tests were passing in strings of markup with no attributes.

Also, this fixes a test failure due to the test trying to set text content into a `<tr>` which is typically disallowed by browsers (and PhantomJS). This changes it to use `<td>` instead.
2013-07-28 01:05:13 -07:00
yungsters
4cb49f5561 Change ReactMultiChild test to check for innerHTML descriptor.
Not all testing environments will support setting the `innerHTML` descriptor. For example, PhantomJS initializes the `innerHTML` property as not configurable.
2013-07-28 01:04:24 -07:00
Paul O’Shannessy
c347b720a9 Updated Readme for 0.4.1 2013-07-26 15:57:37 -07:00
Paul O’Shannessy
27a1729f6d Blog post for v0.4.1 2013-07-26 15:56:52 -07:00
Paul O’Shannessy
a1f5c1dee7 Updated Changelog for 0.4.1 2013-07-26 15:56:22 -07:00
Paul O’Shannessy
20179b7991 Send branch info from travis for continuous builds 2013-07-26 14:28:33 -07:00
Tim Yung
adffa9b0f4 Batch Child Markup Generation
Setting `innerHTML` is slow: http://jsperf.com/react-child-creation/2

This reduces the number of times we set `innerHTML` by batching markup generation in a component tree.

As usual, I cleaned up the `ReactMultiChild` module significantly.

== Children Reconciliation ==

When a `ReactNativeComponent` reconciles, it compares currently rendered children, `prevChildren`, with the new children, `nextChildren`. It figures out the shortest series of updates required to render `nextChildren` where each update is one of:

 - Create nodes for a new child and insert it at an index.
 - Update an existing node and, if necessary, move it to an index.
 - Remove an existing node.

This serializable series of updates is sent to `ReactDOMIDOperations` where the actions are actually acted on.

== Problem ==

There are two problems:

 # When a `ReactNativeComponent` renders new children, it sets `innerHTML` once for each contiguous set of children.
 # Each `ReactNativeComponent` renders its children in isolation, so two components that both render new children will do so separately.

For example, consider the following update:

  React.renderComponent(<div><p><span /></p><p><span /></p></div>, ...);
  React.renderComponent(<div><p><img /><span /><img /></p><p><img /><span /><img /></p></div>, ...);

This will trigger setting `innerHTML` four times.

== Solution ==

Instead of enqueuing the series of updates per component, this diff changes `ReactMultiChild` to enqueue updates per component tree (which works by counting recursive calls to `updateChildren`). Once all updates in the tree are accounted for, we render all markup using a single `innerHTML` set.
2013-07-26 12:48:07 -07:00
Tim Yung
2e37f65bdc Delete throwIf
Deletes `throwIf()` in favor of having one way to throw errors: `invariant()`
2013-07-26 12:48:07 -07:00
Paul O'Shannessy
2e43de20cc Cleanup 2nd param to ReactEventEmitter.ensureListening
It was removed, so these callsites aren't actually doing anything.
2013-07-26 12:25:03 -07:00
Paul O’Shannessy
a41aa76ef3 Merge pull request #224 from spicyj/cb-context
Call callbacks from setState in component context
2013-07-25 09:04:17 -07:00
Tim Yung
bdf2a9bb12 Use invariant in react/utils
Just some therapeutic cleanup.
2013-07-24 17:41:54 -07:00
Tim Yung
8d48610b7e Typecheck ImmutableObject
Just some therapeutic cleanup.
2013-07-24 17:41:37 -07:00
Tim Yung
759425fc90 Use invariant in OrderedMap
Just some therapeutic cleanup.
2013-07-24 17:41:22 -07:00
Jordan Walke
2ee66262db Remove circular dependencies in React Core.
There is a circular dependency between `ReactID`, `ReactMount` and
`ReactInstanceHandles`. Ben and I talked about this today. It seems like the
simplest solution is to consolidate a lot of the code that Ben recently wrote
into `ReactMount`. We can later find ways to trim code out of this module
without causing circular deps.
2013-07-24 17:40:57 -07:00
Pete Hunt
260d90ba02 Warn when server-rendered markup is not what we expect on the client
As @leebyron and balpert pointed out, if the markup on the server is differnet than what the client expects undefined behavior and chaos may ensue. A good fallback
is for us to just inject the client-side markup (as it is the source of truth) and warn the user in __DEV__ that something is wrong. In order to do a fast
browser-independent check of the DOM I use an adler32 checksum of the generated markup. I believe this is better than a simple innerHTML compare because different
browsers massage innerHTML differently.
2013-07-24 17:39:59 -07:00
Jordan Walke
492407bcc9 Fix OrderedMap.
Tim caught a bug. Squashing it so he can rebase on top of it.
2013-07-24 17:39:37 -07:00
Paul O’Shannessy
ddb0ef98f7 Fix "Suppport" type in docs 2013-07-24 13:13:27 -07:00
Paul O’Shannessy
8dd4428c55 Merge pull request #217 from jakubmal/non-browser-env
Allow to execute JSXTransformer outside of browser environment
2013-07-23 17:29:14 -07:00
Jakub Malinowski
795a84d60f Do not export load in JSXTransformer unless in a browser environment 2013-07-23 23:01:38 +02:00
Jakub Malinowski
947e17154a Merge remote branch 'upstream/master' into non-browser-env 2013-07-23 22:31:48 +02:00
Cheng Lou
7f8b2885d9 fix jquery-bootstrap example bugs
Old one had some bugs:
- 'x' on modal wasn't showing.
- trying to close modal in unmount, but modal had a closing animation.
2013-07-23 11:01:42 -07:00
Paul O’Shannessy
d1c5cda93f Use the right home page for react-source gem 2013-07-23 10:55:41 -07:00
Vjeux
975b5d978f Community Round-up #5
http://fooo.fr:4000/react/blog/2013/07/20/community-roundup-5.html
2013-07-23 09:23:50 -07:00
Ben Alpert
f1231e60b0 Call callbacks from setState in component context
This is way more useful than the alternative.
2013-07-22 23:47:07 -05:00
Tim Yung
4deb0d619c Fix Clicks in Mobile Safari
This works around a bug with listening to clicks using event delegation on Mobile Safari using an event plugin.

NOTE: We don't enable touch events by default, so I don't know if would want to inject this plugin by default. In fact, I'm not sure what our strategy is at all for when to invoke `React.useTouchEvents(true)`.
2013-07-22 18:31:33 -07:00
Tim Yung
cf3ff07f92 Fix TypeError in SyntheticEvent
I suspect that plugins are modifying `Object.prototype` which is causing TypeErrors in `SyntheticEvent`. Let's fix it.
2013-07-22 18:31:08 -07:00
Paul O’Shannessy
bbb4a367be Run grunt build with npm test so that we can upload all files 2013-07-22 18:16:44 -07:00
Paul O’Shannessy
63d6cc013e Push builds from travis to remote host 2013-07-22 18:07:43 -07:00
Paul O'Shannessy
d1d2d8d463 Don't set DOM attributes to "undefined" on update
We already skip `null` and `undefined` when building up the stringified html on first render, but if you update a component to the *exact same* conditions, React will leave the DOM in a different state. We shouldn't do that.
2013-07-22 10:28:21 -07:00
Jordan Walke
74cfc9c274 Remove unused dependency on ReactMount
We don't really use these, and this will make our lives easier.
2013-07-22 10:28:12 -07:00
Ben Newman
add809be21 Add comment explaining internalGetID 2013-07-22 10:28:09 -07:00
Paul O’Shannessy
579d86f024 Merge pull request #218 from chenglou/patch-2
upgrade example to 0.4
2013-07-20 16:33:05 -07:00
Cheng Lou
73ceb5a401 upgrade example to 0.4
manually tested
2013-07-20 16:05:25 -04:00
Jakub Malinowski
2b9dd04f4d Allow to execute JSXTransformer outside of browser environment 2013-07-20 15:10:36 +02:00
Paul O’Shannessy
4f53fbf1a2 Merge pull request #216 from phleet/patch-1
Docs Typo Fix: s/pased/passed
2013-07-19 16:47:44 -07:00
Cheng Lou
64d72f8c4b fix typos 2013-07-19 16:40:09 -07:00
Jamie Wong
50a00662cf s/pased/passed 2013-07-19 18:48:46 -04:00
Paul O’Shannessy
d7fcbe0f96 Merge pull request #213 from benjamn/remove-stray-nodes-after-each-test
After each test, remove any stray nodes added to the document
2013-07-19 11:26:50 -07:00
Ben Newman
0441d4c7f5 Rename removeSiblings to removeNextSiblings. 2013-07-19 14:18:44 -04:00
Paul O’Shannessy
d9aa2bd12c Merge pull request #212 from spicyj/docfix
One-character typo fix
2013-07-19 11:02:40 -07:00
Ben Alpert
222faf4544 One-character typo fix 2013-07-19 10:55:31 -07:00
Ben Newman
36fbd8d941 After each test, remove any stray nodes added to the document.
This was not necessary when we were running each test in its own
`<iframe>`, and it doesn't seem to affect any test behavior currently, but
it seems wise for the sake of test isolation and hygiene.
2013-07-19 13:53:15 -04:00
Paul O’Shannessy
547079763e Merge pull request #211 from phleet/patch-1
Docs Typo Fix: s/distinciton/distinction
2013-07-19 10:36:25 -07:00
Paul O’Shannessy
a7dfe04406 Merge pull request #210 from benjamn/rewrite-Function.prototype.bind-polyfill
Pull in my rewritten Function.prototype.bind polyfill from upstream
2013-07-19 10:23:17 -07:00
Jamie Wong
bf275a9097 Docs Typo Fix: s/distinciton/distinction 2013-07-19 12:33:54 -04:00
Ben Newman
507e58ed96 Pull in my rewritten Function.prototype.bind polyfill from upstream.
We don't sync upstream polyfills (because we don't have a story for how
they would be used), so this needs to be updated manually.

Sacrificed some negligible performance optimizations to reduce the number
of different cases from four to one.

It's important to test this implementation in PhantomJS, since that's the
only browser that I know of where built-in functions sometimes do not have
a `.prototype`.
2013-07-19 12:28:44 -04:00
Paul O’Shannessy
d9c0be408b Merge pull request #209 from benjamn/speed-up-tests
Abandon <iframe> test isolation hack now that dumpCache works
2013-07-19 09:10:52 -07:00
Ben Newman
5beb481145 Abandon <iframe> test isolation hack now that we have dumpCache.
This cuts the running time of `grunt phantom:run` from 4.4s to 3.1s on my
machine, because we no longer have to load/execute a separate instance of
`react-test.js` in a separate `<iframe>` for each test.
2013-07-19 11:10:02 -04:00
Ben Newman
7ef5172d80 Don't call require("mock-modules").register("test/all", ...).
The "test/all" module will never be mocked, nor should it ever need to be
reset by `dumpCache`.
2013-07-19 11:10:02 -04:00
Hugo Jobling
4ab62a6bd2 remove dead link
the event handling doc page no longer exists
2013-07-18 11:05:39 +01:00
Hugo Jobling
07427ae9d0 put closing paren in correct place 2013-07-18 10:44:22 +01:00
Hugo Jobling
8f55d94d40 update dead jsx link to point to an extant page
syntax.html no longer exists, so point people at the in depth article instead.
2013-07-18 10:36:54 +01:00
Pete Hunt
e6812d7e36 Add iframe attributes to React
These are pretty useful for building apps and stuff.
2013-07-17 20:39:19 -07:00
Ben Newman
75ce576d3d Avoid some innocuous test warnings.
This reduces some console.warning spew from `grunt test` output.
2013-07-17 20:38:32 -07:00
Ben Newman
fa7cc57a6d Merge pull request #206 from benjamn/getAttribute-instead-of-getAttributeNode
Use getAttribute instead of getAttributeNode in ReactID.rawGetID
2013-07-17 18:24:27 -07:00
Ben Newman
fd2125ee94 Use getAttribute instead of getAttributeNode in ReactID.rawGetID.
Also known as internalGetID, internally.
2013-07-17 21:14:04 -04:00
Paul O’Shannessy
52e622f1db Version bump for 0.5.0 development 2013-07-17 16:45:38 -07:00
Paul O’Shannessy
3d7ac69c39 Merge pull request #203 from spicyj/homepage
Fix all errors and warnings on homepage
2013-07-17 13:32:52 -07:00
Ben Alpert
e379f8ec03 Fix all errors and warnings on homepage
Also onChange instead of onInput in two places!
2013-07-17 13:31:52 -07:00
Paul O’Shannessy
dbdf1cc296 Merge branch 'chenglou-master'
Conflicts:
	docs/_js/examples/markdown.js
2013-07-17 13:30:22 -07:00
Cheng Lou
dd14fdfdc5 todo fix 2013-07-17 16:28:04 -04:00
Cheng Lou
fc6a567e0e jsx 2013-07-17 16:25:25 -04:00
Paul O’Shannessy
96bd63cc4b Fix typo in blogpost
I fixed this in the changelog, but missed this one.
2013-07-17 13:23:18 -07:00
Cheng Lou
169b172ffc textarea format 2013-07-17 16:22:30 -04:00
Paul O’Shannessy
ec67076090 Update readme for 0.4.0 2013-07-17 11:52:29 -07:00
Paul O’Shannessy
9221b15bff Typo in changelog, update blog leading sentence. 2013-07-17 11:51:27 -07:00
Paul O’Shannessy
a54333842f Bump version for v0.4.0 2013-07-17 11:33:31 -07:00
Paul O’Shannessy
0c1f2720b3 Remove React.autoBind from examples 2013-07-17 11:33:31 -07:00
Paul O’Shannessy
75f7f1e9ba remove likebutton from docs for now
it has some facebook-ism in there and it's probably shouldn't be on the
site.
2013-07-17 11:21:33 -07:00
Paul O’Shannessy
09fbf8e0ca Blog post for 0.4 2013-07-17 11:20:21 -07:00
Paul O’Shannessy
d17d0d5f50 Changelog for 0.4.0 2013-07-17 11:19:58 -07:00
Paul O’Shannessy
1a7a8486ca [docs] Make sure JSX comments code is in block 2013-07-17 11:18:17 -07:00
Paul O’Shannessy
65548db916 Re-order entries in changelog
React is more important than react-tools so put it first!
2013-07-17 10:04:27 -07:00
Paul O’Shannessy
894bb03b23 Add CHANGELOG at the root, remove from downloads page 2013-07-17 10:01:16 -07:00
Paul O’Shannessy
94573545f3 [docs] Prop validation + cleanup default props 2013-07-17 09:47:09 -07:00
Paul O’Shannessy
7734429b89 [docs] Remove @benjamn's TODO for testing 2013-07-17 09:12:26 -07:00
Paul O’Shannessy
35f092afef Write Default Props section 2013-07-17 09:12:02 -07:00
Paul O’Shannessy
b837bb7bdd [docs] fix typo
"L" is not ":"
2013-07-17 08:45:27 -07:00
Paul O’Shannessy
c629a0c5ad Revert "Merge pull request #200 from spicyj/version"
This reverts commit d889322827, reversing
changes made to 156dffb961.
2013-07-17 08:26:59 -07:00
Ben Newman
d889322827 Merge pull request #200 from spicyj/version
Add React.version
2013-07-17 06:13:49 -07:00
Paul O’Shannessy
156dffb961 [docs] Fix broken links 2013-07-17 01:37:52 -07:00
Pete Hunt
e5befc0a73 Update DOM differences docs to include a note about the style attribute. 2013-07-17 01:00:01 -07:00
Paul O’Shannessy
e3f6a6d916 Merge pull request #188 from facebook/docs-refactor
Look ma, new docs!
2013-07-17 00:56:07 -07:00
Paul O’Shannessy
58fecc8cbe Merge branch 'master' into docs-refactor 2013-07-17 00:26:05 -07:00
Paul O’Shannessy
b5aad9479e re-bold some text so it stands out better 2013-07-17 00:25:23 -07:00
Paul O’Shannessy
5db3a0e481 Remove React.autoBind from examples 2013-07-16 23:44:09 -07:00
Paul O’Shannessy
0300f2aa22 em dashes 2013-07-16 23:38:15 -07:00
Paul O’Shannessy
17d36a4cc3 Standardized Markdown lists 2013-07-16 23:35:54 -07:00
Paul O’Shannessy
c222f57b00 Cleanup "Reference"
(unlinked likebutton tutorial - not updated enough for public)
2013-07-16 23:31:32 -07:00
Paul O’Shannessy
1b64508aab Cleanup "Tooling Integration" 2013-07-16 23:31:03 -07:00
Paul O’Shannessy
f2b92d4c7b Cleanup "More About Refs" 2013-07-16 23:30:41 -07:00
Paul O’Shannessy
82f82c7543 Cleanup "Working With the Browser" 2013-07-16 23:30:18 -07:00
Paul O’Shannessy
602623661a Cleanup "Forms" 2013-07-16 23:29:39 -07:00
Paul O’Shannessy
ca3564898d Cleanup "Reusable Components" 2013-07-16 23:29:14 -07:00
Paul O’Shannessy
5b662b43a0 Cleanup "Multiple Components" 2013-07-16 23:28:51 -07:00
Paul O’Shannessy
6ba6fc149a Cleanup "Interactivity and Dynamic UIs" 2013-07-16 23:28:25 -07:00
Paul O’Shannessy
5a3a39aba4 Cleanup "JSX Gotchas" 2013-07-16 23:27:36 -07:00
Paul O’Shannessy
b9b300fcbd Cleanup "JSX in Depth" 2013-07-16 23:24:56 -07:00
Paul O’Shannessy
59f52bce04 Cleanup "Displaying Data" 2013-07-16 23:24:22 -07:00
Paul O’Shannessy
8d3465060d Merge remote-tracking branch 'upstream/docs-refactor' into HEAD 2013-07-16 23:23:32 -07:00
Paul O’Shannessy
d0af08190e Merge pull request #199 from chenglou/patch-1
Tweaked the intro page
2013-07-16 23:01:45 -07:00
Cheng Lou
b343fcaba3 grammar error 2013-07-17 00:15:49 -04:00
Cheng Lou
526099c928 changing back to 'give it five minutes', tweak that sentence 2013-07-17 00:12:21 -04:00
Paul O’Shannessy
f0984cf789 Don't hard code React version anywhere 2013-07-16 21:08:10 -07:00
Ben Alpert
7be14d8155 Add React.version
getConfig needs to be a function because grunt.config.data.pkg.version isn't available at the time that grunt/config/jsx/jsx.js is required.

Test Plan:
grunt build, grunt lint, grunt test all work. After building, both react.js and react.min.js contain the version number.
2013-07-16 20:38:40 -07:00
Cheng Lou
28f6f034ff Tweaked the intro page
Here are some ideas that I think work better:
- 15 repetitions of "React". Removed a few.
- The "two main ideas" weren't clearly separated. I put them under different headers and simplified the wording.
- The "Give it Five Minutes section didn't sound as reassuring. Made it sound more certain.
2013-07-16 21:39:20 -04:00
Paul O’Shannessy
3be6083ea4 Autogen the docs nav
This is still the same amount of duplication, except way easier to
parse. Docs nav now lives in `_config.yml` and you must restart jekyll
to see changes to that list (since config is only read at jekyll launch)
2013-07-16 17:24:41 -07:00
Paul O’Shannessy
f367d0e707 Remove numbers from URLs.
This will let us keep docs in order on the filesystem but have
reasonable permalinks. If we add something at 02- it doesn't result in
lots of broken links.
2013-07-16 17:09:43 -07:00
Paul O’Shannessy
9694a0f7ea Fix title casing and heading levels 2013-07-16 14:52:57 -07:00
Paul O’Shannessy
04bfa545f7 Remove "Scaling Up" 2013-07-16 13:55:42 -07:00
Ben Newman
1971ae8cac Merge pull request #196 from zpao/fix-test-warnings
Fix tests to silence some warnings due to autobinding
2013-07-16 13:15:35 -07:00
Paul O’Shannessy
fd3d16d379 Fix tests to silence some warnings due to autobinding 2013-07-16 13:08:46 -07:00
Paul O’Shannessy
dfd406fe4c Merge pull request #195 from benjamn/force-upgrade-graceful-fs
Upgrade Commoner and Populist to force upgrade to graceful-fs v2.0.0
2013-07-16 12:53:46 -07:00
Ben Newman
301c571405 Upgrade Commoner and Populist to force upgrade to graceful-fs v2.0.0.
A silent upgrade from graceful-fs v1.2.2 to v1.2.3 (a dependency for both
Commoner and Populist) broke the build process, even though tests were
still passing. The 2.0.0 version fixes whatever was broken, though I won't
pretend to know exactly what the root cause was.
2013-07-16 15:42:17 -04:00
Paul O’Shannessy
3376d27915 Merge pull request #194 from benjamn/build-jasmine-bundle-with-populist
Use populist for building jasmine test harness bundle
2013-07-16 11:51:22 -07:00
Ben Newman
0827646695 Use populist for building jasmine test harness package.
We're using populist for building the bundle of test modules and their
dependencies, so it seems worthwhile for consistency to do the same for
the test harness.
2013-07-16 14:48:31 -04:00
Ben Newman
03578e66b5 Fix rootElementsByReactRootID bookkeeping in ReactMount.js.
It's not always possible to update `rootElementsByReactRootID` when the
contents of the container are re-rendered; for instance, when we call
`dangerouslyReplaceNodeWithMarkup` or `dangerouslySetInnerHTML`. Since
this bookkeeping is just trying to warn about potentially problematic
manipulations of the root element, and we can be relatively sure that a
new element with the same ID is logically the same element, this diff
avoids warning in such cases.
2013-07-16 11:43:43 -07:00
Jan Kassens
71e24455a3 add missing argument to invariant in ReactDOMSelect 2013-07-16 11:38:35 -07:00
Tim Yung
83a840656c Fix Markup Rendering in IE
This fixes known browser bugs with rendering markup using `innerHTML` in IE ([[http://support.microsoft.com/kb/276228 | here is an example of one]]).

This is a subset of what `HTML` (and jQuery) does, and we should eventually consider pulling it out into a separate module to reduce code duplication. For now, this is the minimal set of changes needed to unbreak React in production.

We can afford to use a subset of what `HTML` does because we have the luxury of knowing that the markup is generated sanely with proper closing tags, etc.
2013-07-16 11:37:26 -07:00
Tim Yung
ed54fff204 Controlled <select> and <option> Components
This implements a `<select>` component that supports `value` and `defaultValue`. It also changes `<option>` to warn when the `selected` prop is supplied.
2013-07-16 11:37:04 -07:00
Jordan Walke
5d4f903482 [React Children] Step Three: New test case for traverseChildren.
If we're going to build utilities off of this, we should have good test
coverage.
2013-07-16 11:36:53 -07:00
Jordan Walke
946029c921 [React Children] Step Two: Use traverseChildren to perform mapChildren
Use the new `traverseChildren` utility to perform `mapChildren`.
The goal is to get as close to the bavior of the semantics of
`Array.prototype.map`, but also in a way that understands deeply nested arrays
and objects.
2013-07-16 11:36:11 -07:00
Jordan Walke
f4321f8624 [React Children] Step One: Refactor flattenChildren
Refactoring `flattenChildren` so that the traversal code is reusable
for other purposes.
2013-07-16 11:35:43 -07:00
Paul O’Shannessy
46d05b1191 Sync vendor modules from FB.
Biggest win here is that we'll strip out the console.error from
EventListener and we won't need to suggest people use a console
polyfill with the minified build.
2013-07-15 21:04:43 -07:00
Ben Newman
558e8ca312 Merge pull request #193 from benjamn/use-populist-for-testing
Fix tests
2013-07-15 16:42:57 -07:00
Ben Newman
b763d7d029 Use a separate grunt/config/jsx config file for tests.
No longer injecting __MOCK__ as a global constant (it's just a config
property now).

Turns out the `grunt jsx:debug` task was never necessary for tests.
2013-07-15 19:41:40 -04:00
Ben Newman
2d61639f90 Store dirtyMocks array globally so it can survive dumpCache().
When require("mock-modules").dumpCache() is called, all mock functions
previously created continue to refer to the old dirtyMocks array.

If we replace that array with a new one, those mock functions will never
have their .mockClear() methods called again.

The upstream version of mocks.js pulls a similar global trick, and I never
understood why until now.
2013-07-15 19:41:40 -04:00
Ben Newman
204796868d Enable module.exports mocking in react-test.js.
We don't currently attempt to mock modules automatically, but we do
respect require("mock-modules").mock, .dontMock, and .dumpCache.

I'm going to keep investigating auto-mocking, since that would move us
much closer to the behavior used within Facebook.

Closes #154.
Closes #155.
2013-07-15 19:41:40 -04:00
Ben Newman
37014e1002 Call require("mock-modules").register in every mockable module.
Mocking happens only when config.constants.__MOCK__ is true.
2013-07-15 18:10:49 -04:00
Ben Newman
c6c4657f83 Use populist v0.1.2 to bundle test modules instead of browserify.
This will allow full support for mocking, dumpCache, and correct line
numbers in error messages.
2013-07-15 18:10:49 -04:00
Ben Newman
f457394362 Remove remaining calls to ReactCompositeComponent.autoBind.
This is causing console.warning spew in the open source tests.
2013-07-15 15:09:01 -07:00
Tim Yung
2b97c608f8 Normalize DefaultDOMPropertyConfig
For consistency, use lowerCamelCase for all props in `DefaultDOMPropertyConfig`.
2013-07-15 15:08:46 -07:00
Paul O’Shannessy
15493530f1 Revert "Update LICENSE"
This reverts commit dd1d49b360.

The license is actually supposed to look like that. That section is
boilerplate for others to apply the license to their own work. See
immediately above...

> To apply the Apache License to your work, attach the following
> boilerplate notice, with the fields enclosed by brackets "[]"
> replaced with your own identifying information. (Don't include
> the brackets!)
2013-07-15 10:40:27 -07:00
Pete Hunt
dd1d49b360 Update LICENSE 2013-07-15 00:28:36 -07:00
petehunt
e9e8934577 fix markup bugs 2013-07-14 18:46:50 -07:00
petehunt
2397e35cdd switch to guides 2013-07-14 18:43:33 -07:00
petehunt
0e585d8102 put it all together 2013-07-14 18:42:39 -07:00
petehunt
6009934176 cleanup some files, move tutorial 2013-07-14 18:35:59 -07:00
petehunt
b20c2641d4 move docs around, add likebutton 2013-07-14 18:31:46 -07:00
petehunt
445a0dac37 tweak the source 2013-07-14 18:25:51 -07:00
petehunt
33abe80b59 scaling up fix 2013-07-14 18:00:17 -07:00
petehunt
d7cf1c509b delete old docs 2013-07-14 17:57:39 -07:00
petehunt
7d97f26870 add more examples 2013-07-14 17:52:25 -07:00
petehunt
b2107ba80b update and move tutorial 2013-07-14 17:49:07 -07:00
petehunt
d0c431a2a3 Fix comma 2013-07-14 17:15:28 -07:00
Pete Hunt
ab7ef4ed3b Update 08-working-with-your-environment.md 2013-07-14 17:07:58 -07:00
petehunt
204edb4a27 fix some links 2013-07-14 17:07:57 -07:00
Pete Hunt
3c742d50b6 Update 03-interactivity-and-dynamic-uis.md 2013-07-14 17:07:57 -07:00
Pete Hunt
1c51cc34cd Update 02.1-jsx-in-depth.md 2013-07-14 17:07:57 -07:00
Pete Hunt
64b9b55a0d Update 02.2-jsx-gotchas.md 2013-07-14 17:07:57 -07:00
Pete Hunt
f9741b0728 Update 01-motivation.md 2013-07-14 17:07:57 -07:00
petehunt
3085254a91 reorg 2013-07-14 17:07:57 -07:00
petehunt
0de35588c1 jsx gotchas, reference 2013-07-14 17:07:57 -07:00
petehunt
21ea1ac61e add working with your environment section 2013-07-14 17:07:57 -07:00
petehunt
4fccaa514b @vjeux comments 2013-07-14 17:07:57 -07:00
petehunt
13ad0c500b antipatterns 2013-07-14 17:07:57 -07:00
petehunt
126a7f5c11 more jsx handholding 2013-07-14 17:07:57 -07:00
petehunt
bb3bd76fe9 Reorg docs, write a lot of content, import a lot of stuff from dex 2013-07-14 17:07:57 -07:00
petehunt
4bbdcdb0b8 another comment 2013-07-14 17:07:57 -07:00
petehunt
d294a7f30f more scaling up 2013-07-14 17:07:57 -07:00
petehunt
de8d0e35a2 more state machiens 2013-07-14 17:07:57 -07:00
petehunt
faa84b5b85 further improvements 2013-07-14 17:07:57 -07:00
petehunt
e1e5f17b27 link to blog 2013-07-14 17:07:57 -07:00
petehunt
0e63000b5c even better toc 2013-07-14 17:07:57 -07:00
petehunt
151997b1e1 Start on section 04 2013-07-14 17:07:57 -07:00
petehunt
a36bcd33c6 more toc 2013-07-14 17:07:57 -07:00
petehunt
9194fea915 Add table of contents info 2013-07-14 17:07:57 -07:00
petehunt
67d9891926 add seconds 02.1 and 03 2013-07-14 17:07:56 -07:00
petehunt
05341fb3b3 Add more jsx docs rather than linking 2013-07-14 17:07:56 -07:00
petehunt
c82afd7e54 Some style changes 2013-07-14 17:07:56 -07:00
petehunt
ed98f2ca57 Make less facebooky 2013-07-14 17:07:56 -07:00
petehunt
462e450bb3 First two sections of newdocs 2013-07-14 17:07:56 -07:00
Paul O'Shannessy
06e5fcc010 "use strict" for ReactDoNotBindDeprecated 2013-07-12 15:42:46 -07:00
Paul O'Shannessy
ac84652e50 Cleanup console.* uses
* Stop doing `global.console && ...`
* Make sure all uses are behind `__DEV__` checks so they get stripped out
2013-07-12 15:42:25 -07:00
Tim Yung
eee3980749 Stringify value in ReactDOMInput / ChangeEventPlugin
This fixes two bugs related to string-casting in React:

 # Setting `<input value={0} />` would use an empty `value` because `0` is falsey.
 # Using `onChange` and `setState` with non-strings could lead to an infinite loop.

The latter is possible with controlled inputs when:

 - User changes input value.
 - `onpropertychange` fires.
 - `ChangeEventPlugin` dispatches `onChange`.
 - A handler responds via `this.setState` with a non-string value (e.g. a number).
 - The input re-renders and re-sets `value`.
 - The new `value` is not a string, but the current `value` (read from the element) is cast to a string automatically by the browser.
 - This triggers another `onpropertychange`.
 - `ChangeEventPlugin` dispatches another `onChange`.
 - ...
2013-07-12 15:40:55 -07:00
Paul O'Shannessy
cf83fbe397 Remove references to React.autoBind
Cleaned up a comment and removed a useless test.
2013-07-11 23:07:01 -07:00
Paul O’Shannessy
e221ff7cd4 Add exports to globals for jshint
This is a bit unfortunate, but it'll shut lint up for the time being. We
can't just change the modules to use `module.exports = { ... }` due to
how we handle circular dependencies internally (`ReactMount` require
`ReactID` and vice versa).
2013-07-11 17:20:21 -07:00
Paul O’Shannessy
607de16d82 New blog post: Props in v0.4 2013-07-11 15:52:29 -07:00
Paul O'Shannessy
d762627312 Rename props to propTypes
This does two things:

 - Rename `props` to `propTypes`.
 - Rename `ReactProps` to `ReactPropTypes` (and `React.Props` to `React.PropTypes`)
2013-07-10 15:06:18 -07:00
Tim Yung
10dab495f2 Stop Unnecessary Purging of Node Cache
When each component unmounts, it already cleans up its respective entry in the node cache. Let's stop blowing away the entire node cache unnecessarily.

This should improve performance because a React component's root will never need to be searched for more than once.
2013-07-10 15:05:18 -07:00
Tim Yung
ee1335b6a2 Delete setTextNodeValueAtIndexByParentID
This does not appear to be used anywhere.
2013-07-10 15:05:06 -07:00
Tim Yung
8687645c50 Reduce Lookup for Missing Lifecycle Methods
This is a micro-optimization that reduces the lookup time for missing lifecycle methods. The extra amount of memory is linear to the number of components that exist on a page which I think is a worthwile trade-off.
2013-07-10 15:04:44 -07:00
Tim Yung
7b68fcd408 Short-circuit updatePropertyByID
When `ReactNativeComponent` updates, it calls `updatePropertyByID` in `ReactDOMIDOperations` which calls `DOMPropertyOperations`. However, in `ReactDOMIDOperations`, we will lookup the node for an ID using `ReactID.getNode`. This wastes time looking for nodes when we may not need to ever update it (e.g. `children`).

This changes `ReactNativeComponent` to bail out sooner.
2013-07-10 15:04:23 -07:00
Pete Hunt
92dab0759c More autobind warnings and invariants
This adds two new warnings and one new invariant:

- Warn when using React.autoBind() that it is deprecated.
- Throw when calling bind() on an autobound method with the wrong value of "this". Today we'll silently ignore the provided value, which is confusing.
- Warn when calling bind() on an autobound method with the *right* value of "this" and no other arguments. This is already done for you by React.
2013-07-10 15:03:50 -07:00
Ben Newman
5c6e59f53c Don't ignore children of non-ancestor ID nodes in findComponentRoot. 2013-07-10 14:58:57 -07:00
Tim Yung
067fe27699 Fix Clowny Validation Code
ಠ_ಠ
2013-07-10 14:58:47 -07:00
Paul O’Shannessy
8db2ba9130 Upgrade other dependencies
Nothing groundbreaking. `semver` was likely already installed at 2.0.x
anyway (since >=) and `grunt-contrib-jshint` just gives us `jshint`
@ 2.1.3
2013-07-09 10:55:56 -07:00
Paul O’Shannessy
1500e9810c Upgrade browserify.
There are other changes I'm sure but the most important is that module
sorting results in deterministic builds.

The biggest win here comes for releases. Previously we had to jump
through hoops to make sure the files we put in bower were the same files
we put on the CDN, were the same files packaged in the Ruby gem, were
the same files we packaged into a zip file, were the same file we used
when create PRs to CDNJS. Rebuilding docs also resulted in conflicting
versions so we had to be careful when committing. This takes away all of
that pain. We can build from the same revision and get the same files.
2013-07-09 09:20:57 -07:00
Paul O’Shannessy
a3b21b10e4 Merge pull request #178 from paulshen/master
Add __benchmarks__ to .gitignore
2013-07-08 18:27:39 -07:00
Paul Shen
fa03e98426 Add __benchmarks__ to .gitignore 2013-07-08 16:40:21 -07:00
Paul O'Shannessy
203dba271b Add some missing attributes
Mostly this was to better support some HTML5 stuff. This was not a complete pass through though, and we should probably add more.
2013-07-08 13:58:42 -07:00
Paul O’Shannessy
91562ba934 Sync JSX tags from upstream
This is the other part of fc5f7e0e85. This
file isn't part of our sync process so needs to be done separately.
2013-07-08 12:51:11 -07:00
Paul O'Shannessy
fc5f7e0e85 Add support for missing html elements
We're missing a bunch of elements. So I scraped them from https://developer.mozilla.org/en-US/docs/Web/HTML/Element. Here's the script I used (run from Firefox scratchpad):

```
Array.prototype.slice.call(document.querySelectorAll('div.index.widgeted li'))
  .filter(function(li) {
    return !/deprecatedElement|obsoleteElement|nonStdElement/.test(li.firstChild.className)
  })
  .map(function(li) {
    // <tag> -> tag
    return li.querySelector('code').textContent.replace(/<(.+)>/,'$1');
  })
  .join(': false,\n  ');
```

I had to filter a couple more out (because there's some malformed content), but then it was simply merge with what we had and check to see if the new ones needed to omit the close tag.
2013-07-08 11:51:47 -07:00
Ben Newman
a4123a069e Continue over ID-less children in ReactMount.findComponentRoot.
This fixes our perf test by coping with edge cases like the
injection of `<tbody>` between `<table>` and `<tr>` nodes, which occurs
automatically in some browsers when we set `.innerHTML`.

Introducing more search branches would be risky if not for my previous
commit that made `findComponentRoot` breadth-first instead of depth-first.
2013-07-08 11:50:55 -07:00
Ben Newman
a5ddb07cb3 Make ReactMount.findComponentRoot breadth-first & non-recursive.
This function needs to be as fast as possible for those cases when
`ReactID.getNode` can't rely on the `nodeCache`.

Breadth-first search prevents us from diving too deeply down the wrong
branches when the sought-after node can be found at a shallower level.

The queue required for breadth-first search is implemented by a single
array indexed by `childIndex`. To save space, only the `.firstChild` nodes
are stored, and we use `.nextSibling` to iterate over the other siblings
in a `while` loop.
2013-07-08 11:50:34 -07:00
Ben Newman
917e101c2c Try harder to find container in ReactMount.findReactContainerForID.
When we render a new component into a container, we now record a reference to the rendered DOM node as `rootElementsByReactRootID[reactRootID]`, so that we can determine the actual container later on, in case `containersByReactRootID[reactRootID]` is no longer the true container.
2013-07-08 11:50:13 -07:00
Pete Hunt
5c624021ea Tweaks to make the Closure parser happy
This doesn't make it actually run with Closure, but passes its parser.
2013-07-08 11:50:02 -07:00
Pete Hunt
5676a486cf Allow nested ReactUpdates 2013-07-08 11:49:42 -07:00
Pete Hunt
1658feade8 Remove the check for console.warn
We already polyfill this at FB and we should recommend https://github.com/paulmillr/console-polyfill for open source.
2013-07-08 11:49:28 -07:00
Pete Hunt
5f1eceb1ee Merge pull request #176 from andreypopp/master
Add datetime to the list of known DOM attributes
2013-07-08 00:44:33 -07:00
Andrey Popp
fc3491e0d0 dateTime attr: camelCase and MUST_USE_ATTRIBUTE 2013-07-08 11:23:43 +04:00
Andrey Popp
9f94244994 add datetime to the list of known attributes
as per http://www.whatwg.org/specs/web-apps/current-work/multipage/text-level-semantics.html#attr-time-datetime
2013-07-08 00:09:38 +04:00
Pete Hunt
6ebdd0cfd2 Merge pull request #173 from chenglou/patch-4
Emphasis on single child.
2013-07-06 23:20:20 -07:00
Cheng Lou
858377946f Emphasis on single child. 2013-07-06 16:10:34 -04:00
Ben Newman
826d603b05 Merge pull request #167 from benjamn/issue-166-fix-phantomjs-executability
Ensure that the phantomjs binary has appropriate UNIX mode
2013-07-05 16:18:05 -07:00
Ben Newman
da4b761c45 Don't require tmp module unless we're going to use it. 2013-07-05 19:17:20 -04:00
Ben Newman
70a2f8046c Ensure that the phantomjs binary has appropriate UNIX mode.
The 755 mode corresponds to a UNIX mode string of -rwxr-xr-x.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

NOTE: Admittedly, this will not log anything in IE8. That's fine, since IE8 has shitty console logging anyway.
2013-06-28 16:34:27 -07:00
Paul O’Shannessy
bd150ec658 Clean up unused variables for lint 2013-06-28 16:34:19 -07:00
Paul O’Shannessy
ee21a604f3 Delete files that accidentally got merged in
ಠ_ಠ
2013-06-28 14:54:07 -07:00
yungsters
43358157cf Merge branch 'textarea-update-value' of git://github.com/spicyj/react
Conflicts:
	src/core/ReactDefaultInjection.js
2013-06-28 14:30:47 -07:00
Paul O’Shannessy
0b65d7555e Merge pull request #136 from jeffmo/empty_expressions
Add support for empty XJS expressions
2013-06-28 14:16:23 -07:00
CommitSyncScript
8bc2abd367 .reactRoot[base10] -> .r[base36]
Just a bit of byte savings for server rendering. Props to @benjamn for the base36 idea (and for making this diff easy).

With a little work we could probably get rid of the .r as well.
2013-06-28 13:48:08 -07:00
CommitSyncScript
6556881417 Throw on Missing Elements
This changes React to throw when `ReactID.getNode()` fails to find a node. This method is used by two call sites:

 - Implements `ReactComponent#getDOMNode`. This method already throws if a component is not mounted, and //all mounted components should be able to find their rendered root nodes//.
 - Used by `ReactDOMIDOperations`. These call sites aleady assume that `getNode` returns a non-null. Currently, if the node is not found, this is the site that fatals (and the stack trace is much harder to debug).

The error message should make it //a lot// easier to debug unexpected DOM trees. In particular, this will help track down all the places where the browser inserts `<tbody>` unexpectedly.
2013-06-28 13:47:31 -07:00
CommitSyncScript
c54900f63e Fix Composition Level of Components w/o Owners
This fixes a bug with components constructed with no owners, for example:

  // Both the <div> and <span> have no owners.
  React.renderComponent(<div><span /></div>, node);

They should have a composition level of 1 and their keys should be prefixed with 0 to indicate they were created without owners. However, they currently incorrectly get a composition level of 0 (which means that //their// children will have keys prefixed with 0, which is wrong).
2013-06-28 13:47:05 -07:00
JeffMo
9c35189ad1 Add support for empty XJS expressions 2013-06-28 13:10:20 -07:00
Ben Alpert
e998041229 Remove content property
Fixes #119.
2013-06-28 11:14:59 -07:00
Christopher Chedeau
431e1d5608 Merge pull request #135 from vjeux/bugbuster
Add link roundup
2013-06-28 09:36:45 -07:00
Vjeux
d4c7991aee Add link roundup 2013-06-28 18:35:52 +02:00
Christopher Chedeau
811df48756 Merge pull request #123 from vjeux/patch-2
Add @jsx common parser issues in the docs
2013-06-27 17:17:59 -07:00
CommitSyncScript
dbd9d99bcd Fix findComponentRoot w/ Unidentified Nodes
The current `ReactInstanceHandles` has a bug where `findComponentRoot` barfs if it comes across a node that was not identified by React (via `ReactID`). This fixes that.

This was always a bug, but it became more apparent once we switched to `data-reactid` because arbitrary `document.createElement`'d nodes are much more likely to have an `id` than they are to have a `data-reactid`.
2013-06-27 16:44:08 -07:00
Paul O’Shannessy
c032743b93 Bump version to 0.4.0a
This should have happened a while ago, but better late than never.
2013-06-27 13:30:09 -07:00
Christopher Chedeau
418c1fc427 Add @jsx common parser issues in the docs
Update getting-started.md
2013-06-27 22:27:54 +02:00
petehunt
fe30279ed0 Merge pull request #126 from vjeux/community_3
Community Roundup #3
2013-06-27 13:19:48 -07:00
Vjeux
b4f096364f Community Roundup #3 2013-06-27 22:18:26 +02:00
Paul O’Shannessy
9e6a581f68 Merge pull request #132 from petehunt/engines
Recommend Node v0.10.0 due to https://github.com/isaacs/npm/issues/2907
2013-06-27 13:14:28 -07:00
petehunt
f7e49f3b25 Recommend Node v0.10.0 due to https://github.com/isaacs/npm/issues/2907 2013-06-27 13:09:29 -07:00
Paul O’Shannessy
2fd5efd92b Merge pull request #128 from mathieumg/master
Double quotes for strings in JSON data
2013-06-26 15:52:44 -07:00
CommitSyncScript
67cf44e7c1 Change ReactID.ATTR_NAME to "data-reactid"
This final change is what we've all been waiting for.

Note that it no longer makes sense to use `document.getElementById` in
`getNode`, because that only ever worked with "id" attributes.
2013-06-26 14:31:50 -07:00
CommitSyncScript
9ceaff7318 Refactor of ChangeEventPlugin
some refactoring and also handle if `blur` doesn't fire on the form
input in IE8 (by always cleaning up on focus). per discussions with
@balpert
2013-06-26 14:31:33 -07:00
Mathieu M-Gosselin
703c825196 Changed JSON data in the tutorial to use double quotes for strings. 2013-06-26 16:24:51 -04:00
Ben Newman
86adcd6766 Merge pull request #124 from zpao/keep-compare-size-cache
The compare_size cache gets wiped out with `grunt clean`
2013-06-26 11:57:03 -07:00
CommitSyncScript
5a85c5e535 Don't pass a null context to Function.prototype.call.
This prevents PhantomJS tests from hanging in the open-source React repo.

Until the advent of `"use strict"`, passing `null` as the context object
to `.call` or `.apply` resulted in `this` taking on the value of the
global object inside the invoked function.

Technically the `"use strict"` directive is supposed to make it possible
that `this === null`, but strict mode is not respected by all browsers,
including (unfortunately) PhantomJS.

Since these `expect`-ations are just testing binding behavior, let's not
make them also test strict mode `this` handling.
2013-06-26 11:23:25 -07:00
CommitSyncScript
cf926338bf Fix onChange for File Input
Makes sure that `onChange` fires for file inputs.
2013-06-26 11:23:13 -07:00
CommitSyncScript
43930455de Cache Default Props
The `getDefaultProps` return value should not be dependent on any external data (including `this.props` and `this.state`), so the return value should be consistent everytime we call it.

This caches the return value so we do not do work and allocate memory unnecessarily.
2013-06-26 11:22:39 -07:00
Paul O’Shannessy
6f04bd9410 Merge pull request #112 from spicyj/check-dom-nodetype
Check that `container` is a valid DOM element
2013-06-25 14:22:21 -07:00
CommitSyncScript
59212a538e Remove deleted files again
These accidentally got re-added in a rebase
2013-06-25 14:15:35 -07:00
CommitSyncScript
a9b024330c Make @typechecks static-only 2013-06-25 14:01:15 -07:00
CommitSyncScript
d93761af62 Enforce nodeCache validity
A node is considered valid if it

  1. has the expected ID (more of a sanity check than something that is
     ever likely to go wrong), and

  2. is contained by a currently mounted container.

When these requirements are met, we can be confident that
`ReactMount.findReactRenderedDOMNodeSlow(node.id) === node`, which is
important for cache consistency because `findReactRenderedDOMNodeSlow` is
what we fall back to when we don't find a node in the cache.

Point 2 is a subtle requirement, because it allows nodes to be valid even
if they are not currently contained by a document. Rendering into a
detached node is okay, in other words (which is something that
`document.getElementById` never properly accounted for).

Containment testing takes linear time in the depth of the DOM, which
sounds unfortunate until you realize that virtually all browsers support a
native `ancestor.contains(descendant)` method, and in practice the vast
majority of nodes are either orphaned with `.parentNode === null` or not
very deep relative to their container.
2013-06-25 14:00:31 -07:00
CommitSyncScript
fb6381fb35 Upgrade TextChangeEventPlugin to ChangeEventPlugin and support more form elements
Upgrade `TextChangeEventPlugin` to be the `onChange` event that React
fires. In React, `onChange` will now fire when `input` fires for form elements in
modern browsers.

Handle this for:

  input[type=text]
  input[type=password]
  input[type=checkbox]
  input[type=radio]
  textarea
  select

Support:

- OSX Chrome
- OSX Safari
- OSX Firefox
- Win 7 / IE8
- Win 7 / IE9
- Win 7 / IE10

Everything works but caret selection / placement differs from browser to
browser.

For <select> elements, the event is fired with `change`. This is a
conscious decision, even though in some browsers (OSX firefox, IE), it
can be argued that the event should fire more due to how the UI looks.

Builds on https://github.com/facebook/react/pull/75, which handled only
text inputs.
2013-06-25 13:58:59 -07:00
CommitSyncScript
1d65f81b16 Remove ReactDOMNodeCache and getDOMNodeID.
These modules have been superseded by `ReactID`. Since they were only used
internally, and I have updated all client code that previously assumed
their existence, I believe they can be dropped for good.
2013-06-25 13:58:43 -07:00
CommitSyncScript
1c40dde782 Remove ReactID.primeTree in favor of priming in ReactID.getID.
Although it would have been nice to prime the entire tree and achieve a
cache hit rate of 100%, that cost would have to be paid up front, during
page rendering.

This patch avoids priming up front in favor of making the most of the work
done by `ReactMount.findReactRenderedDOMNodeSlow`, which calls
`ReactID.getID` while traversing the rendered DOM. The insight is this: if
`getID` simply primes the cache whenever it finds a new ID, then
`findReactRenderedDOMNodeSlow` will end up priming quite a few more nodes
that are actually involved in `ReactID.getNode` lookups, and we won't need
`primeTree` at all.
2013-06-25 13:57:54 -07:00
Ben Alpert
f6c4d2d161 Check that container is a valid DOM element 2013-06-25 10:54:28 -07:00
Paul O’Shannessy
b282a0f4f1 The compare_size cache gets wiped out with grunt clean
`.grunt/` is the directory that is suggested for storing task related
files, and this file is not useful if it gets wiped out often. So I'm
moving the compare_size cache into `.grunt/` so we keep it around
longer.
2013-06-24 21:35:00 -07:00
CommitSyncScript
c1886c6513 Use ReactID.ATTR_NAME as the React-specific ID attribute name.
Another step in the plan towards making `ReactID.ATTR_NAME` the central
source of truth regarding the React-specific ID attribute name.
2013-06-24 18:28:29 -07:00
CommitSyncScript
bd8ecc1caa Restore @spicyj's lifecycle tests
These got lost in a rebase.
2013-06-24 18:28:18 -07:00
CommitSyncScript
6bbcbc08cf Rename BrowserEnv to ViewportMetrics
Becuase that's what it is.
2013-06-24 18:28:16 -07:00
CommitSyncScript
f0a4ca5f69 Remove React.autoBind entirely 2013-06-24 18:28:12 -07:00
CommitSyncScript
de40842597 Use @return, not @returns 2013-06-24 16:16:46 -07:00
CommitSyncScript
76ec746341 Require Statement Nits 2013-06-24 16:16:38 -07:00
CommitSyncScript
14102e8a48 Fix isMounted() for composite components
This behavior seemed incorrect for composite components.

- isComponentMounted() represents ReactComponent's lifecycle of mounting
- isMounted() represents ReactCompositeComponent's lifecycle of isMounted()

Therefore, ReactComponents no longer have isMounted(). I think this is fine since it was not supposed to be public anyway.
2013-06-24 16:15:49 -07:00
CommitSyncScript
4f2d8dfe72 Dynamic Input Component
Summary:
This is a proposal based loosely on the discussions I've had with @paulshen and @jwalke. It implements a shim for `React.DOM.input` (used as `<input>`) that supports two different use cases depending on whether `value` is provided or not.

If a `value` is //not// provided, the input will be initialized with the empty string (or `defaultValue`) and anytime the user changes the input, the `onChange` (or `onTextChange`) handler will be fired and the DOM will reflect the new changes.

  React.renderComponent(
    <input type="text" defaultValue="Untitled" onTextChange={handleChange} />,
    container
  );

If a `value` is provided, the input will be initialized to that value. Anytime the user changes the input, the `onChange` (or `onTextChange`) handler will be fired. However, the DOM will //not// reflect the new changes. If a `value` is provided, it is the responsibility of the owner to update the `value` prop passed in.

  var value = "Untitled";
  var input = React.renderComponent(
    <input type="text" value={value} onTextChange={handleChange} />,
    container
  );
  function handleChange(event) {
    // Do something cool like strip out non-numbers.
    var value = event.target.value.replace(/\D/g, '');
    input.setProps({value: value});
  }

This is just a start and we should build similar components for `textarea` and `select`. Also, this does not inject the new components because the changes are not backward compatible. Once we change all `<input>` uses to use `ReactDOMInput`, then we can inject.
2013-06-24 16:13:14 -07:00
CommitSyncScript
7c60bb3e54 Add unit test to prevent regression
The original autobinding diff made some assumptions about how methods were called on components that had to be reverted. This diff
enforces those assumptions in a test
2013-06-24 16:12:06 -07:00
CommitSyncScript
a62686622b Clean up naming
Fix a small style nit
2013-06-24 16:11:55 -07:00
CommitSyncScript
a61f4df0b9 Fix a bunch of problems with implicit autobinding 2013-06-24 16:11:24 -07:00
CommitSyncScript
3266818b42 fix bad caching in ReactID.getID 2013-06-24 16:11:00 -07:00
CommitSyncScript
c9ecbaccb3 Use React.autoBind by default.
Per our discussion - this is the general approach we'd like to take for
the public facing API.

    var MyComponent = React.createClass({
      render: function() {
        return <div onClick={this.myCallback} />;
      },
      myCallback: function() {
      }
    });
2013-06-24 16:10:33 -07:00
Ben Newman
336a0facc1 Merge pull request #99 from petehunt/invariants
Remove second argument to invariant()
2013-06-24 15:38:22 -07:00
petehunt
7053f59ad1 Remove second argument to invariant() 2013-06-23 21:58:59 -07:00
CommitSyncScript
3373572e15 Use ReactID.{get,set}ID instead of manipulating .id property directly.
Another step in the plan to centralize control of React-specific identifers.
2013-06-21 16:08:07 -07:00
CommitSyncScript
1839bcf109 Replace uses of ReactDOMNodeCache and getDOMNodeID with ReactID.
Also removed some unnecessary calls to `document.getElementById`, which
will eventually cease to work for React-specific IDs.

This clears the way for the deprecation of `ReactDOMNodeCache` and
`getDOMNodeID`.
2013-06-21 16:07:51 -07:00
CommitSyncScript
191c0dec32 Consolidate ReactDOMNodeCache and getDOMNodeID into ReactID.
When we move away from using the "id" attribute to identify
React-generated elements, we will need the cache (formerly
ReactDOMNodeCache) to be tied much more closely to the code that looks
elements up by ID (getDOMNodeID) and sets element IDs, since the magic of
document.getElementById will no longer be available.

The priming functions are going to come in handy when we create new DOM
fragments in mountComponent.

For backwards compatibility, the ReactDOMNodeCache and getDOMNodeID
modules still exist, but they are implemented entirely in terms of
functions exported from ReactID.
2013-06-21 16:07:22 -07:00
CommitSyncScript
2bc2b52eaa Allow accessing siblings by ref
This makes it possible to write a wider range of components without
depending on internal implementations.
2013-06-21 16:02:57 -07:00
CommitSyncScript
36a724feca Add reactComponentExpect#toBeComponentOfType
This adds a `toBeComponentOfType` method to `reactComponentExpect`. Now that we are injecting composite native components, `toBeDOMComponentWithTag` will not suffice and should be deprecated.
2013-06-21 16:02:55 -07:00
Paul O’Shannessy
18352090e7 Blogpost & changelog for v0.3.3 2013-06-21 10:57:41 -07:00
Paul O’Shannessy
4c97ffee34 Bring in Facebook's requestAnimationFrame module 2013-06-20 16:51:21 -07:00
Ben Alpert
ac5320e887 Remove textContent tests; they break in phantomjs 2013-06-19 17:26:29 -07:00
Ben Newman
91b10bd37c Merge pull request #109 from zpao/esprima-dep-as-tarball
Use github tarball link for esprima dependency
2013-06-19 15:59:56 -07:00
petehunt
79a2734068 Merge pull request #113 from vjeux/community_2
Community Roundup #2
2013-06-19 12:19:40 -07:00
Vjeux
32030687ba Community Roundup #2 2013-06-19 21:18:28 +02:00
Paul O’Shannessy
cb01363260 Cleanup lint warnings 2013-06-19 11:06:04 -07:00
Ben Alpert
0493b27222 Don't update value or textContent unnecessarily
_updateDOMChildren was already updating textContent so we don't need to
do it in _updateDOMProperties. Additionally, don't update .value if
it'll be a noop because it has side-effects (like moving the cursor) in
some browsers (like IE 9).

Refactor tests to be a bit more robust and a bit cleaner too.
2013-06-18 23:31:15 -07:00
Ben Alpert
44d6b94752 Merge remote-tracking branch 'origin/master' into textarea-update-value 2013-06-18 23:31:08 -07:00
petehunt
a2bc7387e4 Merge pull request #110 from vjeux/patch-1
Fix dangerouslySetInnerHTML
2013-06-18 23:13:58 -07:00
Christopher Chedeau
ea5e13893e Fix dangerouslySetInnerHTML 2013-06-19 00:09:02 -06:00
Paul O’Shannessy
bd044fc919 Use github tarball link for esprima dependency
It turns out that (at least for local development) npm has a long
standing bug where it doesn't recognize changing dependencies stored as
git urls (see https://github.com/isaacs/npm/issues/1727). Luckily npm
understand tarballs and GitHub provides tarballs for every commit, so
the workaround is easy, though unfortunate.
2013-06-18 15:29:37 -07:00
Paul O’Shannessy
870a29d9b0 Use absolute URLs for FB comments box 2013-06-18 10:20:34 -07:00
CommitSyncScript
0e91febb9c Better warnings for missing keys on arrays
We have less dynamic arrays in the code base now so let's start warning for all
the cases where we pass dynamic arrays without keys.

I use the displayName to point out which component's render method was
responsible. I only warn once per component. If the child was created in a
different component (and passed as a property) I also show the owner of the
child. Maybe it should've attached the key at a higher level.

This does give false positives for arrays that are truly static. Those should
probably be refactored to use the XML syntax if possible.
2013-06-18 09:36:24 -07:00
CommitSyncScript
37ddfa0521 Don't transfer children in transferPropsTo
06cff60bc1 made it so that `this.props.children` was no longer set when
none were provided.

  var x = <div />;

This caused an issue if the code was relying on the following not
transferring children.

  return this.transferPropsTo(<div />);
  // this now transfer children
2013-06-18 09:32:23 -07:00
Paul O’Shannessy
5bd449c157 Ignore .module-cache directories 2013-06-17 17:14:14 -07:00
Paul O’Shannessy
b69d7f0d2a Merge pull request #107 from remixz/package-json-fix
Fix package.json's reference to vendor/constants.js
2013-06-17 16:31:24 -07:00
Zach Bruggeman
a0475b3c29 Fix package.json's reference to vendor/constants.js 2013-06-17 16:27:07 -07:00
CommitSyncScript
3156458041 Fix most lint warnings/errors 2013-06-17 16:26:56 -07:00
CommitSyncScript
48333acba6 Remove reactKeys
It wasn't being used and it wasn't conforming to the @providesModule === file name rule.
2013-06-17 16:26:45 -07:00
CommitSyncScript
4a0456fb8e Fix lint warning about mismatched file & module name
@providesModule should match the file name. In this case we'll be consistent and suffix mixins with Mixin.
2013-06-17 16:26:07 -07:00
petehunt
405be0f966 Merge pull request #106 from benjamn/rename-woodchipper
Rename Woodchipper to ConstantVisitor, and simplify the vendor/constants.js interface
2013-06-17 15:55:25 -07:00
Ben Newman
000928f9dc Use recast.parse and .print for require("vendor/constants").propagate.
This removes the need to pass a callback, which is a nice improvement.
2013-06-17 16:30:32 -04:00
Ben Newman
0f87e8ee87 Rename Woodchipper-related stuff.
No functional changes introduced by this commit.

Renamed:

    woodchipper.js -> constants.js
    Woodchipper -> ConstantVisitor
    debranch -> propagate
2013-06-17 16:21:51 -04:00
Paul O’Shannessy
2195a479a8 Merge pull request #105 from benjamn/fix-options.writeback-bug
Upgrade Recast to 0.4.8 to fix options.writeback bug
2013-06-17 13:07:43 -07:00
Ben Newman
2383fd8813 Upgrade Recast to 0.4.8 to fix options.writeback bug.
Bug introduced by: https://github.com/benjamn/recast/commit/e913b22f8f
Bug fixed by: https://github.com/benjamn/recast/commit/170e18091e
2013-06-17 15:57:33 -04:00
CommitSyncScript
d8b6d260c9 Add missing license header 2013-06-17 12:50:55 -07:00
CommitSyncScript
6a41ede2d4 Fixing known keying problems
This fixes the last known parts of the flattening experiment. This has grown to
be somewhat complex and potentially fragile because of it. We may end up
reverting flattening in the future or address it slightly differently.

The purpose of this diff is to test if we've finally understood the real world
edge cases that flattening can lead to and how we have to key components to
cover those cases.

With this commit we never rekey the internal _key property. The semantics is
that once a component passes through a composite component, it's identity is
frozen.

props.key should accept numeric values and booleans which includes 0 and false.
This fixes the truthiness check.

We should never warn about missing key properties if a component is passed as a
static child. The _key acts as a flag to determine whether this component
was checked already.
2013-06-17 12:50:29 -07:00
CommitSyncScript
c04081bc56 Add missing license header. 2013-06-17 12:50:15 -07:00
CommitSyncScript
0b1ecd8872 Add Back DOMCharacterDataModified
Accidentally lost `DOMCharacterDataModified`.
2013-06-17 12:49:58 -07:00
CommitSyncScript
88e90d5601 Use Synthetic Events
Swaps out usage of `AbstractEvent` with `SyntheticEvent` (and subclasses).
2013-06-17 12:49:45 -07:00
CommitSyncScript
03464dc148 Fix EventPluginRegistry Unit Tests in GitHub
Dumping the mock cache isn't dirying the modules in the open source version, so we have to unit test a different way. If we can fix the unit test framework, we should revert this.

Also, I added strict mode to `EventPluginRegistry.js`.

See: https://github.com/facebook/react/pull/91
2013-06-17 12:49:22 -07:00
CommitSyncScript
1112f1a003 React onlyChild utility.
Small utility that extracts and validates that there is only a single
child passed to a React composite component. The benefit here is that we
abstract away *how* the children are actually stored while we iterate on
different approaches. This way we won't break callsites as we try different
ideas. When we settle on a final approach, all of these callsites will still
work.
2013-06-17 12:48:47 -07:00
Paul O’Shannessy
c1576fcf97 Remove trailing whitespace 2013-06-17 12:48:43 -07:00
CommitSyncScript
8592eacbf9 Use Node Cache in ReactComponent
There are currently two places where we lookup and cache nodes: `ReactDOMNodeCache` and `ReactComponent`. Instead, we should just consolidate caches and make `ReactComponent` use `ReactDOMNodeCache`.
2013-06-17 12:48:26 -07:00
petehunt
888cb824d7 Merge pull request #103 from benjamn/fix-maxBuffer-exceeded
Use grunt.util.spawn for jsx:* tasks instead of exec
2013-06-17 11:10:07 -07:00
petehunt
061527df6c Merge pull request #102 from zpao/fix-transformer
Improve JSXTransformer
2013-06-17 11:08:35 -07:00
Ben Newman
96b0a0253f Use grunt.util.spawn for jsx:* tasks instead of exec.
This should prevent "Warning: stdout maxBuffer exceeded" errors.

Also piping child process stdout and stderr to the parent process, so
you can see more of what's happening during the build process.
2013-06-17 13:56:58 -04:00
Paul O’Shannessy
c79a59b599 Improve JSXTransformer
The biggest improvement is that we'll now insert each parsed JSX script
back into a `<script>` tag with the body set. This allows the browser to
execute these scripts normally. Using `Function(functionBody)` or
`eval(functionBody)` both execute in window scope, but `var` assignments
don't actually get set on window (unlike everywhere else).

I also did some cleanup to make the code a little bit more readable.
In my minimal test cases this didn't break anything (scripts loaded in
the right order).
2013-06-17 10:52:16 -07:00
petehunt
fad7d58fc9 Update jsx-is-not-html.md 2013-06-17 03:11:57 -06:00
petehunt
97efa84676 Merge pull request #88 from vjeux/jsx_pitfall
Adding JSX pitfalls section in the docs
2013-06-17 02:05:55 -07:00
petehunt
22347ea54d Merge pull request #95 from groodt/patch-1
Small correction to tutorial.md
2013-06-17 01:36:51 -07:00
petehunt
46513c6d78 Merge pull request #96 from groodt/master
Very minor corrections to documentation
2013-06-17 01:26:31 -07:00
petehunt
1c7d01c2f4 Merge pull request #97 from spicyj/patch-1
Link to my own blog instead of Quora
2013-06-17 01:25:31 -07:00
ngavalas
7a0f2d71bb Add callbacks to all public-facing state/props methods
All public facing {set,replace,force}{props,state} methods now support
callbacks.
2013-06-16 22:45:36 -07:00
Ben Alpert
4104beadbb Link to my own blog 2013-06-15 18:59:45 -06:00
Greg Roodt
87f4b8be67 Minor grammar. 2013-06-15 11:08:06 +03:00
Greg Roodt
8d729d7da2 Minor typo. 2013-06-15 11:07:20 +03:00
Greg Roodt
f016479289 Update tutorial.md
The ajax call happens every 5 seconds, not every 60 seconds.
2013-06-15 10:15:42 +03:00
ngavalas
c81cc2e6d5 markdown syntax
Small problem with markdown syntax in syntax-highlighted block.
2013-06-14 16:41:02 -07:00
ngavalas
f3aac85d01 Updated docs and check for truthiness
Change api docs to reflect presence of the new argument.  In addition,
callback was change to require only a "truthy" value.
2013-06-14 16:37:20 -07:00
ngavalas
c6665e3460 Adds optional callback to setState
This commit adds an optional callback as a second argument to
`setState`, to be called after `setState` runs.

We never guarantee synchronous execution of `setState`, and as per
@phunt, we don't want to make that guarantee because we may eventually
batch calls to `setState`.  @jwalke agrees with him.
2013-06-14 16:23:06 -07:00
Timothy Yung
c7295b9e09 Merge pull request #61 from spicyj/getdomnodeid
getDOMNodeID: Don't return .id on random objects
2013-06-14 11:27:44 -07:00
Ben Newman
9fd9f712bf Merge pull request #91 from yungsters/master
Fix `EventPluginRegistry` Unit Tests
2013-06-14 06:45:57 -07:00
Ben Alpert
a9c70bcc1c getDOMNodeID: Don't return .id on random objects
If you defined a global named `id` (a horrible name, I know) then
getDOMNodeID(window) would return that object. Since only DOM nodes can
have IDs, this should be a noop change otherwise.

Test Plan:
Verified that document.documentElement and document.body both support
getAttributeNode properly in latest Chrome and in IE8.
2013-06-14 00:21:15 -07:00
Timothy Yung
80edd6ca87 Merge pull request #89 from vjeux/patch-4
Exposing ReactProps as React.Props
2013-06-13 21:08:10 -07:00
Timothy Yung
48f46b568d Merge pull request #92 from spicyj/fix-textchange
Fix textchange event enqueueing
2013-06-13 20:53:47 -07:00
yungsters
279792f891 Fix EventPluginRegistry Unit Tests
Dumping the mock cache isn't dirying the modules, so we have to unit test a different way. If we can fix our unit test framework, we should revert this.

Also, I added strict mode to `EventPluginRegistry.js`.
2013-06-13 20:38:23 -07:00
Ben Alpert
792b69ba11 Fix textchange event enqueueing
(Was broken by e1535fbd71d8c89c82cd9d9073c1ee97ee6a3b00.)
2013-06-13 20:34:14 -07:00
Paul O’Shannessy
06cff60bc1 Sync latest JSX transform - all children passed as separate arguments
This was a part of e1fe13d0cb upstream.
2013-06-13 18:18:54 -07:00
CommitSyncScript
770ec5946a Unbreaking falsy check on style values
Style values can be the number zero which is an actual value. So we check for
null instead. The empty string case falls through.
2013-06-13 17:49:04 -07:00
CommitSyncScript
b525a0c061 Unnecessary this._rootNodeID Invariant
Summary: This invariant is unnecessary because `ReactComponent.Mixin.receiveProps` already asserts that this component is mounted. (Being mounted guarantees you have a DOM ID, look at `ReactComponent` and see when `this._rootNodeID` is mutated.)
2013-06-13 17:48:09 -07:00
CommitSyncScript
34970fd785 Fix tht typos 2013-06-13 17:47:59 -07:00
Paul O’Shannessy
ceb5303581 Merge pull 75 upstream
Needed to make some small changes since we weren't synced when it was
merged.
2013-06-13 17:47:51 -07:00
CommitSyncScript
f456f8fa8d Remove isStatic
This can be replicated with a custom component that always returns false`
from `shouldComponentUpdate`. A generic implementation might look like:

```
var StaticContainer = React.createClass({
  shouldComponentUpdate: function() {
    return false;
  },

  render: function() {
    return this.transferPropsTo(this.props.children[0]);
  }
});
```

And then used in JSX as
`<StaticContainer><div>Hello!</div></StaticContainer>`, resulting in
only `<div>Hello!</div>` being inserted into the DOM.
2013-06-13 17:40:52 -07:00
CommitSyncScript
e1fe13d0cb Pass multiple children in JSX as additional arguments
This is an alternative to D809298. In normal usage you'd end up with a single
flat array in props.children.
2013-06-13 17:40:05 -07:00
CommitSyncScript
01511ea557 Remove Unnecessary DOM Mutations
This fixes an edge case that can cause unnecessary mutations in the DOM. Namely, if a prop is falsey, it will get touched on every update by reconciliation. See unit test.
2013-06-13 17:39:47 -07:00
CommitSyncScript
802241a660 Cleanup style Prop Reconciliation
This cleans up the reconcilation path when adding a `style` prop (going from a falsey or no `style` to having one) by reducing the need for an object allocation and for-loop.
2013-06-13 17:39:23 -07:00
CommitSyncScript
e1535fbd71 Create EventPluginRegistry
The `EventPluginHub` module was getting huge and scary. This pulls out all of the logic required to inject plugins and publish their event registration names into a new `EventPluginRegistry` module.

Functionally, nothing should have changed. I added many error checks to cover edge cases that we were not yet running into, but they are all in `EventPluginRegistry` and unit tested.
2013-06-13 17:38:49 -07:00
CommitSyncScript
aea8e16b4a Add ReactComponent#isMounted
There is currently no way for components to know whether or not they are mounted. This means there's no way for callbacks to figure out if they can make certain assumptions (e.g. can `getDOMNode()` or `setState()` be safely invoked).

This adds an `isMounted` protected method that lets components properly handle callback behavior when unmounted.
2013-06-13 17:38:20 -07:00
CommitSyncScript
0d6bb650cb Add HTML5 Drag/Drop events to React 2013-06-13 17:37:58 -07:00
Ben Alpert
ddc4ffffa0 Don't let textarea value change via textContent
Turns out my tests before weren't particularly useful because
receiveProps doesn't end up running componentDidUpdate since the
transaction never finishes. Now they use replaceProps instead (and I
verified that commenting out the "rootNode.value = ..." line makes the
tests fail, which wasn't true before).
2013-06-12 19:12:52 -07:00
Vjeux
d7a5f137ff Adding JSX pitfalls section in the docs 2013-06-13 03:08:50 +02:00
Christopher Chedeau
34173638d4 Exposing ReactProps as React.Props
Right now, even though ReactProps is committed, there is no way to use it as it is not exposed.
2013-06-12 18:28:25 -06:00
Timothy Yung
c9618587ef Merge pull request #67 from vjeux/fb_comments
Facebook comments integration on Docs and Blog
2013-06-12 16:13:05 -07:00
Vjeux
101bfa3112 Facebook comments integration on Docs and Blog 2013-06-13 01:08:31 +02:00
Vjeux
523bde4dc5 Community round-up blog post 2013-06-12 13:55:51 -07:00
Jordan W
483350905b Merge pull request #86 from petehunt/fixed-width-height
Fixed width/height on React logo
2013-06-12 12:35:33 -07:00
petehunt
5b72334852 Fixed width/height on React logo 2013-06-12 12:33:38 -07:00
Ben Alpert
d13a37ce22 Don't set value if it'll be a noop 2013-06-12 01:55:26 -07:00
Ben Alpert
0c6f4b3bcc Set textarea value when changing content
At http://jsfiddle.net/spicyj/W4QLq/, typing into the textbox would cause
clicking the button to do nothing; now it should work.
2013-06-12 00:14:58 -07:00
Timothy Yung
0e6fca4a38 Merge pull request #68 from vjeux/twitter
Integrate twitter in the support page
2013-06-11 22:34:44 -07:00
Timothy Yung
dfd76be568 Merge pull request #75 from spicyj/textchange
Add new textChange event: input + IE shim
2013-06-11 22:00:19 -07:00
Ben Alpert
0dc08c2115 Missing semicolon 2013-06-11 21:54:50 -07:00
Ben Alpert
6b572b3f25 Refactor based on review feedback 2013-06-11 21:51:47 -07:00
Timothy Yung
c6c40a5fb3 Merge pull request #84 from spicyj/remove-props
Correctly remove attributes when deleting props
2013-06-11 19:54:36 -07:00
Ben Alpert
fdc6beed1a Fix nit and comment 2013-06-11 19:53:24 -07:00
Ben Alpert
731aa8ead1 internalPropNames isn't necessary, so remove it
Perhaps we'll bring it back as a future perf optimization if that
appears useful.
2013-06-11 19:02:35 -07:00
Ben Alpert
8762634cf1 Remove unused require 2013-06-11 17:28:06 -07:00
Ben Alpert
735a91c9d5 Fix relative require copy pasta 2013-06-11 17:24:35 -07:00
Ben Alpert
705ce56694 Correctly remove attributes when deleting props
The most obvious manifestation of this bug is visible here:
http://jsfiddle.net/spicyj/zzGas/. In short, when props are removed from a
component, the underlying HTML element doesn't have the attribute
removed.

This change should fix it, but unfortunately it (presumably) makes
_updateDOMProperties a bit slower.
2013-06-11 16:46:10 -07:00
petehunt
94fdf2cf5d Merge pull request #81 from benjamn/issue-80-commoner-no-longer-rewrites-require
Upgrade Commoner and Recast to latest versions
2013-06-11 16:22:17 -07:00
Paul O’Shannessy
758c21fb9c Merge pull request #77 from spicyj/componentdidmount-order
Run inner componentDidMount method first
2013-06-11 13:10:03 -07:00
Ben Newman
15360056bd Upgrade Commoner and Recast to latest versions.
The Commoner upgrade is a big one because it makes bin/jsx no longer
rewrite module identifiers to be relative by default, which should
reduce confusion for people trying to use it as a standalone
transformer.

Closes #80.
2013-06-11 15:24:50 -04:00
Ben Alpert
932c45a7ab Check canUseDOM before calling isEventSupported 2013-06-10 18:27:22 -07:00
Ben Alpert
e39743f2f8 Removed unused variable 2013-06-10 17:19:45 -07:00
Paul O’Shannessy
cff4d53a9e Add missing license headers 2013-06-10 16:25:37 -07:00
CommitSyncScript
c2ce1d00cd Fix Event Normalization in IE<9
IE<9 relied on the `target` property being overriden. This adds back a hack that only applies in IE<9. I'll be able to revert this hack once I check in synthetic events.
2013-06-10 16:19:25 -07:00
CommitSyncScript
b3e0dc47a8 Rename "Delegate" to "Synthetic"
This is just a simple rename of the event classes to `SyntheticEvent`. I've also updated the constructor arguments to be more correct:

 - `dispatchConfig`: Data used by the plugin system for dispatching the event, for example: `{registrationName: 'onClick'}`
 - `dispatchMarker`: An identifying marker used to describe where the event is occuring, for example: `.reactRoot[0]`
2013-06-10 16:19:03 -07:00
CommitSyncScript
93f979ae18 Use isAncestorIDOf in ReactInstanceHandles
This is both a functional fix and performance fix for `ReactInstanceHandles`.

 - `getFirstReactDOM` uses `indexOf` but should be checking ancestry (via `isMarker()`).
 - Added `isAncestorIDOf`, checking ancestry can be way faster than getting a common ancestor: http://jsperf.com/react-ancestor-id-check
2013-06-10 16:18:40 -07:00
CommitSyncScript
ca3f871646 Reduce ReactInstanceHandles API Surface Area
Change `ReactInstanceHandles` so that `getFirstCommonAncestorID` and `nextDescendantID` are now private (and documented to be only exposed for unit testing). Also:

 - Renamed `nextDescendantID` to `getNextDescendantID`.
 - Renamed `parentID` to `getParentID`.

I also organized `ReactInstanceHandles-test` by method names.

Functionally, this diff should not change anything.
2013-06-10 16:18:13 -07:00
CommitSyncScript
1be6c592a6 Fix typechecks for isRenderedByReact() 2013-06-10 16:17:52 -07:00
CommitSyncScript
37cde3d864 Stabilize minimal server rendering API
This is a pretty killer feature and the API is simple. I know it's another API method on React, but I think it's
the only way.
2013-06-10 16:17:26 -07:00
Ben Alpert
2afd7186ae Run inner componentDidMount method first
Fixes #76.
2013-06-09 17:21:22 -07:00
Ben Alpert
c19bf9cffe Add new textChange event: input + IE shim
IE8 doesn't support oninput and IE9 supports it badly but we can do
almost a perfect shim by listening to a handful of different events
(focus, blur, propertychange, selectionchange, keyup, keydown).

This always triggers event handlers during the browser's event loop (not
later in a setTimeout) and after the value property has been updated.

The only case I know of where this doesn't fire the event immediately is
if (in IE8) you modify the input value using JS and then the user does a
key repeat, in which case we fire the event on the second keydown.

Test Plan:
Modify ballmer-peak example to add es5-shim and to use onTextChange
instead of onInput. In IE8, IE9, and latest Chrome, make sure that the
event is fired upon:

* typing normally,
* backspacing,
* forward-deleting,
* cutting,
* pasting,
* context-menu deleting,
* dragging text to reorder characters.

After modifying the example to change .value, make sure that the event
is not fired as a result of the changes from JS (even when the input box
is focused).
2013-06-09 04:18:15 -07:00
CommitSyncScript
7e7579e1ba Assign the same keys if it's a single nested array or not
If you specify a single array, we didn't prefix the keys with 0.

If you later add children, the first array won't have the same key.
2013-06-07 22:10:20 -07:00
CommitSyncScript
582359aeea Remove React.createComponentRenderer
Remove ReactMount.createComponentRenderer because it does not function
correctly.

  var f = React.createComponentRenderer(<div />);

  var container1 = document.createElement('div');
  var container2 = document.createElement('div');
  f(container1);
  f(container2); // error because mounting same instance into new root
2013-06-07 22:10:06 -07:00
CommitSyncScript
6c3c643c8e Fix typo in OrderedMap
Unique was spelled wrong. This fixes it.
2013-06-07 22:09:49 -07:00
CommitSyncScript
3eaed5a122 Delegate Event Classes
React's top-level event delegation dispatches `AbstractEvent` objects that contain:

 - `nativeEvent`, the original browser event.
 - `data`, an object with custom normalized properties.

This diff creates a set of `DelegateEvent` classes that will replace `AbstractEvent`. The goal is two-fold:

 # Provide a cross-browser implementation that conforms to the DOM Level 3 Events API so people don't have to use `nativeEvent`.
 # Generalize the event object API so that it can be shared by `DOMEventManager`, a top-level event delegation WIP.

This simply implements the classes. I will follow-up by replacing `AbstractEvent` with them.
2013-06-07 22:08:32 -07:00
CommitSyncScript
4bb966a7f0 Bugfixes to key assignment
Type coersion bug and ID breaking assumption.

Names need to be wrapped in something unique since otherwise two unique siblings
can end up having IDs that are subsets of eachother.
2013-06-07 22:08:14 -07:00
CommitSyncScript
0e9e64c550 Replace persistentCloneOf with persist
There are to reasons to prefer a `persist` method on the event rather than a static method:

 - In open source, people do not have access to `AbstractEvent`.
 - This will allow people to persist events without requiring another module.
 - This will make refactors easier and more flexible.
2013-06-07 22:07:43 -07:00
Jeffrey Lin
c5998fb483 Merge pull request #72 from benjamn/module-cache
Cache modules for jsx grunt tasks in react-tools/.module-cache
2013-06-07 18:11:05 -07:00
Ben Newman
880ada0a1c Cache modules for jsx grunt tasks in react-tools/.module-cache.
As of Commoner v0.6.11, the default is to put the cache files in
output/.module-cache, which used to be build/modules/.module-cache
before this commit. That still happens when you run bin/jsx directly,
just not for grunt tasks anymore.

The module cache needs to be cleared much less often than
build/modules, so it doesn't make sense to throw away all that work.
2013-06-07 18:02:43 -04:00
Jordan W
a5e5f53494 Merge pull request #69 from jordow/SimplifyExample
Make todo example shorter and not rely on the DOM.
2013-06-07 13:16:17 -07:00
jordow
81f3a5c6cd Make todo example shorter and not rely on the DOM. 2013-06-07 13:11:40 -07:00
Paul O’Shannessy
59bee8df21 Remove clowny diff.diff
An artifact of our sync process.
2013-06-06 15:09:11 -07:00
Paul O’Shannessy
796837b8c7 Merge pull request #66 from zpao/sync-latest
Sync latest from Facebook
2013-06-06 15:03:09 -07:00
CommitSyncScript
2dc24fc234 Add typecheck, cleanup
Followup with some additional comments for https://github.com/facebook/react/pull/58
2013-06-06 14:50:54 -07:00
CommitSyncScript
88923f61a7 Improve Browser Support for wheel Event
This improved browser support for the `wheel` event.

 - Try to use `wheel` event (DOM Level 3 Specification).
 - Fallback to `mousewheel` event.
 - Fallback to `DOMMouseWheel` (older Firefox).

Also, since `wheel` is the standard event name, let's use that in React.

NOTE: The tricky part was detecting if `wheel` is supported for IE9+ because `onwheel` does not exist.

Test Plan:
Execute the following in the console on a page with React:

  var React = require('React');
  React.renderComponent(React.DOM.div({
    style: {
      width: 10000,
      height: 10000
    },
    onWheel: function() {
      console.log('wheel');
    }
  }, null), document.body);

Verified that mousewheel events are logged to the console.
Verified in IE8-10, Firefox, Chrome, and Safari.
2013-06-06 14:48:25 -07:00
CommitSyncScript
ba6fea1bf5 Simplify Event Core
Summary:
This makes a few changes to React Core, most notably `ReactEventEmitter` and `ReactEventTopLevelCallback`.

 - Changed `ReactEventEmitter` to use `EventListener` (instead of `NormalizedEventListener`).
 - Deleted `NormalizedEventListener` (which was previously broken).
 - Created `getEventTarget` which is used to get a normalized `target` from a native event.
 - Changed `ReactEventTopLevelCallback` to use `getEventTarget`.
 - Renamed `abstractEventType` to `reactEventType` in `AbstractEvent`.
 - Reanmed `abstractTargetID` to `reactTargetID` in `AbstractEvent`.
 - Removed `originatingTopLevelEventType` from `AbstractEvent` (unused and violates encapsulation).
 - Removed `nativeEvent.target === window` check when refreshing authoritative scroll values (unnecessary).

This actually fixes React because `NormalizedEventListener` does not currently do what it promises to do (which is normalizing `target` on the native event). The `target` event is read-only on native events.

This also revises documentation and adds `@typechecks` to a few modules.

NOTE: Most importantly, this sets the stage for replacing `AbstractEvent` with `ReactEvent` and subclasses, piecemeal.
2013-06-06 14:48:12 -07:00
CommitSyncScript
36d8ce8fab [React] remove deprecated Component.update()
Summary: Since grepping for `update` and `updateAll` is pretty hard, I had these these functions call through but complain loudly. This noisy call through has been in prod for over a week and I haven't heard any complains, so let's take it out altogether.
2013-06-06 14:46:53 -07:00
CommitSyncScript
153fd9246e [React] Don't use autoMockOff 2013-06-06 14:29:45 -07:00
CommitSyncScript
fac24d462f React: Add @typechecks to CallbackRegistry 2013-06-06 14:29:45 -07:00
Paul O’Shannessy
83101b878e Add license headers to new files 2013-06-06 14:29:45 -07:00
CommitSyncScript
9d1055b3d2 Rename ReactEvent to ReactEventEmitter
ReactEvent should be reserved for the actual object created when an
event fires. The current ReactEvent is more like EventEmitter than
anything (e.g. it sets up delegation, provides methods to attach and
remove listeners).
2013-06-06 14:29:45 -07:00
CommitSyncScript
0614d30654 Move test utils internally, update for consistency 2013-06-06 14:29:44 -07:00
CommitSyncScript
9965b6b9dd Fix Listener Cleanup on Unmount
We need to make sure that deleteAllListeners() is invoked before we call
the superclass's unmountComponent() method or else we will lose
this._rootNodeID.

I also added an invariant and unit test to make sure we do not break
this in the future.
2013-06-06 14:29:44 -07:00
CommitSyncScript
a06de4bc4f Cleanup ReactCurrentOwner on Fatal
If a React component's render() fatals, it may contaminate
ReactCurrentOwner. This will cause the owner to be set improperly for
the next React.renderComponent() invocation (which causes an owner to be
set when there shouldn't be one).
2013-06-06 14:29:44 -07:00
CommitSyncScript
11a7cb5b73 Only Allow forceUpdate on Mounted Components 2013-06-06 14:29:44 -07:00
CommitSyncScript
bae6100ae8 Make ReactIdentity-test less fragile with respect to root IDs. 2013-06-06 14:29:44 -07:00
CommitSyncScript
3ffbb4d096 Re-add invariant
Bring back the invariant() that disallows setProps() and replaceProps()
on owned components.
2013-06-06 14:29:44 -07:00
CommitSyncScript
ca5d7bc683 Add getDefaultProps()
As it turns out, default values are very useful. This implements
getDefaultProps(), a hook for components to provide prop values when
a prop is not specified by the user.
2013-06-06 14:29:44 -07:00
CommitSyncScript
1457850b72 Rename domUtils to dom 2013-06-06 14:29:44 -07:00
CommitSyncScript
100af48f53 Support rendering different components into same node
var container = ...; // some DOM node
React.renderComponent(<div />, container);
React.renderComponent(<span />, container);

This should replace the rendered <div> with a <span>, effectively
reconciling at the root level.
2013-06-06 14:29:44 -07:00
CommitSyncScript
3e211bf662 [React] Removing invariant warning about updating owner state
It seems like it's possible to render a component that ends up having an
owner. Because you can end up rendering inside a render somehow.
2013-06-06 14:29:44 -07:00
CommitSyncScript
606d6b8fd4 Revert Object.create in NormalizedEventListener
It seems that the use of Object.create (to comply with strict mode) in
NormalizedEventListener is not happy in IE8.
2013-06-06 14:29:44 -07:00
CommitSyncScript
b581c8cfc7 Always reassign _key for every pass
Currently we're mutating _key. Mutation here is fine, but it needs to
be idempotent - which it's not. This is causing some issues.

Instead I reassign the _key every time it passes through a flattening.
This means that it's unique and stable for a single pass through a composite
component. When it's repassed another level, it loses it previous
identity and is rekeyed by it's new location.

For auto-generated keys by index, this actually means it has the same
semantics as before flattening.

For explicit keys, it has the effect that keys need to be unique at
every level. Regardless of how the key got there. Every component needs to ensure
that it doesn't combine keys from two different sources that may collide. This
is also inline with the old semantics but less intuitive in the new model.
2013-06-06 14:29:44 -07:00
CommitSyncScript
54d3134da2 Add ReactProps.func
This adds ReactProps.func so people don't need to write the
slightly-more-cryptic ReactProps.instanceOf(Function). We should have
had this all along.
2013-06-06 14:29:44 -07:00
CommitSyncScript
259392035d mapChildren
mapChilden() is similar to Array.map() and objMap() but handles deep
nested structures and follows similar rules to flattenChildren()
2013-06-06 14:29:44 -07:00
CommitSyncScript
4b81de93d3 use key="foo" for all components
flattenChildren was only using key when child.mountInContainerNode
exists, which is defined on ReactCompositeComponent, and not
ReactNativeComponent.

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

Codez:

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

Before:

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

After:

    <div></div>

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

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

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

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

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

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

This doesn't actually update the JSX transform.
2013-06-06 14:29:43 -07:00
Vjeux
0435216eb6 Using markdown instead of html 2013-06-06 08:40:24 +02:00
Vjeux
7061d2b25b Integrate twitter in the support page 2013-06-06 08:38:09 +02:00
Paul O’Shannessy
31cdb4c8a7 Merge pull request #58 from spicyj/unmount-nothrow
Make unmountAndReleaseReactRootNode not throw
2013-06-05 15:00:00 -07:00
Paul O’Shannessy
1e76d84569 Merge pull request #32 from spicyj/input
Add new onInput event
2013-06-05 14:57:25 -07:00
Ben Alpert
6012e94e50 Make unmountAndReleaseReactRootNode not throw
When there isn't any React node in the DOM, unmountAndReleaseReactRootNode
threw an exception because component was undefined. Instead, return whether we
were able to unmount the component.
2013-06-04 14:36:16 -07:00
Ben Alpert
35306fa7f5 Revert "Simulate input event" for now
This reverts commit 580e8f0dbb.
2013-06-04 01:29:12 -07:00
Ben Alpert
580e8f0dbb Simulate input event instead of relying on native
Test Plan:
With the ballmer-peak example (modified to use input), tested that the
percentage updates when adding or deleting text in the field on Chrome
and IE9. After adding es5-shim and es5-sham to the ballmer-peak page,
IE8 works properly too.
2013-06-01 16:55:19 -07:00
Ben Alpert
2467c0e651 Update examples to use onInput instead of onKeyUp
onInput has the advantage that it responds to repeated key events before
onKeyUp and is called when modifying the input without the keyboard
(such as pasting with the mouse).

Test Plan:
Opened the ballmer-peak example and docs homepage in Chrome and checked
that both examples update whenever the text is changed.
2013-05-30 18:20:34 -07:00
Ben Alpert
292dd238e7 Add new onInput event
'input' is supported in IE9+ and all other browsers according to
https://developer.mozilla.org/en-US/docs/Web/API/window.oninput

Test Plan:
Modified ballmer-peak example to use onInput instead of onKeyUp and
tested that it works properly on latest Chrome.
2013-05-30 18:20:34 -07:00
860 changed files with 61909 additions and 21554 deletions

View File

@@ -2,11 +2,16 @@
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
max_line_length = 80
trim_trailing_whitespace = true
[*.md]
max_line_length = 0
trim_trailing_whitespace = false
[COMMIT_EDITMSG]
max_line_length = 0

19
.eslintignore Normal file
View File

@@ -0,0 +1,19 @@
# 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/
# This should be more like examples/**/thirdparty/** but
# we should fix https://github.com/facebook/esprima/pull/85 first
examples/

51
.eslintrc Normal file
View File

@@ -0,0 +1,51 @@
---
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

1
.gitattributes vendored Normal file
View File

@@ -0,0 +1 @@
* text=auto

14
.gitignore vendored
View File

@@ -5,18 +5,16 @@ node_modules
static
.grunt
_SpecRunner.html
__benchmarks__
build/
.module-cache
*.gem
docs/code
docs/_site
docs/.sass-cache
docs/css/react.css
docs/js/JSXTransformer.js
docs/js/react.min.js
docs/js/docs.js
docs/js/jsx-compiler.js
docs/js/live_editor.js
docs/js/examples
docs/js/*
docs/downloads
examples/shared/*.js
test/the-files-to-test.generated.js
*.log*
chrome-user-data

View File

@@ -1,20 +0,0 @@
{
"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,
"regexdash": true,
"trailing": true,
"undef": true,
"unused": "vars"
}

68
.mailmap Normal file
View File

@@ -0,0 +1,68 @@
Andres Suarez <zertosh@gmail.com>
Ben Alpert <ben@benalpert.com> <spicyjalapeno@gmail.com>
Ben Alpert <ben@benalpert.com> <balpert@fb.com>
Ben Newman <bn@cs.stanford.edu> <benjamn@fb.com>
Bill Fisher <fisherwebdev@gmail.com>
Cheng Lou <chenglou92@gmail.com> <chenglou@fb.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>
Dan Schafer <dschafer@fb.com>
Daniel Gasienica <daniel@gasienica.ch> <daniel@fiftythree.com>
Daniel Gasienica <daniel@gasienica.ch> <dgasienica@zynga.com>
Daniel Lo Nigro <daniel@dan.cx> <danlo@fb.com>
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>
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>
Ingvar Stepanyan <me@rreverser.com> <rreverser@ubuntu.rreverser.a4.internal.cloudapp.net>
Irae Carvalho <irae@irae.pro.br>
Ivan Vergiliev <ivan.vergiliev@gmail.com>
Jaime Mingo <j.mingov@3boll.com>
James Brantly <james@jbrantly.com>
Jan Hancic <jan.hancic@gmail.com> <jan.hancic@caplin.com>
Jan Kassens <jan@kassens.net> <jkassens@fb.com>
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>
Jeffrey Lin <lin.jeffrey@gmail.com> <jeffreylin@fb.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>
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>
Michal Srb <xixixao@seznam.cz> xixixao <xixixao@seznam.cz>
Nick Gavalas <njg57@cornell.edu>
Nick Thompson <ncthom91@gmail.com> <nickt@instagram.com>
Paul OShannessy <paul@oshannessy.com> <poshannessy@fb.com>
Paul Shen <paul@mnml0.com> <paulshen@fb.com>
Pete Hunt <floydophone@gmail.com>
Pete Hunt <floydophone@gmail.com> <pete.hunt@fb.com>
Pete Hunt <floydophone@gmail.com> <pete@instagram.com>
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>
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>
Sebastian Markbåge <sebastian@calyptus.eu> <sema@fb.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>
Zach Bruggeman <mail@bruggie.com> <zbruggeman@me.com>

View File

@@ -1,3 +1,71 @@
---
language: node_js
node_js:
- "0.10"
- '0.10'
sudo: false
cache:
directories:
- node_modules
before_install:
- |
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
}
script:
- |
grunt $TEST_TYPE
after_script:
- |
if [ "$TEST_TYPE" = test ] && [ "$SERVER" ]; then
grunt build
curl \
-F "react=@build/react.js" \
-F "react.min=@build/react.min.js" \
-F "transformer=@build/JSXTransformer.js" \
-F "react-with-addons=@build/react-with-addons.js" \
-F "react-with-addons.min=@build/react-with-addons.min.js" \
-F "npm-react=@build/react.tgz" \
-F "npm-react-tools=@build/react-tools.tgz" \
-F "commit=$TRAVIS_COMMIT" \
-F "date=`git log --format='%ct' -1`" \
-F "pull_request=$TRAVIS_PULL_REQUEST" \
-F "token=$SECRET_TOKEN" \
-F "branch=$TRAVIS_BRANCH" \
$SERVER
fi
env:
matrix:
- TEST_TYPE=test
- TEST_TYPE=jest
- TEST_TYPE=lint
- 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=
matrix:
fast_finish: true
allow_failures:
- env: TEST_TYPE=test:coverage
- env: TEST_TYPE=perf:full
- env: TEST_TYPE=test:webdriver:saucelabs:modern
- env: TEST_TYPE=test:webdriver:saucelabs BROWSER_NAME=ie11
- env: TEST_TYPE=test:webdriver:saucelabs BROWSER_NAME=ie10
- env: TEST_TYPE=test:webdriver:saucelabs BROWSER_NAME=ie9
- env: TEST_TYPE=test:webdriver:saucelabs BROWSER_NAME=ie8
- env: TEST_TYPE=test:webdriver:saucelabs:ios
- env: TEST_TYPE=test:webdriver:saucelabs BROWSER_NAME=safari
notifications:
irc:
use_notice: true
skip_join: true
on_success: change
on_failure: change
channels:
- chat.freenode.net#reactjs

243
AUTHORS Normal file
View File

@@ -0,0 +1,243 @@
Adam Krebs <amk528@cs.nyu.edu>
Adam Mark <adammark75@gmail.com>
Adam Solove <asolove@gmail.com>
Alan deLevie <adelevie@gmail.com>
Alex Zelenskiy <azelenskiy@fb.com>
Alexander Solovyov <alexander@solovyov.net>
Alexey Raspopov <avenger7x13@gmail.com>
Andre Z Sanchez <andrezacsanchez@gmail.com>
Andreas Svensson <andreas@syranide.com>
Andres Suarez <zertosh@gmail.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>
Areeb Malik <areeb.malik91@gmail.com>
Ayman Osman <aymano.osman@gmail.com>
Ben Alpert <ben@benalpert.com>
Ben Foxall <benfoxall@gmail.com>
Ben Newman <bn@cs.stanford.edu>
Ben Ripkens <bripkens.dev@gmail.com>
Bill Fisher <fisherwebdev@gmail.com>
Bob Eagan <bob@synapsestudios.com>
Bojan Mihelac <bmihelac@mihelac.org>
Brandon Bloom <brandon@brandonbloom.name>
Brandon Tilley <brandon@brandontilley.com>
Brian Cooke <bri@bricooke.com>
Brian Kim <briankimpossible@gmail.com>
Brian Reavis <brian@thirdroute.com>
Brian Rue <brian@rollbar.com>
Cam Spiers <camspiers@gmail.com>
Cassus Adam Banko <banko.adam@gmail.com>
Cat Chen <catchen@fb.com>
Charles Marsh <charlie@khanacademy.org>
Cheng Lou <chenglou92@gmail.com>
Chris Sciolla <csciolla1@gmail.com>
Christian Alfoni <christianalfoni@gmail.com>
Christian Roman <chroman16@gmail.com>
Christoph Pojer <christoph.pojer@gmail.com>
Christopher Monsanto <chris@monsan.to>
Clay Allsopp <clay.allsopp@gmail.com>
Connor McSheffrey <c@conr.me>
Cotton Hou <himcotton@gmail.com>
Dan Abramov <dan.abramov@gmail.com>
Dan Schafer <dschafer@fb.com>
Daniel Gasienica <daniel@gasienica.ch>
Daniel Lo Nigro <daniel@dan.cx>
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>
Devon Blandin <dblandin@gmail.com>
Dmitrii Abramov <dmitrii@rheia.us>
Dmitry Mazuro <dmitry.mazuro@icloud.com>
Dustin Getz <dgetz@wingspan.com>
Enguerran <engcolson@gmail.com>
Eric Clemmons <eric@smarterspam.com>
Eric Florenzano <floguy@gmail.com>
Eric Schoffstall <contra@wearefractal.com>
Evan Coonrod <evan@paloalto.com>
Fabio M. Costa <fabiomcosta@gmail.com>
Felipe Oliveira Carvalho <felipekde@gmail.com>
Felix Gnass <fgnass@gmail.com>
Felix Kling <felix.kling@gmx.net>
Fernando Correia <fernando@servicero.com>
François-Xavier Bois <fxbois@gmail.com>
Fred Zhao <fredz@fb.com>
G Scott Olson <gscottolson@gmail.com>
Garren Smith <garren.smith@gmail.com>
Geert Pasteels <geert.pasteels@gmail.com>
Geert-Jan Brits <gbrits@gmail.com>
George A Sisco III <george.sisco@gmail.com>
Gilbert <gilbertbgarza@gmail.com>
Glen Mailer <glenjamin@gmail.com>
Greg Hurrell <glh@fb.com>
Greg Roodt <groodt@gmail.com>
Guangqiang Dong <gqdong@fb.com>
Guido Bouman <m@guido.vc>
Harry Hull <harry.hull1@gmail.com>
Harshad Sabne <harshadsabne@users.noreply.github.com>
Hendrik Swanepoel <hendrik.swanepoel@gmail.com>
Hugo Jobling <me@thisishugo.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 Vergiliev <ivan.vergiliev@gmail.com>
Jacob Gable <jacob.gable@gmail.com>
Jacob Greenleaf <jake@imgur.com>
Jaime Mingo <j.mingov@3boll.com>
Jakub Malinowski <jakubmal@gmail.com>
James Brantly <james@jbrantly.com>
James Ide <ide@fb.com>
James Seppi <james.seppi@gmail.com>
Jamie Wong <jamie.lf.wong@gmail.com>
Jamison Dance <jergason@gmail.com>
Jan Hancic <jan.hancic@gmail.com>
Jan Kassens <jan@kassens.net>
Jared Forsyth <jared@jaredforsyth.com>
Jason Bonta <jbonta@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 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>
Jimmy Jea <jimjea@gmail.com>
Jing Chen <jingc@fb.com>
Johannes Baiter <johannes.baiter@gmail.com>
Johannes Emerich <johannes@emerich.de>
John Watson <jwatson@fb.com>
Jon Beebe <jon.beebe@daveramsey.com>
Jonas Enlund <jonas.enlund@gmail.com>
Jonas Gebhardt <jonas@instagram.com>
Jonathan Hsu <jhiswin@gmail.com>
Jordan Walke <jordojw@gmail.com>
Josh Bassett <josh.bassett@gmail.com>
Josh Duck <josh@fb.com>
Josh Yudaken <yud@instagram.com>
Joshua Ma <me@joshma.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>
Karl Mikkelsen <karl@kingkarl.com>
Karpich Dmitry <karpich@gollard.ru>
Keito Uchiyama <projects@keito.me>
Kit Randel <kit@nocturne.net.nz>
Kunal Mehta <k.mehta@berkeley.edu>
Kyle Mathews <mathews.kyle@gmail.com>
Laurence Rowe <l@lrowe.co.uk>
Lee Byron <lee@leebyron.com>
Levi McCallum <levi@levimccallum.com>
Lily <qvang.j@gmail.com>
Logan Allen <loganfynne@gmail.com>
Luigy Leon <luichi.19@gmail.com>
Marcin Kwiatkowski <marcin.kwiatkowski@hotmail.com>
Marcin Szczepanski <marcins@gmail.com>
Mariano Desanze <protronm@gmail.com>
Mark Anderson <undernewmanagement@users.noreply.github.com>
Mark Hintz <markohintz@gmail.com>
Mark IJbema <markijbema@gmail.com>
Mark Richardson <echo@fb.com>
Marshall Roch <mroch@fb.com>
Martin Andert <mandert@gmail.com>
Martin Konicek <mkonicek@fb.com>
Mathieu M-Gosselin <mathieumg@gmail.com>
Matt Harrison <mt.harrison86@gmail.com>
Matthew Dapena-Tretter <m@tthewwithanm.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>
Mike D Pilsbury <mike.pilsbury@gmail.com>
Miorel Palii <miorel@fb.com>
Mouad Debbar <mdebbar@fb.com>
Nadeesha Cabral <nadeesha.cabral@gmail.com>
Naman Goel <naman34@gmail.com>
Nate Hunzaker <nate.hunzaker@gmail.com>
Nathan White <nw@nwhite.net>
Nicholas Bergson-Shilcock <me@nicholasbs.net>
Nick Fitzgerald <fitzgen@gmail.com>
Nick Gavalas <njg57@cornell.edu>
Nick Merwin <nick@lemurheavy.com>
Nick Thompson <ncthom91@gmail.com>
Nick Williams <WickyNilliams@users.noreply.github.com>
Niklas Boström <nbostrom@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>
Paul OShannessy <paul@oshannessy.com>
Paul Seiffert <paul.seiffert@gmail.com>
Paul Shen <paul@mnml0.com>
Pete Hunt <floydophone@gmail.com>
Peter Cottle <pcottle@fb.com>
Petri Lievonen <plievone@cc.hut.fi>
Pieter Vanderwerff <me@pieter.io>
Rajiv Tirumalareddy <rajivtreddy@gmail.com>
Randall Randall <randall@randallsquared.com>
Ray <ray@tomo.im>
Richard D. Worth <rdworth@gmail.com>
Richard Feldman <richard.t.feldman@gmail.com>
Richard Livesey <Livesey7@hotmail.co.uk>
Rick Beerendonk <rick@beerendonk.com>
Rob Arnold <robarnold@cs.cmu.edu>
Ryan Seddon <seddon.ryan@gmail.com>
Sahat Yalkabov <sakhat@gmail.com>
Sam Selikoff <sam.selikoff@gmail.com>
Sander Spies <sandermail@gmail.com>
Sean Kinsey <oyvind@fb.com>
Sebastian Markbåge <sebastian@calyptus.eu>
Sergey Generalov <sergey@genbit.ru>
Shane O'Sullivan <shaneosullivan1@gmail.com>
Shaun Trennery <shaun.trennery@gmail.com>
Sheraz <undernewmanagement@users.noreply.github.com>
Shripad K <assortmentofsorts@gmail.com>
Simon Højberg <r.hackr@gmail.com>
Simon Welsh <simon@simon.geek.nz>
Stefan Dombrowski <sdo451@gmail.com>
Stephen Murphy <smurphy3@apple.com>
Stoyan Stefanov <ssttoo@ymail.com>
Sundeep Malladi <sundeep.malladi@gmail.com>
Sunny Juneja <me@sunnyjuneja.com>
Sven Helmberger <fforw@gmx.de>
Sébastien Lorber <lorber.sebastien@gmail.com>
Thomas Aylott <oblivious@subtlegradient.com>
Thomas Boyt <thomas.boyt@venmo.com>
Thomas Shaddox <thomas@heyzap.com>
Thomas Shafer <thomasjshafer@gmail.com>
ThomasCrvsr <crevoisier.thomas@gmail.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>
Ville Immonen <ville.immonen@iki.fi>
Vjeux <vjeuxx@gmail.com>
Volkan Unsal <spocksplanet@gmail.com>
Wayne Larsen <wayne@larsen.st>
WickyNilliams <WickyNilliams@MBA>
Wincent Colaiuta <win@wincent.com>
XuefengWu <benewu@gmail.com>
Yuriy Dybskiy <yuriy@dybskiy.com>
Yuval Dekel <thedekel@fb.com>
Zach Bruggeman <mail@bruggie.com>
cutbko <kutsenko.eugene@hotmail.com>
davidxi <davidgraycn@gmail.com>
imagentleman <imagentlemail@gmail.com>
jon madison <jon@tfftech.com>

460
CHANGELOG.md Normal file
View File

@@ -0,0 +1,460 @@
## 0.12.2 (December 18, 2014)
### React Core
* Added support for more HTML attributes: `formAction`, `formEncType`, `formMethod`, `formTarget`, `marginHeight`, `marginWidth`
* Added `strokeOpacity` to the list of unitless CSS properties
* Removed trailing commas (allows npm module to be bundled and used in IE8)
* Fixed bug resulting in error when passing `undefined` to `React.createElement` - now there is a useful warning
### React Tools
* JSX-related transforms now always use double quotes for props and `displayName`
## 0.12.1 (November 18, 2014)
### React Tools
* Types transform updated with latest support
* jstransform version updated with improved ES6 transforms
* Explicit Esprima dependency removed in favor of using Esprima information exported by jstransform
## 0.12.0 (October 28, 2014)
### React Core
#### Breaking Changes
* `key` and `ref` moved off props object, now accessible on the element directly
* React is now BSD licensed with accompanying Patents grant
* Default prop resolution has moved to Element creation time instead of mount time, making them effectively static
* `React.__internals` is removed - it was exposed for DevTools which no longer needs access
* Composite Component functions can no longer be called directly - they must be wrapped with `React.createFactory` first. This is handled for you when using JSX.
#### New Features
* Spread operator (`{...}`) introduced to deprecate `this.transferPropsTo`
* Added support for more HTML attributes: `acceptCharset`, `classID`, `manifest`
#### Deprecations
* `React.renderComponent` --> `React.render`
* `React.renderComponentToString` --> `React.renderToString`
* `React.renderComponentToStaticMarkup` --> `React.renderToStaticMarkup`
* `React.isValidComponent` --> `React.isValidElement`
* `React.PropTypes.component` --> `React.PropTypes.element`
* `React.PropTypes.renderable` --> `React.PropTypes.node`
* **DEPRECATED** `React.isValidClass`
* **DEPRECATED** `instance.transferPropsTo`
* **DEPRECATED** Returning `false` from event handlers to preventDefault
* **DEPRECATED** Convenience Constructor usage as function, instead wrap with `React.createFactory`
* **DEPRECATED** use of `key={null}` to assign implicit keys
#### Bug Fixes
* Better handling of events and updates in nested results, fixing value restoration in "layered" controlled components
* Correctly treat `event.getModifierState` as case sensitive
* Improved normalization of `event.charCode`
* Better error stacks when involving autobound methods
* Removed DevTools message when the DevTools are installed
* Correctly detect required language features across browsers
* Fixed support for some HTML attributes:
* `list` updates correctly now
* `scrollLeft`, `scrollTop` removed, these should not be specified as props
* Improved error messages
### React With Addons
#### New Features
* `React.addons.batchedUpdates` added to API for hooking into update cycle
#### Breaking Changes
* `React.addons.update` uses `assign` instead of `copyProperties` which does `hasOwnProperty` checks. Properties on prototypes will no longer be updated correctly.
#### Bug Fixes
* Fixed some issues with CSS Transitions
### JSX
#### Breaking Changes
* Enforced convention: lower case tag names are always treated as HTML tags, upper case tag names are always treated as composite components
* JSX no longer transforms to simple function calls
#### New Features
* `@jsx React.DOM` no longer required
* spread (`{...}`) operator introduced to allow easier use of props
#### Bug Fixes
* JSXTransformer: Make sourcemaps an option when using APIs directly (eg, for react-rails)
## 0.11.2 (September 16, 2014)
### React Core
#### New Features
* Added support for `<dialog>` element and associated `open` attribute
* Added support for `<picture>` element and associated `media` and `sizes` attributes
* Added `React.createElement` API in preparation for React v0.12
* `React.createDescriptor` has been deprecated as a result
### JSX
* `<picture>` is now parsed into `React.DOM.picture`
### React Tools
* Update `esprima` and `jstransform` for correctness fixes
* The `jsx` executable now exposes a `--strip-types` flag which can be used to remove TypeScript-like type annotations
* This option is also exposed to `require('react-tools').transform` as `stripTypes`
## 0.11.1 (July 24, 2014)
### React Core
#### Bug Fixes
* `setState` can be called inside `componentWillMount` in non-DOM environments
* `SyntheticMouseEvent.getEventModifierState` correctly renamed to `getModifierState`
* `getModifierState` correctly returns a `boolean`
* `getModifierState` is now correctly case sensitive
* Empty Text node used in IE8 `innerHTML` workaround is now removed, fixing rerendering in certain cases
### JSX
* Fix duplicate variable declaration in JSXTransformer (caused issues in some browsers)
## 0.11.0 (July 17, 2014)
### React Core
#### Breaking Changes
* `getDefaultProps()` is now called once per class and shared across all instances
* `MyComponent()` now returns a descriptor, not an instance
* `React.isValidComponent` and `React.PropTypes.component` validate *descriptors*, not component instances
* Custom `propType` validators should return an `Error` instead of logging directly
#### New Features
* Rendering to `null`
* Keyboard events include normalized `e.key` and `e.getModifierState()` properties
* New normalized `onBeforeInput` event
* `React.Children.count` has been added as a helper for counting the number of children
#### Bug Fixes
* Re-renders are batched in more cases
* Events: `e.view` properly normalized
* Added Support for more HTML attributes (`coords`, `crossOrigin`, `download`, `hrefLang`, `mediaGroup`, `muted`, `scrolling`, `shape`, `srcSet`, `start`, `useMap`)
* Improved SVG support
* Changing `className` on a mounted SVG component now works correctly
* Added support for elements `mask` and `tspan`
* Added support for attributes `dx`, `dy`, `fillOpacity`, `fontFamily`, `fontSize`, `markerEnd`, `markerMid`, `markerStart`, `opacity`, `patternContentUnits`, `patternUnits`, `preserveAspectRatio`, `strokeDasharray`, `strokeOpacity`
* CSS property names with vendor prefixes (`Webkit`, `ms`, `Moz`, `O`) are now handled properly
* Duplicate keys no longer cause a hard error; now a warning is logged (and only one of the children with the same key is shown)
* `img` event listeners are now unbound properly, preventing the error "Two valid but unequal nodes with the same `data-reactid`"
* Added explicit warning when missing polyfills
### React With Addons
* PureRenderMixin: a mixin which helps optimize "pure" components
* Perf: a new set of tools to help with performance analysis
* Update: New `$apply` command to transform values
* TransitionGroup bug fixes with null elements, Android
### React NPM Module
* Now includes the pre-built packages under `dist/`.
* `envify` is properly listed as a dependency instead of a peer dependency
### JSX
* Added support for namespaces, eg `<Components.Checkbox />`
* JSXTransformer
* Enable the same `harmony` features available in the command line with `<script type="text/jsx;harmony=true">`
* Scripts are downloaded in parallel for more speed. They are still executed in order (as you would expect with normal script tags)
* Fixed a bug preventing sourcemaps from working in Firefox
### React Tools Module
* Improved readme with usage and API information
* Improved ES6 transforms available with `--harmony` option
* Added `--source-map-inline` option to the `jsx` executable
* New `transformWithDetails` API which gives access to the raw sourcemap data
## 0.10.0 (March 21, 2014)
### React Core
#### 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`](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
#### Bug Fixes
* Ensure all void elements dont insert a closing tag into the markup.
* Ensure `className={false}` behaves consistently
* Ensure `this.refs` is defined, even if no refs are specified.
### Addons
* `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).
## 0.9.0 (February 20, 2014)
### React Core
#### Breaking Changes
- The lifecycle methods `componentDidMount` and `componentDidUpdate` no longer receive the root node as a parameter; use `this.getDOMNode()` instead
- Whenever a prop is equal to `undefined`, the default value returned by `getDefaultProps` will now be used instead
- `React.unmountAndReleaseReactRootNode` was previously deprecated and has now been removed
- `React.renderComponentToString` is now synchronous and returns the generated HTML string
- Full-page rendering (that is, rendering the `<html>` tag using React) is now supported only when starting with server-rendered markup
- On mouse wheel events, `deltaY` is no longer negated
- When prop types validation fails, a warning is logged instead of an error thrown (with the production build of React, type checks are now skipped for performance)
- On `input`, `select`, and `textarea` elements, `.getValue()` is no longer supported; use `.getDOMNode().value` instead
- `this.context` on components is now reserved for internal use by React
#### New Features
- React now never rethrows errors, so stack traces are more accurate and Chrome's purple break-on-error stop sign now works properly
- Added support for SVG tags `defs`, `linearGradient`, `polygon`, `radialGradient`, `stop`
- Added support for more attributes:
- `crossOrigin` for CORS requests
- `download` and `hrefLang` for `<a>` tags
- `mediaGroup` and `muted` for `<audio>` and `<video>` tags
- `noValidate` and `formNoValidate` for forms
- `property` for Open Graph `<meta>` tags
- `sandbox`, `seamless`, and `srcDoc` for `<iframe>` tags
- `scope` for screen readers
- `span` for `<colgroup>` tags
- Added support for defining `propTypes` in mixins
- Added `any`, `arrayOf`, `component`, `oneOfType`, `renderable`, `shape` to `React.PropTypes`
- Added support for `statics` on component spec for static component methods
- On all events, `.currentTarget` is now properly set
- On keyboard events, `.key` is now polyfilled in all browsers for special (non-printable) keys
- On clipboard events, `.clipboardData` is now polyfilled in IE
- On drag events, `.dragTransfer` is now present
- Added support for `onMouseOver` and `onMouseOut` in addition to the existing `onMouseEnter` and `onMouseLeave` events
- Added support for `onLoad` and `onError` on `<img>` elements
- Added support for `onReset` on `<form>` elements
- The `autoFocus` attribute is now polyfilled consistently on `input`, `select`, and `textarea`
#### Bug Fixes
- React no longer adds an `__owner__` property to each component's `props` object; passed-in props are now never mutated
- When nesting top-level components (e.g., calling `React.renderComponent` within `componentDidMount`), events now properly bubble to the parent component
- Fixed a case where nesting top-level components would throw an error when updating
- Passing an invalid or misspelled propTypes type now throws an error
- On mouse enter/leave events, `.target`, `.relatedTarget`, and `.type` are now set properly
- On composition events, `.data` is now properly normalized in IE9 and IE10
- CSS property values no longer have `px` appended for the unitless properties `columnCount`, `flex`, `flexGrow`, `flexShrink`, `lineClamp`, `order`, `widows`
- Fixed a memory leak when unmounting children with a `componentWillUnmount` handler
- Fixed a memory leak when `renderComponentToString` would store event handlers
- Fixed an error that could be thrown when removing form elements during a click handler
- Boolean attributes such as `disabled` are rendered without a value (previously `disabled="true"`, now simply `disabled`)
- `key` values containing `.` are now supported
- Shortened `data-reactid` values for performance
- Components now always remount when the `key` property changes
- Event handlers are attached to `document` only when necessary, improving performance in some cases
- Events no longer use `.returnValue` in modern browsers, eliminating a warning in Chrome
- `scrollLeft` and `scrollTop` are no longer accessed on document.body, eliminating a warning in Chrome
- General performance fixes, memory optimizations, improvements to warnings and error messages
### React with Addons
- `React.addons.TestUtils` was added to help write unit tests
- `React.addons.TransitionGroup` was renamed to `React.addons.CSSTransitionGroup`
- `React.addons.TransitionGroup` was added as a more general animation wrapper
- `React.addons.cloneWithProps` was added for cloning components and modifying their props
- Bug fix for adding back nodes during an exit transition for CSSTransitionGroup
- Bug fix for changing `transitionLeave` in CSSTransitionGroup
- Performance optimizations for CSSTransitionGroup
- On checkbox `<input>` elements, `checkedLink` is now supported for two-way binding
### JSX Compiler and react-tools Package
- Whitespace normalization has changed; now space between two tags on the same line will be preserved, while newlines between two tags will be removed
- The `react-tools` npm package no longer includes the React core libraries; use the `react` package instead.
- `displayName` is now added in more cases, improving error messages and names in the React Dev Tools
- Fixed an issue where an invalid token error was thrown after a JSX closing tag
- `JSXTransformer` now uses source maps automatically in modern browsers
- `JSXTransformer` error messages now include the filename and problematic line contents when a file fails to parse
## 0.8.0 (December 19, 2013)
### React
* Added support for more attributes:
* `rows` & `cols` for `<textarea>`
* `defer` & `async` for `<script>`
* `loop` for `<audio>` & `<video>`
* `autoCorrect` for form fields (a non-standard attribute only supported by mobile WebKit)
* Improved error messages
* Fixed Selection events in IE11
* Added `onContextMenu` events
### React with Addons
* Fixed bugs with TransitionGroup when children were undefined
* Added support for `onTransition`
### react-tools
* Upgraded `jstransform` and `esprima-fb`
### JSXTransformer
* Added support for use in IE8
* Upgraded browserify, which reduced file size by ~65KB (16KB gzipped)
## 0.5.2, 0.4.2 (December 18, 2013)
### React
* Fixed a potential XSS vulnerability when using user content as a `key`: [CVE-2013-7035](https://groups.google.com/forum/#!topic/reactjs/OIqxlB2aGfU)
## 0.5.1 (October 29, 2013)
### React
* Fixed bug with `<input type="range">` and selection events.
* Fixed bug with selection and focus.
* Made it possible to unmount components from the document root.
* Fixed bug for `disabled` attribute handling on non-`<input>` elements.
### React with Addons
* Fixed bug with transition and animation event detection.
## 0.5.0 (October 16, 2013)
### React
* Memory usage improvements - reduced allocations in core which will help with GC pauses
* Performance improvements - in addition to speeding things up, we made some tweaks to stay out of slow path code in V8 and Nitro.
* Standardized prop -> DOM attribute process. This previously resulting in additional type checking and overhead as well as confusing cases for users. Now we will always convert your value to a string before inserting it into the DOM.
* Support for Selection events.
* Support for [Composition events](https://developer.mozilla.org/en-US/docs/Web/API/CompositionEvent).
* Support for additional DOM properties (`charSet`, `content`, `form`, `httpEquiv`, `rowSpan`, `autoCapitalize`).
* Support for additional SVG properties (`rx`, `ry`).
* Support for using `getInitialState` and `getDefaultProps` in mixins.
* Support mounting into iframes.
* Bug fixes for controlled form components.
* Bug fixes for SVG element creation.
* Added `React.version`.
* Added `React.isValidClass` - Used to determine if a value is a valid component constructor.
* Removed `React.autoBind` - This was deprecated in v0.4 and now properly removed.
* Renamed `React.unmountAndReleaseReactRootNode` to `React.unmountComponentAtNode`.
* Began laying down work for refined performance analysis.
* Better support for server-side rendering - [react-page](https://github.com/facebook/react-page) has helped improve the stability for server-side rendering.
* Made it possible to use React in environments enforcing a strict [Content Security Policy](https://developer.mozilla.org/en-US/docs/Security/CSP/Introducing_Content_Security_Policy). This also makes it possible to use React to build Chrome extensions.
### 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](http://facebook.github.io/react/docs/addons.html).
### JSX
* No longer transform `class` to `className` as part of the transform! This is a breaking change - if you were using `class`, you *must* change this to `className` or your components will be visually broken.
* Added warnings to the in-browser transformer to make it clear it is not intended for production use.
* Improved compatibility for Windows
* Improved support for maintaining line numbers when transforming.
## 0.4.1 (July 26, 2013)
### React
* `setState` callbacks are now executed in the scope of your component.
* `click` events now work on Mobile Safari.
* Prevent a potential error in event handling if `Object.prototype` is extended.
* Don't set DOM attributes to the string `"undefined"` on update when previously defined.
* Improved support for `<iframe>` attributes.
* Added checksums to detect and correct cases where server-side rendering markup mismatches what React expects client-side.
### JSXTransformer
* Improved environment detection so it can be run in a non-browser environment.
## 0.4.0 (July 17, 2013)
### React
* 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...](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.
### JSX
* Support for comment nodes `<div>{/* this is a comment and won't be rendered */}</div>`
* Children are now transformed directly into arguments instead of being wrapped in an array
E.g. `<div><Component1/><Component2/></div>` is transformed into `React.DOM.div(null, Component1(null), Component2(null))`.
Previously this would be transformed into `React.DOM.div(null, [Component1(null), Component2(null)])`.
If you were using React without JSX previously, your code should still work.
### react-tools
* Fixed a number of bugs when transforming directories
* No longer re-write `require()`s to be relative unless specified
## 0.3.3 (June 20, 2013)
### React
* Allow reusing the same DOM node to render different components. e.g. `React.renderComponent(<div/>, domNode); React.renderComponent(<span/>, domNode);` will work now.
### JSX
* Improved the in-browser transformer so that transformed scripts will execute in the expected scope. The allows components to be defined and used from separate files.
### react-tools
* Upgrade Commoner so `require` statements are no longer relativized when passing through the transformer. This was a feature needed when building React, but doesn't translate well for other consumers of `bin/jsx`.
* Upgraded our dependencies on Commoner and Recast so they use a different directory for their cache.
* Freeze our esprima dependency.
## 0.3.2 (May 31, 2013)
### JSX
* Improved compatability with other coding styles (specifically, multiple assignments with a single `var`).
### react-tools
* Switch from using the browserified build to shipping individual modules. This allows react-tools to be used with [browserify](https://github.com/substack/node-browserify).
## 0.3.1 (May 30, 2013)
### react-tools
* Fix bug in packaging resulting in broken module.
## 0.3.0 (May 29, 2013)
* Initial public release

View File

@@ -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. 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](https://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://developers.facebook.com/opensource/cla>
[Complete your CLA here](https://code.facebook.com/cla)
## Bugs
@@ -41,23 +41,30 @@ 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 and 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; go through the process outlined on that page.
## How to Get in Touch
* IRC - [#reactjs on freenode](http://webchat.freenode.net/?channels=reactjs)
* Mailing list - [reactjs on Google Groups](http://groups.google.com/group/reactjs)
## Coding Style
## Style Guide
### Code
* Use semicolons;
* 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`
### Documentation
* Do not wrap lines at 80 characters
## License
By contributing to React, you agree that your contributions will be licensed under the [Apache License Version 2.0 (APLv2)](LICENSE).
By contributing to React, you agree that your contributions will be licensed under its BSD license.

View File

@@ -1,75 +1,274 @@
'use strict';
var exec = require('child_process').exec;
var jsxTask = require('./grunt/tasks/jsx');
var browserifyTask = require('./grunt/tasks/browserify');
var wrapupTask = require('./grunt/tasks/wrapup');
var phantomTask = require('./grunt/tasks/phantom');
var populistTask = require('./grunt/tasks/populist');
var webdriverPhantomJSTask = require('./grunt/tasks/webdriver-phantomjs');
var webdriverJasmineTasks = require('./grunt/tasks/webdriver-jasmine');
var sauceTunnelTask = require('./grunt/tasks/sauce-tunnel');
var npmTask = require('./grunt/tasks/npm');
var releaseTasks = require('./grunt/tasks/release');
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/jsx'),
jsx: require('./grunt/config/jsx'),
browserify: require('./grunt/config/browserify'),
wrapup: require('./grunt/config/wrapup'),
phantom: require('./grunt/config/phantom'),
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'),
npm: require('./grunt/config/npm'),
clean: ['./build', './*.gem', './docs/_site', './examples/shared/*.js'],
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'));
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-compare-size');
grunt.loadNpmTasks('grunt-contrib-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);
});
// Alias 'jshint' to 'lint' to better match the workflow we know
grunt.registerTask('lint', ['jshint']);
grunt.registerTask('eslint', eslintTask);
// Register jsx:debug and :release tasks.
grunt.registerTask('lint', ['eslint']);
grunt.registerTask(
'download-previous-version',
require('./grunt/tasks/download-previous-version.js')
);
grunt.registerTask('delete-build-modules', function() {
if (grunt.file.exists('build/modules')) {
grunt.file.delete('build/modules');
}
});
// Register jsx:normal and :release tasks.
grunt.registerMultiTask('jsx', jsxTask);
// Our own browserify-based tasks to build a single JS file build
grunt.registerMultiTask('browserify', browserifyTask);
// Similar to Browserify, use WrapUp to generate single JS file that
// defines global variables instead of using require.
grunt.registerMultiTask('wrapup', wrapupTask);
grunt.registerMultiTask('populist', populistTask);
grunt.registerMultiTask('phantom', phantomTask);
grunt.registerTask('sauce-tunnel', sauceTunnelTask);
grunt.registerMultiTask('webdriver-jasmine', webdriverJasmineTasks);
grunt.registerMultiTask('webdriver-perf', require('./grunt/tasks/webdriver-perf'));
grunt.registerMultiTask('npm', npmTask);
grunt.registerTask('build:basic', ['jsx:debug', 'browserify:basic']);
grunt.registerTask('build:transformer', ['jsx:debug', 'browserify:transformer']);
grunt.registerTask('build:min', ['jsx:release', 'browserify:min']);
grunt.registerTask('npm-react:release', npmReactTasks.buildRelease);
grunt.registerTask('npm-react:pack', npmReactTasks.packRelease);
grunt.registerTask('npm-react-tools:release', npmReactToolsTasks.buildRelease);
grunt.registerTask('npm-react-tools:pack', npmReactToolsTasks.packRelease);
grunt.registerTask('gem-react-source:release', gemReactSourceTasks.buildRelease);
grunt.registerTask('gem-react-source:pack', gemReactSourceTasks.packRelease);
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:withCodeCoverageLogging', [
'jsx:normal',
'version-check',
'browserify:withCodeCoverageLogging'
]);
grunt.registerTask('build:perf', [
'jsx:normal',
'version-check',
'browserify:transformer',
'browserify:basic',
'browserify:min',
'download-previous-version'
]);
grunt.registerTask('build:test', [
'jsx:debug',
'jsx:jasmine',
'delete-build-modules',
'jsx:test',
'browserify:jasmine',
'browserify:test'
'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('test', ['build:test', 'phantom:run']);
grunt.registerTask('webdriver-phantomjs', webdriverPhantomJSTask);
grunt.registerTask('coverage:parse', require('./grunt/tasks/coverage-parse'));
grunt.registerTask('test:webdriver:phantomjs', [
'connect',
'webdriver-phantomjs',
'webdriver-jasmine:local'
]);
grunt.registerTask('perf:webdriver:phantomjs', [
'connect',
'webdriver-phantomjs',
'webdriver-perf:local'
]);
grunt.registerTask('test:full', [
'build:test',
'build:basic',
'connect',
'webdriver-phantomjs',
'webdriver-jasmine:local',
'sauce-tunnel',
'webdriver-jasmine:saucelabs_android',
'webdriver-jasmine:saucelabs_firefox',
'webdriver-jasmine:saucelabs_chrome'
]);
grunt.registerTask('perf:full', [
'build:perf',
'connect',
'webdriver-phantomjs',
'webdriver-perf:local',
'sauce-tunnel',
'webdriver-perf:saucelabs_firefox',
'webdriver-perf:saucelabs_chrome',
'webdriver-perf:saucelabs_ie11',
'webdriver-perf:saucelabs_ie8'
]);
grunt.registerTask('test:webdriver:saucelabs', [
'build:test',
'build:basic',
'connect',
'sauce-tunnel',
'webdriver-jasmine:saucelabs_' + (process.env.BROWSER_NAME || 'ie8')
]);
grunt.registerTask('test:webdriver:saucelabs:modern', [
'build:test',
'build:basic',
'connect',
'sauce-tunnel',
'webdriver-jasmine:saucelabs_android',
'webdriver-jasmine:saucelabs_firefox',
'webdriver-jasmine:saucelabs_chrome',
'webdriver-jasmine:saucelabs_ie11'
]);
grunt.registerTask('test:webdriver:saucelabs:ie', [
'build:test',
'build:basic',
'connect',
'sauce-tunnel',
'webdriver-jasmine:saucelabs_ie8',
'webdriver-jasmine:saucelabs_ie9',
'webdriver-jasmine:saucelabs_ie10',
'webdriver-jasmine:saucelabs_ie11'
]);
grunt.registerTask('test:webdriver:saucelabs:ios', [
'build:test',
'build:basic',
'connect',
'sauce-tunnel',
'webdriver-jasmine:saucelabs_ios6_1',
'webdriver-jasmine:saucelabs_ios5_1',
'webdriver-jasmine:saucelabs_ios4'
]);
grunt.registerTask('test:coverage', [
'build:test',
'build:withCodeCoverageLogging',
'test:webdriver:phantomjs',
'coverage:parse'
]);
grunt.registerTask('fasttest', function() {
if (grunt.option('debug')) {
grunt.task.run('build:test', 'connect:server:keepalive');
} else {
grunt.task.run('build:test', 'test:webdriver:phantomjs');
}
});
grunt.registerTask('test', function() {
if (grunt.option('debug')) {
grunt.task.run('build:test', 'build:basic', 'connect:server:keepalive');
} else {
grunt.task.run('build:test', 'build:basic', 'test:webdriver:phantomjs');
}
});
grunt.registerTask('perf', ['build:perf', 'perf:webdriver:phantomjs']);
grunt.registerTask('npm:test', ['build', 'npm:pack']);
// Optimized build task that does all of our builds. The subtasks will be run
// in order so we can take advantage of that and only run jsx:debug once.
// in order so we can take advantage of that and only run jsx:normal once.
grunt.registerTask('build', [
'jsx:debug',
'delete-build-modules',
'jsx:normal',
'version-check',
'browserify:basic',
'browserify:transformer',
'jsx:release',
'browserify:addons',
'browserify:min',
'browserify:addonsMin',
'npm-react:release',
'npm-react:pack',
'npm-react-tools:release',
'npm-react-tools:pack',
'copy:react_docs',
'compare_size'
]);
@@ -85,7 +284,8 @@ module.exports = function(grunt) {
'release:setup',
'clean',
'build',
'gem:only',
'gem-react-source:release',
'gem-react-source:pack',
'release:bower',
'release:starter',
'compress',
@@ -93,14 +293,6 @@ module.exports = function(grunt) {
'release:msg'
]);
// `gem` task to build the react-source gem
grunt.registerTask('gem', ['build', 'gem:only']);
grunt.registerTask('gem:only', function() {
var done = this.async();
exec('gem build react-source.gemspec', done);
});
// The default task - build - to keep setup easy
grunt.registerTask('default', ['build']);
};

218
LICENSE
View File

@@ -1,201 +1,31 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
BSD License
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
For React software
1. Definitions.
Copyright (c) 2013-2015, Facebook, Inc.
All rights reserved.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
* Neither the name Facebook nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

393
LICENSE-docs Normal file
View File

@@ -0,0 +1,393 @@
Attribution 4.0 International
=======================================================================
Creative Commons Corporation ("Creative Commons") is not a law firm and
does not provide legal services or legal advice. Distribution of
Creative Commons public licenses does not create a lawyer-client or
other relationship. Creative Commons makes its licenses and related
information available on an "as-is" basis. Creative Commons gives no
warranties regarding its licenses, any material licensed under their
terms and conditions, or any related information. Creative Commons
disclaims all liability for damages resulting from their use to the
fullest extent possible.
Using Creative Commons Public Licenses
Creative Commons public licenses provide a standard set of terms and
conditions that creators and other rights holders may use to share
original works of authorship and other material subject to copyright
and certain other rights specified in the public license below. The
following considerations are for informational purposes only, are not
exhaustive, and do not form part of our licenses.
Considerations for licensors: Our public licenses are
intended for use by those authorized to give the public
permission to use material in ways otherwise restricted by
copyright and certain other rights. Our licenses are
irrevocable. Licensors should read and understand the terms
and conditions of the license they choose before applying it.
Licensors should also secure all rights necessary before
applying our licenses so that the public can reuse the
material as expected. Licensors should clearly mark any
material not subject to the license. This includes other CC-
licensed material, or material used under an exception or
limitation to copyright. More considerations for licensors:
wiki.creativecommons.org/Considerations_for_licensors
Considerations for the public: By using one of our public
licenses, a licensor grants the public permission to use the
licensed material under specified terms and conditions. If
the licensor's permission is not necessary for any reason--for
example, because of any applicable exception or limitation to
copyright--then that use is not regulated by the license. Our
licenses grant only permissions under copyright and certain
other rights that a licensor has authority to grant. Use of
the licensed material may still be restricted for other
reasons, including because others have copyright or other
rights in the material. A licensor may make special requests,
such as asking that all changes be marked or described.
Although not required by our licenses, you are encouraged to
respect those requests where reasonable. More_considerations
for the public:
wiki.creativecommons.org/Considerations_for_licensees
=======================================================================
Creative Commons Attribution 4.0 International Public License
By exercising the Licensed Rights (defined below), You accept and agree
to be bound by the terms and conditions of this Creative Commons
Attribution 4.0 International Public License ("Public License"). To the
extent this Public License may be interpreted as a contract, You are
granted the Licensed Rights in consideration of Your acceptance of
these terms and conditions, and the Licensor grants You such rights in
consideration of benefits the Licensor receives from making the
Licensed Material available under these terms and conditions.
Section 1 -- Definitions.
a. Adapted Material means material subject to Copyright and Similar
Rights that is derived from or based upon the Licensed Material
and in which the Licensed Material is translated, altered,
arranged, transformed, or otherwise modified in a manner requiring
permission under the Copyright and Similar Rights held by the
Licensor. For purposes of this Public License, where the Licensed
Material is a musical work, performance, or sound recording,
Adapted Material is always produced where the Licensed Material is
synched in timed relation with a moving image.
b. Adapter's License means the license You apply to Your Copyright
and Similar Rights in Your contributions to Adapted Material in
accordance with the terms and conditions of this Public License.
c. Copyright and Similar Rights means copyright and/or similar rights
closely related to copyright including, without limitation,
performance, broadcast, sound recording, and Sui Generis Database
Rights, without regard to how the rights are labeled or
categorized. For purposes of this Public License, the rights
specified in Section 2(b)(1)-(2) are not Copyright and Similar
Rights.
d. Effective Technological Measures means those measures that, in the
absence of proper authority, may not be circumvented under laws
fulfilling obligations under Article 11 of the WIPO Copyright
Treaty adopted on December 20, 1996, and/or similar international
agreements.
e. Exceptions and Limitations means fair use, fair dealing, and/or
any other exception or limitation to Copyright and Similar Rights
that applies to Your use of the Licensed Material.
f. Licensed Material means the artistic or literary work, database,
or other material to which the Licensor applied this Public
License.
g. Licensed Rights means the rights granted to You subject to the
terms and conditions of this Public License, which are limited to
all Copyright and Similar Rights that apply to Your use of the
Licensed Material and that the Licensor has authority to license.
h. Licensor means the individual(s) or entity(ies) granting rights
under this Public License.
i. Share means to provide material to the public by any means or
process that requires permission under the Licensed Rights, such
as reproduction, public display, public performance, distribution,
dissemination, communication, or importation, and to make material
available to the public including in ways that members of the
public may access the material from a place and at a time
individually chosen by them.
j. Sui Generis Database Rights means rights other than copyright
resulting from Directive 96/9/EC of the European Parliament and of
the Council of 11 March 1996 on the legal protection of databases,
as amended and/or succeeded, as well as other essentially
equivalent rights anywhere in the world.
k. You means the individual or entity exercising the Licensed Rights
under this Public License. Your has a corresponding meaning.
Section 2 -- Scope.
a. License grant.
1. Subject to the terms and conditions of this Public License,
the Licensor hereby grants You a worldwide, royalty-free,
non-sublicensable, non-exclusive, irrevocable license to
exercise the Licensed Rights in the Licensed Material to:
a. reproduce and Share the Licensed Material, in whole or
in part; and
b. produce, reproduce, and Share Adapted Material.
2. Exceptions and Limitations. For the avoidance of doubt, where
Exceptions and Limitations apply to Your use, this Public
License does not apply, and You do not need to comply with
its terms and conditions.
3. Term. The term of this Public License is specified in Section
6(a).
4. Media and formats; technical modifications allowed. The
Licensor authorizes You to exercise the Licensed Rights in
all media and formats whether now known or hereafter created,
and to make technical modifications necessary to do so. The
Licensor waives and/or agrees not to assert any right or
authority to forbid You from making technical modifications
necessary to exercise the Licensed Rights, including
technical modifications necessary to circumvent Effective
Technological Measures. For purposes of this Public License,
simply making modifications authorized by this Section 2(a)
(4) never produces Adapted Material.
5. Downstream recipients.
a. Offer from the Licensor -- Licensed Material. Every
recipient of the Licensed Material automatically
receives an offer from the Licensor to exercise the
Licensed Rights under the terms and conditions of this
Public License.
b. No downstream restrictions. You may not offer or impose
any additional or different terms or conditions on, or
apply any Effective Technological Measures to, the
Licensed Material if doing so restricts exercise of the
Licensed Rights by any recipient of the Licensed
Material.
6. No endorsement. Nothing in this Public License constitutes or
may be construed as permission to assert or imply that You
are, or that Your use of the Licensed Material is, connected
with, or sponsored, endorsed, or granted official status by,
the Licensor or others designated to receive attribution as
provided in Section 3(a)(1)(A)(i).
b. Other rights.
1. Moral rights, such as the right of integrity, are not
licensed under this Public License, nor are publicity,
privacy, and/or other similar personality rights; however, to
the extent possible, the Licensor waives and/or agrees not to
assert any such rights held by the Licensor to the limited
extent necessary to allow You to exercise the Licensed
Rights, but not otherwise.
2. Patent and trademark rights are not licensed under this
Public License.
3. To the extent possible, the Licensor waives any right to
collect royalties from You for the exercise of the Licensed
Rights, whether directly or through a collecting society
under any voluntary or waivable statutory or compulsory
licensing scheme. In all other cases the Licensor expressly
reserves any right to collect such royalties.
Section 3 -- License Conditions.
Your exercise of the Licensed Rights is expressly made subject to the
following conditions.
a. Attribution.
1. If You Share the Licensed Material (including in modified
form), You must:
a. retain the following if it is supplied by the Licensor
with the Licensed Material:
i. identification of the creator(s) of the Licensed
Material and any others designated to receive
attribution, in any reasonable manner requested by
the Licensor (including by pseudonym if
designated);
ii. a copyright notice;
iii. a notice that refers to this Public License;
iv. a notice that refers to the disclaimer of
warranties;
v. a URI or hyperlink to the Licensed Material to the
extent reasonably practicable;
b. indicate if You modified the Licensed Material and
retain an indication of any previous modifications; and
c. indicate the Licensed Material is licensed under this
Public License, and include the text of, or the URI or
hyperlink to, this Public License.
2. You may satisfy the conditions in Section 3(a)(1) in any
reasonable manner based on the medium, means, and context in
which You Share the Licensed Material. For example, it may be
reasonable to satisfy the conditions by providing a URI or
hyperlink to a resource that includes the required
information.
3. If requested by the Licensor, You must remove any of the
information required by Section 3(a)(1)(A) to the extent
reasonably practicable.
4. If You Share Adapted Material You produce, the Adapter's
License You apply must not prevent recipients of the Adapted
Material from complying with this Public License.
Section 4 -- Sui Generis Database Rights.
Where the Licensed Rights include Sui Generis Database Rights that
apply to Your use of the Licensed Material:
a. for the avoidance of doubt, Section 2(a)(1) grants You the right
to extract, reuse, reproduce, and Share all or a substantial
portion of the contents of the database;
b. if You include all or a substantial portion of the database
contents in a database in which You have Sui Generis Database
Rights, then the database in which You have Sui Generis Database
Rights (but not its individual contents) is Adapted Material; and
c. You must comply with the conditions in Section 3(a) if You Share
all or a substantial portion of the contents of the database.
For the avoidance of doubt, this Section 4 supplements and does not
replace Your obligations under this Public License where the Licensed
Rights include other Copyright and Similar Rights.
Section 5 -- Disclaimer of Warranties and Limitation of Liability.
a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
c. The disclaimer of warranties and limitation of liability provided
above shall be interpreted in a manner that, to the extent
possible, most closely approximates an absolute disclaimer and
waiver of all liability.
Section 6 -- Term and Termination.
a. This Public License applies for the term of the Copyright and
Similar Rights licensed here. However, if You fail to comply with
this Public License, then Your rights under this Public License
terminate automatically.
b. Where Your right to use the Licensed Material has terminated under
Section 6(a), it reinstates:
1. automatically as of the date the violation is cured, provided
it is cured within 30 days of Your discovery of the
violation; or
2. upon express reinstatement by the Licensor.
For the avoidance of doubt, this Section 6(b) does not affect any
right the Licensor may have to seek remedies for Your violations
of this Public License.
c. For the avoidance of doubt, the Licensor may also offer the
Licensed Material under separate terms or conditions or stop
distributing the Licensed Material at any time; however, doing so
will not terminate this Public License.
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
License.
Section 7 -- Other Terms and Conditions.
a. The Licensor shall not be bound by any additional or different
terms or conditions communicated by You unless expressly agreed.
b. Any arrangements, understandings, or agreements regarding the
Licensed Material not stated herein are separate from and
independent of the terms and conditions of this Public License.
Section 8 -- Interpretation.
a. For the avoidance of doubt, this Public License does not, and
shall not be interpreted to, reduce, limit, restrict, or impose
conditions on any use of the Licensed Material that could lawfully
be made without permission under this Public License.
b. To the extent possible, if any provision of this Public License is
deemed unenforceable, it shall be automatically reformed to the
minimum extent necessary to make it enforceable. If the provision
cannot be reformed, it shall be severed from this Public License
without affecting the enforceability of the remaining terms and
conditions.
c. No term or condition of this Public License will be waived and no
failure to comply consented to unless expressly agreed to by the
Licensor.
d. Nothing in this Public License constitutes or may be interpreted
as a limitation upon, or waiver of, any privileges and immunities
that apply to the Licensor or You, including from the legal
processes of any jurisdiction or authority.
=======================================================================
Creative Commons is not a party to its public licenses.
Notwithstanding, Creative Commons may elect to apply one of its public
licenses to material it publishes and in those instances will be
considered the "Licensor." Except for the limited purpose of indicating
that material is shared under a Creative Commons public license or as
otherwise permitted by the Creative Commons policies published at
creativecommons.org/policies, Creative Commons does not authorize the
use of the trademark "Creative Commons" or any other trademark or logo
of Creative Commons without its prior written consent including,
without limitation, in connection with any unauthorized modifications
to any of its public licenses or any other arrangements,
understandings, or agreements concerning use of licensed material. For
the avoidance of doubt, this paragraph does not form part of the public
licenses.
Creative Commons may be contacted at creativecommons.org.

9
LICENSE-examples Normal file
View File

@@ -0,0 +1,9 @@
The examples provided by Facebook are for non-commercial testing and evaluation
purposes only. Facebook reserves all rights not expressly granted.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

23
PATENTS Normal file
View File

@@ -0,0 +1,23 @@
Additional Grant of Patent Rights
"Software" means the React software distributed by Facebook, Inc.
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 Facebooks 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,
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.

View File

@@ -1,26 +1,25 @@
# [React](http://facebook.github.io/react) [![Build Status](https://travis-ci.org/facebook/react.png?branch=master)](https://travis-ci.org/facebook/react)
# [React](http://facebook.github.io/react) [![Build Status](https://travis-ci.org/facebook/react.svg?branch=master)](https://travis-ci.org/facebook/react)
React is a JavaScript library for building user interfaces.
* **Declarative:** React uses a declarative paradigm that makes it easier to reason about your application.
* **Efficient:** React computes the minimal set of changes necessary to keep your DOM up-to-date.
* **Flexible:** React works with the libraries and frameworks that you already know.
* **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 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.
[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](http://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
/** @jsx React.DOM */
var HelloMessage = React.createClass({
render: function() {
return <div>{'Hello ' + this.props.name}</div>;
return <div>Hello {this.props.name}</div>;
}
});
React.renderComponent(
React.render(
<HelloMessage name="John" />,
document.getElementById('container')
);
@@ -28,20 +27,20 @@ React.renderComponent(
This example will render "Hello John" into a container on the page.
You'll notice that we used an XML-like syntax; [we call it JSX](http://facebook.github.io/react/docs/syntax.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
The fastest way to get started is to serve JavaScript from the CDN:
The fastest way to get started is to serve JavaScript from the CDN (also available on [cdnjs](https://cdnjs.com/libraries/react) and [jsdelivr](http://www.jsdelivr.com/#!react)):
```html
<!-- The core React library -->
<script src="http://fb.me/react-0.3.2.min.js"></script>
<script src="http://fb.me/react-0.12.2.js"></script>
<!-- In-browser JSX transformer, remove when pre-compiling JSX. -->
<script src="http://fb.me/JSXTransformer-0.3.2.js"></script>
<script src="http://fb.me/JSXTransformer-0.12.2.js"></script>
```
We've also built a [starter kit](http://facebook.github.io/react/downloads/react-0.3.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.
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:
@@ -51,7 +50,7 @@ bower install --save react
## Contribute
The main purpose of this repository is to continue to evolve React core, making it faster and easier to use. If you're interested in helping with that, then keep reading. If you're not interested in helping right now that's ok too :) Any feedback you have about using React would be greatly appreciated.
The main purpose of this repository is to continue to evolve React core, making it faster and easier to use. If you're interested in helping with that, then keep reading. If you're not interested in helping right now that's ok too. :) Any feedback you have about using React would be greatly appreciated.
### Building Your Copy of React
@@ -81,16 +80,26 @@ At this point, you should now have a `build/` directory populated with everythin
We use grunt to automate many tasks. Run `grunt -h` to see a mostly complete listing. The important ones to know:
```sh
# Create test build & run tests with PhantomJS
# Build and run tests with PhantomJS
grunt test
# Lint the core library code with JSHint
# Build and run tests in your browser
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
grunt lint
# Lint package code
grunt lint:package
# Wipe out build directory
grunt clean
```
### License
React is [BSD licensed](./LICENSE). We also provide an additional [patent grant](./PATENTS).
React documentation is [Creative Commons licensed](./LICENSE-docs).
Examples provided in this repository and in the documentation are [separately licensed](./LICENSE-examples).
### More…
There's only so much we can cram in here. To read more about the community and guidelines for submitting pull requests, please read the [Contributing document](CONTRIBUTING.md).

83
bin/jsx
View File

@@ -1,42 +1,51 @@
#!/usr/bin/env node
"use strict";
// -*- mode: js -*-
'use strict';
var visitors = require('../vendor/fbtransform/visitors').transformVisitors;
var transform = require('../vendor/fbtransform/lib/transform').transform;
var debranch = require("../vendor/woodchipper").debranch;
require("commoner").resolve(function(id) {
var context = this;
// Note that the result of context.getProvidedP() is cached for the
// duration of the build, so it is both consistent and cheap to
// evaluate multiple times.
return context.getProvidedP().then(function(idToPath) {
// If a module declares its own identifier using @providesModule
// then that identifier will be a key in the idToPath object.
if (idToPath.hasOwnProperty(id)) {
return context.readFileP(idToPath[id]);
}
// Otherwise assume the identifier maps directly to a path in the
// filesystem.
return context.readModuleP(id);
});
}).process(function(id, source) {
var context = this;
var transform = require('../main').transform;
require('commoner').version(
require('../package.json').version
).resolve(function(id) {
return this.readModuleP(id);
}).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.
source = transform(visitors.react, source).code;
return context.makePromise(function(callback) {
var constants = context.config.constants || {};
// Debranching means removing any obviously dead code after
// replacing constant conditional expressions with literal
// (boolean) values.
debranch(constants, source, function(source) {
callback(null, source);
});
});
// 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
};
return transform(source, options);
});

57
bin/jsx-internal Executable file
View File

@@ -0,0 +1,57 @@
#!/usr/bin/env node
// -*- mode: js -*-
"use strict";
var transform = require('../main').transform;
var propagate = require("../vendor/constants").propagate;
require("commoner").version(
require("../package.json").version
).resolve(function(id) {
var context = this;
// Note that the result of context.getProvidedP() is cached for the
// duration of the build, so it is both consistent and cheap to
// evaluate multiple times.
return context.getProvidedP().then(function(idToPath) {
// If a module declares its own identifier using @providesModule
// then that identifier will be a key in the idToPath object.
if (idToPath.hasOwnProperty(id)) {
return context.readFileP(idToPath[id]);
}
// Otherwise assume the identifier maps directly to a path in the
// filesystem.
return context.readModuleP(id);
});
}).process(function(id, source) {
var context = this;
var constants = context.config.constants || {};
// This is where JSX, ES6, etc. desugaring happens.
source = transform(source, {harmony: true, stripTypes: true});
// Constant propagation means removing any obviously dead code after
// replacing constant expressions with literal (boolean) values.
source = propagate(constants, source);
if (context.config.mocking) {
// Make sure there is exactly one newline at the end of the module.
source = source.replace(/\s+$/m, "\n");
return context.getProvidedP().then(function(idToPath) {
if (id !== "mock-modules" &&
id !== "mocks" &&
id !== "test/all" &&
idToPath.hasOwnProperty("mock-modules")) {
return source + '\nrequire("mock-modules").register(' +
JSON.stringify(id) + ', module);\n';
}
return source;
});
}
return source;
});

8
docs/404.md Normal file
View File

@@ -0,0 +1,8 @@
---
layout: single
title: Page Not Found
---
We couldn't find what you were looking for.
Please contact the owner of the site that linked you to the original URL and let them know their link is broken.

View File

@@ -1,16 +1,19 @@
source 'https://rubygems.org'
gem 'rake'
# jekyll, which builds it all
gem 'jekyll', '~>1.0'
# 2.0 includes sass processing
gem 'jekyll', '~>2.0'
# Auto redirect pages
gem 'jekyll-redirect-from'
# JSON
gem 'json'
# SASS for CSS
gem 'sass'
# For `rake watch`
gem 'rb-fsevent'
# Redcarpet for Markdown
gem 'redcarpet'
# For markdown header cleanup
gem 'sanitize', '~>2.0'

View File

@@ -1,46 +1,82 @@
GEM
remote: https://rubygems.org/
specs:
classifier (1.3.3)
blankslate (2.1.2.4)
celluloid (0.15.2)
timers (~> 1.1.0)
classifier (1.3.4)
fast-stemmer (>= 1.0.0)
coffee-script (2.3.0)
coffee-script-source
execjs
coffee-script-source (1.7.1)
colorator (0.1)
commander (4.1.3)
highline (~> 1.6.11)
directory_watcher (1.4.1)
execjs (2.2.1)
fast-stemmer (1.0.2)
highline (1.6.19)
jekyll (1.0.2)
ffi (1.9.3)
jekyll (2.2.0)
classifier (~> 1.3)
colorator (~> 0.1)
commander (~> 4.1.3)
directory_watcher (~> 1.4.1)
kramdown (~> 1.0.2)
liquid (~> 2.3)
maruku (~> 0.5)
pygments.rb (~> 0.5.0)
safe_yaml (~> 0.7.0)
json (1.8.0)
kramdown (1.0.2)
liquid (2.5.0)
maruku (0.6.1)
syntax (>= 1.0.0)
posix-spawn (0.3.6)
pygments.rb (0.5.0)
jekyll-coffeescript (~> 1.0)
jekyll-gist (~> 1.0)
jekyll-paginate (~> 1.0)
jekyll-sass-converter (~> 1.0)
jekyll-watch (~> 1.0)
kramdown (~> 1.3)
liquid (~> 2.6.1)
mercenary (~> 0.3.3)
pygments.rb (~> 0.6.0)
redcarpet (~> 3.1)
safe_yaml (~> 1.0)
toml (~> 0.1.0)
jekyll-coffeescript (1.0.0)
coffee-script (~> 2.2)
jekyll-gist (1.1.0)
jekyll-paginate (1.0.0)
jekyll-redirect-from (0.5.0)
jekyll (~> 2.0)
jekyll-sass-converter (1.2.0)
sass (~> 3.2)
jekyll-watch (1.1.0)
listen (~> 2.7)
json (1.8.1)
kramdown (1.4.1)
liquid (2.6.1)
listen (2.7.9)
celluloid (>= 0.15.2)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
mercenary (0.3.4)
mini_portile (0.6.0)
nokogiri (1.6.3.1)
mini_portile (= 0.6.0)
parslet (1.5.0)
blankslate (~> 2.0)
posix-spawn (0.3.9)
pygments.rb (0.6.0)
posix-spawn (~> 0.3.6)
yajl-ruby (~> 1.1.0)
rb-fsevent (0.9.3)
redcarpet (2.2.2)
safe_yaml (0.7.1)
sass (3.2.9)
syntax (1.0.0)
rake (10.3.2)
rb-fsevent (0.9.4)
rb-inotify (0.9.5)
ffi (>= 0.5.0)
redcarpet (3.1.2)
safe_yaml (1.0.4)
sanitize (2.0.6)
nokogiri (>= 1.4.4)
sass (3.3.14)
timers (1.1.0)
toml (0.1.1)
parslet (~> 1.5.0)
yajl-ruby (1.1.0)
PLATFORMS
ruby
DEPENDENCIES
jekyll (~> 1.0)
jekyll (~> 2.0)
jekyll-redirect-from
json
rake
rb-fsevent
redcarpet
sass
sanitize (~> 2.0)

View File

@@ -21,6 +21,7 @@ Once you have RubyGems and installed Bundler (via `gem install bundler`), use it
```sh
$ cd react/docs
$ bundle install # Might need sudo.
$ npm install # Might need sudo.
```
### Instructions
@@ -31,8 +32,8 @@ Use Jekyll to serve the website locally (by default, at `http://localhost:4000`)
```sh
$ cd react/docs
$ rake
$ jekyll serve -w
$ bundle exec rake
$ bundle exec jekyll serve -w
$ open http://localhost:4000/react/
```
@@ -42,19 +43,24 @@ If you want to modify the CSS or JS, use [Rake](http://rake.rubyforge.org/) to c
```sh
$ cd react/docs
$ rake watch # Automatically compiles as needed.
# rake Manually compile CSS and JS.
# rake css Manually compile CSS, only.
# rake js Manually compile JS, only.
$ bundle exec rake watch # Automatically compiles as needed.
# bundle exec rake Manually compile CSS and JS.
# bundle exec rake js Manually compile JS, only.
```
## Afterthoughts
### 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 relase tag in the main repository.
**Note:** This should only be done for new releases. You should create a tag corresponding to the release tag in the main repository.
We also have a rake task that does the same thing (without creating commits). It expects the directory structure mentioned above.
```sh
$ bundle exec rake release
```
### Removing the Jekyll / Ruby Dependency

View File

@@ -2,20 +2,14 @@ require('rubygems')
require('json')
require('yaml')
desc "generate css from sass"
task :css do
system "sass --style=compressed _css/react.scss css/react.css"
end
desc "generate js from jsx"
task :js do
system "../bin/jsx _js js"
system "../bin/jsx --harmony _js js"
end
desc "watch css & js"
task :watch => [:update_version] do
Process.spawn "sass --style=compressed --watch _css/react.scss:css/react.css"
Process.spawn "../bin/jsx --watch _js js"
desc "watch js"
task :watch do
Process.spawn "../bin/jsx --watch --harmony _js js"
Process.waitall
end
@@ -29,9 +23,19 @@ task :update_version do
end
end
desc "update acknowledgements list"
task :update_acknowledgements do
authors = File.readlines('../AUTHORS').map {|author| author.gsub(/ <.*\n/,'')}
# split into cols here because nobody knows how to use liquid
# need to to_f because ruby will keep slice_size as int and round on its own
slice_size = (authors.size / 3.to_f).ceil
cols = authors.each_slice(slice_size).to_a
File.open('_data/acknowledgements.yml', 'w+') { |f| f.write(cols.to_yaml) }
end
desc "build into ../../react-gh-pages"
task :release => [:default] do
task :release => [:update_version, :default] do
system "jekyll build -d ../../react-gh-pages"
end
task :default => [:update_version, :css, :js]
task :default => [:js]

View File

@@ -1,17 +1,37 @@
---
markdown: redcarpet
name: React
description: A JavaScript library for building user interfaces
redcarpet:
extensions:
- fenced_code_blocks
react_version: 0.3.2
pygments: true
url: http://facebook.github.io
baseurl: "/react"
permalink: "/blog/:year/:month/:day/:title.html"
paginate_path: "/blog/page:num/"
relative_permalinks: true
paginate: 5
timezone: America/Los_Angeles
highlighter: pygments
defaults:
- scope:
path: ''
type: post
values:
layout: post
- scope:
path: docs
type: page
values:
layout: docs
exclude:
- Gemfile
- Gemfile.lock
- README.md
- Rakefile
url: http://facebook.github.io
baseurl: /react
permalink: /blog/:year/:month/:day/:title.html
markdown: redcarpet
redcarpet:
extensions:
- fenced_code_blocks
sass:
style: :compressed
sass_dir: _css
gems:
- jekyll-redirect-from
react_version: 0.13.0-rc1

View File

@@ -6,7 +6,6 @@ $textColorLight: lighten($textColor, 20%);
html {
font-family: $helvetica;
font-family: proxima-nova, $helvetica;
font-weight: 300;
color: $textColor;
line-height: 1.28;
}
@@ -132,5 +131,3 @@ a {
.center {
text-align: center;
}

View File

@@ -2,12 +2,7 @@
// These mixins/functions are deprecated
// They will be removed in the next MAJOR version release
//************************************************************************//
@mixin box-shadow ($shadows...) {
@include prefixer(box-shadow, $shadows, spec);
@warn "box-shadow is deprecated and will be removed in the next major version release";
}
@mixin background-size ($lengths...) {
@include prefixer(background-size, $lengths, spec);
@warn "background-size is deprecated and will be removed in the next major version release";
@mixin inline-block {
display: inline-block;
@warn "inline-block mixin is deprecated and will be removed in the next major version release";
}

View File

@@ -1,22 +1,36 @@
// Settings
@import "settings/prefixer";
@import "settings/px-to-em";
@import "settings/asset-pipeline";
// Custom Helpers
@import "helpers/deprecated-webkit-gradient";
@import "helpers/convert-units";
@import "helpers/gradient-positions-parser";
@import "helpers/is-num";
@import "helpers/linear-angle-parser";
@import "helpers/linear-gradient-parser";
@import "helpers/linear-positions-parser";
@import "helpers/linear-side-corner-parser";
@import "helpers/radial-arg-parser";
@import "helpers/radial-positions-parser";
@import "helpers/radial-gradient-parser";
@import "helpers/render-gradients";
@import "helpers/shape-size-stripper";
@import "helpers/str-to-num";
// Custom Functions
@import "functions/compact";
@import "functions/assign";
@import "functions/color-lightness";
@import "functions/flex-grid";
@import "functions/golden-ratio";
@import "functions/grid-width";
@import "functions/linear-gradient";
@import "functions/modular-scale";
@import "functions/px-to-em";
@import "functions/radial-gradient";
@import "functions/px-to-rem";
@import "functions/strip-units";
@import "functions/tint-shade";
@import "functions/transition-property-name";
@import "functions/unpack";
// CSS3 Mixins
@import "css3/animation";
@@ -27,12 +41,15 @@
@import "css3/border-image";
@import "css3/border-radius";
@import "css3/box-sizing";
@import "css3/calc";
@import "css3/columns";
@import "css3/filter";
@import "css3/flex-box";
@import "css3/font-face";
@import "css3/font-feature-settings";
@import "css3/hyphens";
@import "css3/hidpi-media-query";
@import "css3/image-rendering";
@import "css3/inline-block";
@import "css3/keyframes";
@import "css3/linear-gradient";
@import "css3/perspective";
@@ -45,6 +62,8 @@
// Addons & other mixins
@import "addons/button";
@import "addons/clearfix";
@import "addons/directional-values";
@import "addons/ellipsis";
@import "addons/font-family";
@import "addons/hide-text";
@import "addons/html5-input-types";
@@ -54,6 +73,7 @@
@import "addons/size";
@import "addons/timing-functions";
@import "addons/triangle";
@import "addons/word-wrap";
// Soon to be deprecated Mixins
@import "bourbon-deprecated-upcoming";

View File

@@ -1,38 +1,51 @@
@mixin button ($style: simple, $base-color: #4294f0) {
@mixin button ($style: simple, $base-color: #4294f0, $text-size: inherit, $padding: 7px 18px) {
@if type-of($style) == color {
@if type-of($style) == string and type-of($base-color) == color {
@include buttonstyle($style, $base-color, $text-size, $padding);
}
@if type-of($style) == string and type-of($base-color) == number {
$padding: $text-size;
$text-size: $base-color;
$base-color: #4294f0;
@if $padding == inherit {
$padding: 7px 18px;
}
@include buttonstyle($style, $base-color, $text-size, $padding);
}
@if type-of($style) == color and type-of($base-color) == color {
$base-color: $style;
$style: simple;
@include buttonstyle($style, $base-color, $text-size, $padding);
}
// Grayscale button
@if $base-color == grayscale($base-color) {
@if $style == simple {
@include simple($base-color, $grayscale: true);
@if type-of($style) == color and type-of($base-color) == number {
$padding: $text-size;
$text-size: $base-color;
$base-color: $style;
$style: simple;
@if $padding == inherit {
$padding: 7px 18px;
}
@else if $style == shiny {
@include shiny($base-color, $grayscale: true);
}
@else if $style == pill {
@include pill($base-color, $grayscale: true);
}
@include buttonstyle($style, $base-color, $text-size, $padding);
}
// Colored button
@else {
@if $style == simple {
@include simple($base-color);
@if type-of($style) == number {
$padding: $base-color;
$text-size: $style;
$base-color: #4294f0;
$style: simple;
@if $padding == #4294f0 {
$padding: 7px 18px;
}
@else if $style == shiny {
@include shiny($base-color);
}
@else if $style == pill {
@include pill($base-color);
}
@include buttonstyle($style, $base-color, $text-size, $padding);
}
&:disabled {
@@ -42,16 +55,55 @@
}
// Selector Style Button
//************************************************************************//
@mixin buttonstyle($type, $b-color, $t-size, $pad) {
// Grayscale button
@if $type == simple and $b-color == grayscale($b-color) {
@include simple($b-color, true, $t-size, $pad);
}
@if $type == shiny and $b-color == grayscale($b-color) {
@include shiny($b-color, true, $t-size, $pad);
}
@if $type == pill and $b-color == grayscale($b-color) {
@include pill($b-color, true, $t-size, $pad);
}
@if $type == flat and $b-color == grayscale($b-color) {
@include flat($b-color, true, $t-size, $pad);
}
// Colored button
@if $type == simple {
@include simple($b-color, false, $t-size, $pad);
}
@else if $type == shiny {
@include shiny($b-color, false, $t-size, $pad);
}
@else if $type == pill {
@include pill($b-color, false, $t-size, $pad);
}
@else if $type == flat {
@include flat($b-color, false, $t-size, $pad);
}
}
// Simple Button
//************************************************************************//
@mixin simple($base-color, $grayscale: false) {
@mixin simple($base-color, $grayscale: false, $textsize: inherit, $padding: 7px 18px) {
$color: hsl(0, 0, 100%);
$border: adjust-color($base-color, $saturation: 9%, $lightness: -14%);
$inset-shadow: adjust-color($base-color, $saturation: -8%, $lightness: 15%);
$stop-gradient: adjust-color($base-color, $saturation: 9%, $lightness: -11%);
$text-shadow: adjust-color($base-color, $saturation: 15%, $lightness: -18%);
@if lightness($base-color) > 70% {
@if is-light($base-color) {
$color: hsl(0, 0, 20%);
$text-shadow: adjust-color($base-color, $saturation: 10%, $lightness: 4%);
}
@@ -68,10 +120,10 @@
box-shadow: inset 0 1px 0 0 $inset-shadow;
color: $color;
display: inline-block;
font-size: 11px;
font-size: $textsize;
font-weight: bold;
@include linear-gradient ($base-color, $stop-gradient);
padding: 7px 18px;
padding: $padding;
text-decoration: none;
text-shadow: 0 1px 0 $text-shadow;
background-clip: padding-box;
@@ -92,7 +144,8 @@
@include linear-gradient ($base-color-hover, $stop-gradient-hover);
}
&:active:not(:disabled) {
&:active:not(:disabled),
&:focus:not(:disabled) {
$border-active: adjust-color($base-color, $saturation: 9%, $lightness: -14%);
$inset-shadow-active: adjust-color($base-color, $saturation: 7%, $lightness: -17%);
@@ -102,14 +155,14 @@
}
border: 1px solid $border-active;
box-shadow: inset 0 0 8px 4px $inset-shadow-active, inset 0 0 8px 4px $inset-shadow-active, 0 1px 1px 0 #eee;
box-shadow: inset 0 0 8px 4px $inset-shadow-active, inset 0 0 8px 4px $inset-shadow-active;
}
}
// Shiny Button
//************************************************************************//
@mixin shiny($base-color, $grayscale: false) {
@mixin shiny($base-color, $grayscale: false, $textsize: inherit, $padding: 7px 18px) {
$color: hsl(0, 0, 100%);
$border: adjust-color($base-color, $red: -117, $green: -111, $blue: -81);
$border-bottom: adjust-color($base-color, $red: -126, $green: -127, $blue: -122);
@@ -119,7 +172,7 @@
$text-shadow: adjust-color($base-color, $red: -140, $green: -141, $blue: -114);
$third-stop: adjust-color($base-color, $red: -86, $green: -75, $blue: -48);
@if lightness($base-color) > 70% {
@if is-light($base-color) {
$color: hsl(0, 0, 20%);
$text-shadow: adjust-color($base-color, $saturation: 10%, $lightness: 4%);
}
@@ -140,10 +193,10 @@
box-shadow: inset 0 1px 0 0 $inset-shadow;
color: $color;
display: inline-block;
font-size: 14px;
font-size: $textsize;
font-weight: bold;
@include linear-gradient(top, $base-color 0%, $second-stop 50%, $third-stop 50%, $fourth-stop 100%);
padding: 8px 20px;
padding: $padding;
text-align: center;
text-decoration: none;
text-shadow: 0 -1px 1px $text-shadow;
@@ -168,21 +221,22 @@
$fourth-stop-hover 100%);
}
&:active:not(:disabled) {
&:active:not(:disabled),
&:focus:not(:disabled) {
$inset-shadow-active: adjust-color($base-color, $red: -111, $green: -116, $blue: -122);
@if $grayscale == true {
$inset-shadow-active: grayscale($inset-shadow-active);
}
box-shadow: inset 0 0 20px 0 $inset-shadow-active, 0 1px 0 #fff;
box-shadow: inset 0 0 20px 0 $inset-shadow-active;
}
}
// Pill Button
//************************************************************************//
@mixin pill($base-color, $grayscale: false) {
@mixin pill($base-color, $grayscale: false, $textsize: inherit, $padding: 7px 18px) {
$color: hsl(0, 0, 100%);
$border-bottom: adjust-color($base-color, $hue: 8, $saturation: -11%, $lightness: -26%);
$border-sides: adjust-color($base-color, $hue: 4, $saturation: -21%, $lightness: -21%);
@@ -191,7 +245,7 @@
$stop-gradient: adjust-color($base-color, $hue: 8, $saturation: 14%, $lightness: -10%);
$text-shadow: adjust-color($base-color, $hue: 5, $saturation: -19%, $lightness: -15%);
@if lightness($base-color) > 70% {
@if is-light($base-color) {
$color: hsl(0, 0, 20%);
$text-shadow: adjust-color($base-color, $saturation: 10%, $lightness: 4%);
}
@@ -208,14 +262,14 @@
border: 1px solid $border-top;
border-color: $border-top $border-sides $border-bottom;
border-radius: 16px;
box-shadow: inset 0 1px 0 0 $inset-shadow, 0 1px 2px 0 #b3b3b3;
box-shadow: inset 0 1px 0 0 $inset-shadow;
color: $color;
display: inline-block;
font-size: 11px;
font-size: $textsize;
font-weight: normal;
line-height: 1;
@include linear-gradient ($base-color, $stop-gradient);
padding: 5px 16px;
padding: $padding;
text-align: center;
text-decoration: none;
text-shadow: 0 -1px 1px $text-shadow;
@@ -249,7 +303,8 @@
background-clip: padding-box;
}
&:active:not(:disabled) {
&:active:not(:disabled),
&:focus:not(:disabled) {
$active-color: adjust-color($base-color, $hue: 4, $saturation: -12%, $lightness: -10%);
$border-active: adjust-color($base-color, $hue: 6, $saturation: -2.5%, $lightness: -30%);
$border-bottom-active: adjust-color($base-color, $hue: 11, $saturation: 6%, $lightness: -31%);
@@ -267,7 +322,53 @@
background: $active-color;
border: 1px solid $border-active;
border-bottom: 1px solid $border-bottom-active;
box-shadow: inset 0 0 6px 3px $inset-shadow-active, 0 1px 0 0 #fff;
box-shadow: inset 0 0 6px 3px $inset-shadow-active;
text-shadow: 0 -1px 1px $text-shadow-active;
}
}
// Flat Button
//************************************************************************//
@mixin flat($base-color, $grayscale: false, $textsize: inherit, $padding: 7px 18px) {
$color: hsl(0, 0, 100%);
@if is-light($base-color) {
$color: hsl(0, 0, 20%);
}
background-color: $base-color;
border-radius: 3px;
border: none;
color: $color;
display: inline-block;
font-size: inherit;
font-weight: bold;
padding: 7px 18px;
text-decoration: none;
background-clip: padding-box;
&:hover:not(:disabled){
$base-color-hover: adjust-color($base-color, $saturation: 4%, $lightness: 5%);
@if $grayscale == true {
$base-color-hover: grayscale($base-color-hover);
}
background-color: $base-color-hover;
cursor: pointer;
}
&:active:not(:disabled),
&:focus:not(:disabled) {
$base-color-active: adjust-color($base-color, $saturation: -4%, $lightness: -5%);
@if $grayscale == true {
$base-color-active: grayscale($base-color-active);
}
background-color: $base-color-active;
cursor: pointer;
}
}

View File

@@ -1,4 +1,4 @@
// Micro clearfix provides an easy way to contain floats without adding additional markup
// Modern micro clearfix provides an easy way to contain floats without adding additional markup.
//
// Example usage:
//
@@ -12,18 +12,12 @@
// }
@mixin clearfix {
*zoom: 1;
&:before,
&:after {
content: " ";
display: table;
}
&:after {
clear: both;
content:"";
display:table;
clear:both;
}
}
// Acknowledgements
// Micro clearfix: [Nicolas Gallagher](http://nicolasgallagher.com/micro-clearfix-hack/)
// Beat *that* clearfix: [Thierry Koblentz](http://www.css-101.org/articles/clearfix/latest-new-clearfix-so-far.php)

View File

@@ -0,0 +1,111 @@
// directional-property mixins are shorthands
// for writing properties like the following
//
// @include margin(null 0 10px);
// ------
// margin-right: 0;
// margin-bottom: 10px;
// margin-left: 0;
//
// - or -
//
// @include border-style(dotted null);
// ------
// border-top-style: dotted;
// border-bottom-style: dotted;
//
// ------
//
// Note: You can also use false instead of null
@function collapse-directionals($vals) {
$output: null;
$A: nth( $vals, 1 );
$B: if( length($vals) < 2, $A, nth($vals, 2));
$C: if( length($vals) < 3, $A, nth($vals, 3));
$D: if( length($vals) < 2, $A, nth($vals, if( length($vals) < 4, 2, 4) ));
@if $A == 0 { $A: 0 }
@if $B == 0 { $B: 0 }
@if $C == 0 { $C: 0 }
@if $D == 0 { $D: 0 }
@if $A == $B and $A == $C and $A == $D { $output: $A }
@else if $A == $C and $B == $D { $output: $A $B }
@else if $B == $D { $output: $A $B $C }
@else { $output: $A $B $C $D }
@return $output;
}
@function contains-falsy($list) {
@each $item in $list {
@if not $item {
@return true;
}
}
@return false;
}
@mixin directional-property($pre, $suf, $vals) {
// Property Names
$top: $pre + "-top" + if($suf, "-#{$suf}", "");
$bottom: $pre + "-bottom" + if($suf, "-#{$suf}", "");
$left: $pre + "-left" + if($suf, "-#{$suf}", "");
$right: $pre + "-right" + if($suf, "-#{$suf}", "");
$all: $pre + if($suf, "-#{$suf}", "");
$vals: collapse-directionals($vals);
@if contains-falsy($vals) {
@if nth($vals, 1) { #{$top}: nth($vals, 1); }
@if length($vals) == 1 {
@if nth($vals, 1) { #{$right}: nth($vals, 1); }
} @else {
@if nth($vals, 2) { #{$right}: nth($vals, 2); }
}
// prop: top/bottom right/left
@if length($vals) == 2 {
@if nth($vals, 1) { #{$bottom}: nth($vals, 1); }
@if nth($vals, 2) { #{$left}: nth($vals, 2); }
// prop: top right/left bottom
} @else if length($vals) == 3 {
@if nth($vals, 3) { #{$bottom}: nth($vals, 3); }
@if nth($vals, 2) { #{$left}: nth($vals, 2); }
// prop: top right bottom left
} @else if length($vals) == 4 {
@if nth($vals, 3) { #{$bottom}: nth($vals, 3); }
@if nth($vals, 4) { #{$left}: nth($vals, 4); }
}
// prop: top/right/bottom/left
} @else {
#{$all}: $vals;
}
}
@mixin margin($vals...) {
@include directional-property(margin, false, $vals...);
}
@mixin padding($vals...) {
@include directional-property(padding, false, $vals...);
}
@mixin border-style($vals...) {
@include directional-property(border, style, $vals...);
}
@mixin border-color($vals...) {
@include directional-property(border, color, $vals...);
}
@mixin border-width($vals...) {
@include directional-property(border, width, $vals...);
}

View File

@@ -0,0 +1,7 @@
@mixin ellipsis($width: 100%) {
display: inline-block;
max-width: $width;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}

View File

@@ -1,5 +1,5 @@
$georgia: Georgia, Cambria, "Times New Roman", Times, serif;
$helvetica: "Helvetica Neue", Helvetica, Arial, sans-serif;
$helvetica: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
$lucida-grande: "Lucida Grande", Tahoma, Verdana, Arial, sans-serif;
$monospace: "Bitstream Vera Sans Mono", Consolas, Courier, monospace;
$verdana: Verdana, Geneva, sans-serif;

View File

@@ -1,5 +1,10 @@
@mixin hide-text {
color: transparent;
font: 0/0 a;
text-shadow: none;
overflow: hidden;
&:before {
content: "";
display: block;
width: 0;
height: 100%;
}
}

View File

@@ -20,29 +20,19 @@ $inputs-list: 'input[type="email"]',
'input[type="time"]',
'input[type="week"]';
$unquoted-inputs-list: ();
@each $input-type in $inputs-list {
$unquoted-inputs-list: append($unquoted-inputs-list, unquote($input-type), comma);
}
$all-text-inputs: $unquoted-inputs-list;
// Bare inputs
//************************************************************************//
$all-text-inputs: assign-inputs($inputs-list);
// Hover Pseudo-class
//************************************************************************//
$all-text-inputs-hover: ();
@each $input-type in $unquoted-inputs-list {
$input-type-hover: $input-type + ":hover";
$all-text-inputs-hover: append($all-text-inputs-hover, $input-type-hover, comma);
}
$all-text-inputs-hover: assign-inputs($inputs-list, hover);
// Focus Pseudo-class
//************************************************************************//
$all-text-inputs-focus: ();
@each $input-type in $unquoted-inputs-list {
$input-type-focus: $input-type + ":focus";
$all-text-inputs-focus: append($all-text-inputs-focus, $input-type-focus, comma);
}
$all-text-inputs-focus: assign-inputs($inputs-list, focus);
// You must use interpolation on the variable:
// #{$all-text-inputs}
@@ -54,3 +44,43 @@ $all-text-inputs-focus: ();
// #{$all-text-inputs}, textarea {
// border: 1px solid red;
// }
//************************************************************************//
// Generate a variable ($all-button-inputs) with a list of all html5
// input types that have a button-based input, excluding button.
//************************************************************************//
$inputs-button-list: 'input[type="button"]',
'input[type="reset"]',
'input[type="submit"]';
// Bare inputs
//************************************************************************//
$all-button-inputs: assign-inputs($inputs-button-list);
// Hover Pseudo-class
//************************************************************************//
$all-button-inputs-hover: assign-inputs($inputs-button-list, hover);
// Focus Pseudo-class
//************************************************************************//
$all-button-inputs-focus: assign-inputs($inputs-button-list, focus);
// Active Pseudo-class
//************************************************************************//
$all-button-inputs-active: assign-inputs($inputs-button-list, active);
// You must use interpolation on the variable:
// #{$all-button-inputs}
// #{$all-button-inputs-hover}
// #{$all-button-inputs-focus}
// #{$all-button-inputs-active}
// Example
//************************************************************************//
// #{$all-button-inputs}, button {
// border: 1px solid red;
// }

View File

@@ -1,10 +1,12 @@
@mixin position ($position: relative, $coordinates: 0 0 0 0) {
@mixin position ($position: relative, $coordinates: null null null null) {
@if type-of($position) == list {
$coordinates: $position;
$position: relative;
}
$coordinates: unpack($coordinates);
$top: nth($coordinates, 1);
$right: nth($coordinates, 2);
$bottom: nth($coordinates, 3);
@@ -12,31 +14,19 @@
position: $position;
@if $top == auto {
top: $top;
}
@else if not(unitless($top)) {
@if ($top and $top == auto) or (type-of($top) == number) {
top: $top;
}
@if $right == auto {
right: $right;
}
@else if not(unitless($right)) {
@if ($right and $right == auto) or (type-of($right) == number) {
right: $right;
}
@if $bottom == auto {
bottom: $bottom;
}
@else if not(unitless($bottom)) {
@if ($bottom and $bottom == auto) or (type-of($bottom) == number) {
bottom: $bottom;
}
@if $left == auto {
left: $left;
}
@else if not(unitless($left)) {
@if ($left and $left == auto) or (type-of($left) == number) {
left: $left;
}
}

View File

@@ -1,11 +1,7 @@
//************************************************************************//
// Example: @include prefixer(border-radius, $radii, webkit ms spec);
//************************************************************************//
$prefix-for-webkit: true !default;
$prefix-for-mozilla: true !default;
$prefix-for-microsoft: true !default;
$prefix-for-opera: true !default;
$prefix-for-spec: true !default; // required for keyframe mixin
// Variables located in /settings/_prefixer.scss
@mixin prefixer ($property, $value, $prefixes) {
@each $prefix in $prefixes {
@@ -41,9 +37,9 @@ $prefix-for-spec: true !default; // required for keyframe mixin
}
@mixin disable-prefix-for-all() {
$prefix-for-webkit: false;
$prefix-for-mozilla: false;
$prefix-for-microsoft: false;
$prefix-for-opera: false;
$prefix-for-spec: false;
$prefix-for-webkit: false !global;
$prefix-for-mozilla: false !global;
$prefix-for-microsoft: false !global;
$prefix-for-opera: false !global;
$prefix-for-spec: false !global;
}

View File

@@ -1,28 +1,27 @@
@mixin retina-image($filename, $background-size, $extension: png, $retina-filename: null, $asset-pipeline: false) {
@mixin retina-image($filename, $background-size, $extension: png, $retina-filename: null, $retina-suffix: _2x, $asset-pipeline: $asset-pipeline) {
@if $asset-pipeline {
background-image: image_url($filename + "." + $extension);
background-image: image-url("#{$filename}.#{$extension}");
}
@else {
background-image: url($filename + "." + $extension);
background-image: url("#{$filename}.#{$extension}");
}
@include hidpi {
@if $asset-pipeline {
@if $retina-filename {
background-image: image_url($retina-filename + "." + $extension);
background-image: image-url("#{$retina-filename}.#{$extension}");
}
@else {
background-image: image_url($filename + "@2x" + "." + $extension);
background-image: image-url("#{$filename}#{$retina-suffix}.#{$extension}");
}
}
@else {
@if $retina-filename {
background-image: url($retina-filename + "." + $extension);
background-image: url("#{$retina-filename}.#{$extension}");
}
@else {
background-image: url($filename + "@2x" + "." + $extension);
background-image: url("#{$filename}#{$retina-suffix}.#{$extension}");
}
}

View File

@@ -1,44 +1,16 @@
@mixin size($size) {
@if length($size) == 1 {
@if $size == auto {
width: $size;
height: $size;
}
$height: nth($size, 1);
$width: $height;
@else if unitless($size) {
width: $size + px;
height: $size + px;
}
@else if not(unitless($size)) {
width: $size;
height: $size;
}
@if length($size) > 1 {
$height: nth($size, 2);
}
// Width x Height
@if length($size) == 2 {
$width: nth($size, 1);
$height: nth($size, 2);
@if $height == auto or (type-of($height) == number and not unitless($height)) {
height: $height;
}
@if $width == auto {
width: $width;
}
@else if not(unitless($width)) {
width: $width;
}
@else if unitless($width) {
width: $width + px;
}
@if $height == auto {
height: $height;
}
@else if not(unitless($height)) {
height: $height;
}
@else if unitless($height) {
height: $height + px;
}
@if $width == auto or (type-of($width) == number and not unitless($width)) {
width: $width;
}
}

View File

@@ -1,5 +1,5 @@
// CSS cubic-bezier timing functions. Timing functions courtesy of jquery.easie (github.com/jaukia/easie)
// Timing functions are the same as demo'ed here: http://jqueryui.com/demos/effect/easing.html
// Timing functions are the same as demo'ed here: http://jqueryui.com/resources/demos/effect/easing.html
// EASE IN
$ease-in-quad: cubic-bezier(0.550, 0.085, 0.680, 0.530);

View File

@@ -2,44 +2,82 @@
height: 0;
width: 0;
$width: nth($size, 1);
$height: nth($size, length($size));
$foreground-color: nth($color, 1);
$background-color: if(length($color) == 2, nth($color, 2), transparent);
@if ($direction == up) or ($direction == down) or ($direction == right) or ($direction == left) {
border-color: transparent;
border-style: solid;
border-width: $size / 2;
$width: $width / 2;
$height: if(length($size) > 1, $height, $height/2);
@if $direction == up {
border-bottom-color: $color;
border-left: $width solid $background-color;
border-right: $width solid $background-color;
border-bottom: $height solid $foreground-color;
} @else if $direction == right {
border-left-color: $color;
border-top: $width solid $background-color;
border-bottom: $width solid $background-color;
border-left: $height solid $foreground-color;
} @else if $direction == down {
border-top-color: $color;
border-left: $width solid $background-color;
border-right: $width solid $background-color;
border-top: $height solid $foreground-color;
} @else if $direction == left {
border-right-color: $color;
border-top: $width solid $background-color;
border-bottom: $width solid $background-color;
border-right: $height solid $foreground-color;
}
}
@else if ($direction == up-right) or ($direction == up-left) {
border-top: $size solid $color;
border-top: $height solid $foreground-color;
@if $direction == up-right {
border-left: $size solid transparent;
border-left: $width solid $background-color;
} @else if $direction == up-left {
border-right: $size solid transparent;
border-right: $width solid $background-color;
}
}
@else if ($direction == down-right) or ($direction == down-left) {
border-bottom: $size solid $color;
border-bottom: $height solid $foreground-color;
@if $direction == down-right {
border-left: $size solid transparent;
border-left: $width solid $background-color;
} @else if $direction == down-left {
border-right: $size solid transparent;
border-right: $width solid $background-color;
}
}
@else if ($direction == inset-up) {
border-width: $height $width;
border-style: solid;
border-color: $background-color $background-color $foreground-color;
}
@else if ($direction == inset-down) {
border-width: $height $width;
border-style: solid;
border-color: $foreground-color $background-color $background-color;
}
@else if ($direction == inset-right) {
border-width: $width $height;
border-style: solid;
border-color: $background-color $background-color $background-color $foreground-color;
}
@else if ($direction == inset-left) {
border-width: $width $height;
border-style: solid;
border-color: $background-color $foreground-color $background-color $background-color;
}
}

View File

@@ -0,0 +1,8 @@
@mixin word-wrap($wrap: break-word) {
word-wrap: $wrap;
@if $wrap == break-word {
overflow-wrap: break-word;
word-break: break-all;
}
}

View File

@@ -4,45 +4,39 @@
//************************************************************************//
@mixin background-image($images...) {
background-image: _add-prefix($images, webkit);
background-image: _add-prefix($images);
}
$webkit-images: ();
$spec-images: ();
@function _add-prefix($images, $vendor: false) {
$images-prefixed: ();
$gradient-positions: false;
@for $i from 1 through length($images) {
$type: type-of(nth($images, $i)); // Get type of variable - List or String
@each $image in $images {
$webkit-image: ();
$spec-image: ();
// If variable is a list - Gradient
@if $type == list {
$gradient-type: nth(nth($images, $i), 1); // linear or radial
$gradient-pos: null;
$gradient-args: null;
@if (type-of($image) == string) {
$url-str: str-slice($image, 0, 3);
$gradient-type: str-slice($image, 0, 6);
@if ($gradient-type == linear) or ($gradient-type == radial) {
$gradient-pos: nth(nth($images, $i), 2); // Get gradient position
$gradient-args: nth(nth($images, $i), 3); // Get actual gradient (red, blue)
}
@else {
$gradient-args: nth(nth($images, $i), 2); // Get actual gradient (red, blue)
@if $url-str == "url" {
$webkit-image: $image;
$spec-image: $image;
}
$gradient-positions: _gradient-positions-parser($gradient-type, $gradient-pos);
$gradient: _render-gradients($gradient-positions, $gradient-args, $gradient-type, $vendor);
$images-prefixed: append($images-prefixed, $gradient, comma);
}
// If variable is a string - Image
@else if $type == string {
$images-prefixed: join($images-prefixed, nth($images, $i), comma);
@else if $gradient-type == "linear" {
$gradients: _linear-gradient-parser($image);
$webkit-image: map-get($gradients, webkit-image);
$spec-image: map-get($gradients, spec-image);
}
@else if $gradient-type == "radial" {
$gradients: _radial-gradient-parser($image);
$webkit-image: map-get($gradients, webkit-image);
$spec-image: map-get($gradients, spec-image);
}
}
$webkit-images: append($webkit-images, $webkit-image, comma);
$spec-images: append($spec-images, $spec-image, comma);
}
@return $images-prefixed;
}
//Examples:
//@include background-image(linear-gradient(top, orange, red));
//@include background-image(radial-gradient(50% 50%, cover circle, orange, red));
//@include background-image(url("/images/a.png"), linear-gradient(orange, red));
//@include background-image(url("image.png"), linear-gradient(orange, red), url("image.png"));
//@include background-image(linear-gradient(hsla(0, 100%, 100%, 0.25) 0%, hsla(0, 100%, 100%, 0.08) 50%, transparent 50%), linear-gradient(orange, red));
background-image: $webkit-images;
background-image: $spec-images;
}

View File

@@ -3,101 +3,53 @@
// notation.
//************************************************************************//
@mixin background(
$background-1 , $background-2: false,
$background-3: false, $background-4: false,
$background-5: false, $background-6: false,
$background-7: false, $background-8: false,
$background-9: false, $background-10: false,
$fallback: false
) {
$backgrounds: compact($background-1, $background-2,
$background-3, $background-4,
$background-5, $background-6,
$background-7, $background-8,
$background-9, $background-10);
@mixin background($backgrounds...) {
$webkit-backgrounds: ();
$spec-backgrounds: ();
$fallback-color: false;
@if (type-of($fallback) == color) or ($fallback == "transparent") {
$fallback-color: $fallback;
}
@else {
$fallback-color: _extract-background-color($backgrounds);
}
@each $background in $backgrounds {
$webkit-background: ();
$spec-background: ();
$background-type: type-of($background);
@if $fallback-color {
background-color: $fallback-color;
}
background: _background-add-prefix($backgrounds, webkit);
background: _background-add-prefix($backgrounds);
}
@if $background-type == string or list {
$background-str: if($background-type == list, nth($background, 1), $background);
@function _extract-background-color($backgrounds) {
$final-bg-layer: nth($backgrounds, length($backgrounds));
@if type-of($final-bg-layer) == list {
@for $i from 1 through length($final-bg-layer) {
$value: nth($final-bg-layer, $i);
@if type-of($value) == color {
@return $value;
$url-str: str-slice($background-str, 0, 3);
$gradient-type: str-slice($background-str, 0, 6);
@if $url-str == "url" {
$webkit-background: $background;
$spec-background: $background;
}
}
}
@return false;
}
@function _background-add-prefix($backgrounds, $vendor: false) {
$backgrounds-prefixed: ();
@for $i from 1 through length($backgrounds) {
$shorthand: nth($backgrounds, $i); // Get member for current index
$type: type-of($shorthand); // Get type of variable - List (gradient) or String (image)
// If shorthand is a list (gradient)
@if $type == list {
$first-member: nth($shorthand, 1); // Get first member of shorthand
// Linear Gradient
@if index(linear radial, nth($first-member, 1)) {
$gradient-type: nth($first-member, 1); // linear || radial
$gradient-args: false;
$gradient-positions: false;
$shorthand-start: false;
@if type-of($first-member) == list { // Linear gradient plus additional shorthand values - lg(red,orange)repeat,...
$gradient-positions: nth($first-member, 2);
$gradient-args: nth($first-member, 3);
$shorthand-start: 2;
}
@else { // Linear gradient only - lg(red,orange),...
$gradient-positions: nth($shorthand, 2);
$gradient-args: nth($shorthand, 3); // Get gradient (red, blue)
}
$gradient-positions: _gradient-positions-parser($gradient-type, $gradient-positions);
$gradient: _render-gradients($gradient-positions, $gradient-args, $gradient-type, $vendor);
// Append any additional shorthand args to gradient
@if $shorthand-start {
@for $j from $shorthand-start through length($shorthand) {
$gradient: join($gradient, nth($shorthand, $j), space);
}
}
$backgrounds-prefixed: append($backgrounds-prefixed, $gradient, comma);
@else if $gradient-type == "linear" {
$gradients: _linear-gradient-parser("#{$background}");
$webkit-background: map-get($gradients, webkit-image);
$spec-background: map-get($gradients, spec-image);
}
// Image with additional properties
@else if $gradient-type == "radial" {
$gradients: _radial-gradient-parser("#{$background}");
$webkit-background: map-get($gradients, webkit-image);
$spec-background: map-get($gradients, spec-image);
}
@else {
$backgrounds-prefixed: append($backgrounds-prefixed, $shorthand, comma);
$webkit-background: $background;
$spec-background: $background;
}
}
// If shorthand is a simple string (color or image)
@else if $type == string {
$backgrounds-prefixed: join($backgrounds-prefixed, $shorthand, comma);
}
}
@return $backgrounds-prefixed;
}
//Examples:
//@include background(linear-gradient(top, orange, red));
//@include background(radial-gradient(circle at 40% 40%, orange, red));
//@include background(url("/images/a.png") no-repeat, linear-gradient(orange, red));
//@include background(url("image.png") center center, linear-gradient(orange, red), url("image.png"));
@else {
$webkit-background: $background;
$spec-background: $background;
}
$webkit-backgrounds: append($webkit-backgrounds, $webkit-background, comma);
$spec-backgrounds: append($spec-backgrounds, $spec-background, comma);
}
background: $webkit-backgrounds;
background: $spec-backgrounds;
}

View File

@@ -1,48 +1,53 @@
@mixin border-image($images) {
-webkit-border-image: _border-add-prefix($images, webkit);
-moz-border-image: _border-add-prefix($images, moz);
-o-border-image: _border-add-prefix($images, o);
border-image: _border-add-prefix($images);
}
@mixin border-image($borders...) {
$webkit-borders: ();
$spec-borders: ();
@function _border-add-prefix($images, $vendor: false) {
$border-image: null;
$images-type: type-of(nth($images, 1));
$first-var: nth(nth($images, 1), 1); // Get type of Gradient (Linear || radial)
@each $border in $borders {
$webkit-border: ();
$spec-border: ();
$border-type: type-of($border);
// If input is a gradient
@if $images-type == string {
@if ($first-var == "linear") or ($first-var == "radial") {
$gradient-type: nth($images, 1); // Get type of gradient (linear || radial)
$gradient-pos: nth($images, 2); // Get gradient position
$gradient-args: nth($images, 3); // Get actual gradient (red, blue)
$gradient-positions: _gradient-positions-parser($gradient-type, $gradient-pos);
$border-image: _render-gradients($gradient-positions, $gradient-args, $gradient-type, $vendor);
}
// If input is a URL
@else {
$border-image: $images;
}
}
// If input is gradient or url + additional args
@else if $images-type == list {
$type: type-of(nth($images, 1)); // Get type of variable - List or String
@if $border-type == string or list {
$border-str: if($border-type == list, nth($border, 1), $border);
// If variable is a list - Gradient
@if $type == list {
$gradient: nth($images, 1);
$gradient-type: nth($gradient, 1); // Get type of gradient (linear || radial)
$gradient-pos: nth($gradient, 2); // Get gradient position
$gradient-args: nth($gradient, 3); // Get actual gradient (red, blue)
$gradient-positions: _gradient-positions-parser($gradient-type, $gradient-pos);
$border-image: _render-gradients($gradient-positions, $gradient-args, $gradient-type, $vendor);
$url-str: str-slice($border-str, 0, 3);
$gradient-type: str-slice($border-str, 0, 6);
@for $i from 2 through length($images) {
$border-image: append($border-image, nth($images, $i));
@if $url-str == "url" {
$webkit-border: $border;
$spec-border: $border;
}
@else if $gradient-type == "linear" {
$gradients: _linear-gradient-parser("#{$border}");
$webkit-border: map-get($gradients, webkit-image);
$spec-border: map-get($gradients, spec-image);
}
@else if $gradient-type == "radial" {
$gradients: _radial-gradient-parser("#{$border}");
$webkit-border: map-get($gradients, webkit-image);
$spec-border: map-get($gradients, spec-image);
}
@else {
$webkit-border: $border;
$spec-border: $border;
}
}
@else {
$webkit-border: $border;
$spec-border: $border;
}
$webkit-borders: append($webkit-borders, $webkit-border, comma);
$spec-borders: append($spec-borders, $spec-border, comma);
}
@return $border-image;
-webkit-border-image: $webkit-borders;
border-image: $spec-borders;
border-style: solid;
}
//Examples:
@@ -52,4 +57,3 @@
// @include border-image(linear-gradient(45deg, orange, yellow) stretch);
// @include border-image(linear-gradient(45deg, orange, yellow) 20 30 40 50 stretch round);
// @include border-image(radial-gradient(top, cover, orange, yellow, orange));

4
docs/_css/bourbon/css3/_calc.scss vendored Normal file
View File

@@ -0,0 +1,4 @@
@mixin calc($property, $value) {
#{$property}: -webkit-calc(#{$value});
#{$property}: calc(#{$value});
}

View File

@@ -15,7 +15,7 @@
@mixin column-fill($arg: auto) {
// auto || length
@include prefixer(columns-fill, $arg, webkit moz spec);
@include prefixer(column-fill, $arg, webkit moz spec);
}
@mixin column-rule($arg) {

5
docs/_css/bourbon/css3/_filter.scss vendored Normal file
View File

@@ -0,0 +1,5 @@
@mixin filter($function: none) {
// <filter-function> [<filter-function]* | none
@include prefixer(filter, $function, webkit spec);
}

View File

@@ -11,6 +11,7 @@
@mixin display-box {
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox; // IE 10
display: box;
}
@@ -22,16 +23,19 @@
@mixin box-pack($pack: start) {
// start|end|center|justify
@include prefixer(box-pack, $pack, webkit moz spec);
-ms-flex-pack: $pack; // IE 10
}
@mixin box-align($align: stretch) {
// start|end|center|baseline|stretch
@include prefixer(box-align, $align, webkit moz spec);
-ms-flex-align: $align; // IE 10
}
@mixin box-direction($direction: normal) {
// normal|reverse|inherit
@include prefixer(box-direction, $direction, webkit moz spec);
-ms-flex-direction: $direction; // IE 10
}
@mixin box-lines($lines: single) {
@@ -41,12 +45,277 @@
@mixin box-ordinal-group($int: 1) {
@include prefixer(box-ordinal-group, $int, webkit moz spec);
-ms-flex-order: $int; // IE 10
}
@mixin box-flex($value: 0.0) {
@include prefixer(box-flex, $value, webkit moz spec);
-ms-flex: $value; // IE 10
}
@mixin box-flex-group($int: 1) {
@include prefixer(box-flex-group, $int, webkit moz spec);
}
// CSS3 Flexible Box Model and property defaults
// Unified attributes for 2009, 2011, and 2012 flavours.
// 2009 - display (box | inline-box)
// 2011 - display (flexbox | inline-flexbox)
// 2012 - display (flex | inline-flex)
@mixin display($value) {
// flex | inline-flex
@if $value == "flex" {
// 2009
display: -webkit-box;
display: -moz-box;
display: box;
// 2012
display: -webkit-flex;
display: -moz-flex;
display: -ms-flexbox; // 2011 (IE 10)
display: flex;
}
@elseif $value == "inline-flex" {
display: -webkit-inline-box;
display: -moz-inline-box;
display: inline-box;
display: -webkit-inline-flex;
display: -moz-inline-flex;
display: -ms-inline-flexbox;
display: inline-flex;
}
@else {
display: $value;
}
}
// 2009 - box-flex (integer)
// 2011 - flex (decimal | width decimal)
// 2012 - flex (integer integer width)
@mixin flex($value) {
// Grab flex-grow for older browsers.
$flex-grow: nth($value, 1);
// 2009
@include prefixer(box-flex, $flex-grow, webkit moz spec);
// 2011 (IE 10), 2012
@include prefixer(flex, $value, webkit moz ms spec);
}
// 2009 - box-orient ( horizontal | vertical | inline-axis | block-axis)
// - box-direction (normal | reverse)
// 2011 - flex-direction (row | row-reverse | column | column-reverse)
// 2012 - flex-direction (row | row-reverse | column | column-reverse)
@mixin flex-direction($value: row) {
// Alt values.
$value-2009: $value;
$value-2011: $value;
$direction: "normal";
@if $value == row {
$value-2009: horizontal;
}
@elseif $value == "row-reverse" {
$value-2009: horizontal;
$direction: reverse;
}
@elseif $value == column {
$value-2009: vertical;
}
@elseif $value == "column-reverse" {
$value-2009: vertical;
$direction: reverse;
}
// 2009
@include prefixer(box-orient, $value-2009, webkit moz spec);
@if $direction == "reverse" {
@include prefixer(box-direction, $direction, webkit moz spec);
}
// 2012
@include prefixer(flex-direction, $value, webkit moz spec);
// 2011 (IE 10)
-ms-flex-direction: $value;
}
// 2009 - box-lines (single | multiple)
// 2011 - flex-wrap (nowrap | wrap | wrap-reverse)
// 2012 - flex-wrap (nowrap | wrap | wrap-reverse)
@mixin flex-wrap($value: nowrap) {
// Alt values.
$alt-value: $value;
@if $value == nowrap {
$alt-value: single;
}
@elseif $value == wrap {
$alt-value: multiple;
}
@elseif $value == "wrap-reverse" {
$alt-value: multiple;
}
@include prefixer(box-lines, $alt-value, webkit moz spec);
@include prefixer(flex-wrap, $value, webkit moz ms spec);
}
// 2009 - TODO: parse values into flex-direction/flex-wrap
// 2011 - TODO: parse values into flex-direction/flex-wrap
// 2012 - flex-flow (flex-direction || flex-wrap)
@mixin flex-flow($value) {
@include prefixer(flex-flow, $value, webkit moz spec);
}
// 2009 - box-ordinal-group (integer)
// 2011 - flex-order (integer)
// 2012 - order (integer)
@mixin order($int: 0) {
// 2009
@include prefixer(box-ordinal-group, $int, webkit moz spec);
// 2012
@include prefixer(order, $int, webkit moz spec);
// 2011 (IE 10)
-ms-flex-order: $int;
}
// 2012 - flex-grow (number)
@mixin flex-grow($number: 0) {
@include prefixer(flex-grow, $number, webkit moz spec);
-ms-flex-positive: $number;
}
// 2012 - flex-shrink (number)
@mixin flex-shrink($number: 1) {
@include prefixer(flex-shrink, $number, webkit moz spec);
-ms-flex-negative: $number;
}
// 2012 - flex-basis (number)
@mixin flex-basis($width: auto) {
@include prefixer(flex-basis, $width, webkit moz spec);
-ms-flex-preferred-size: $width;
}
// 2009 - box-pack (start | end | center | justify)
// 2011 - flex-pack (start | end | center | justify)
// 2012 - justify-content (flex-start | flex-end | center | space-between | space-around)
@mixin justify-content ($value: flex-start) {
// Alt values.
$alt-value: $value;
@if $value == "flex-start" {
$alt-value: start;
}
@elseif $value == "flex-end" {
$alt-value: end;
}
@elseif $value == "space-between" {
$alt-value: justify;
}
@elseif $value == "space-around" {
$alt-value: center;
}
// 2009
@include prefixer(box-pack, $alt-value, webkit moz spec);
// 2012
@include prefixer(justify-content, $value, webkit moz ms o spec);
// 2011 (IE 10)
-ms-flex-pack: $alt-value;
}
// 2009 - box-align (start | end | center | baseline | stretch)
// 2011 - flex-align (start | end | center | baseline | stretch)
// 2012 - align-items (flex-start | flex-end | center | baseline | stretch)
@mixin align-items($value: stretch) {
$alt-value: $value;
@if $value == "flex-start" {
$alt-value: start;
}
@elseif $value == "flex-end" {
$alt-value: end;
}
// 2009
@include prefixer(box-align, $alt-value, webkit moz spec);
// 2012
@include prefixer(align-items, $value, webkit moz ms o spec);
// 2011 (IE 10)
-ms-flex-align: $alt-value;
}
// 2011 - flex-item-align (auto | start | end | center | baseline | stretch)
// 2012 - align-self (auto | flex-start | flex-end | center | baseline | stretch)
@mixin align-self($value: auto) {
$value-2011: $value;
@if $value == "flex-start" {
$value-2011: start;
}
@elseif $value == "flex-end" {
$value-2011: end;
}
// 2012
@include prefixer(align-self, $value, webkit moz spec);
// 2011 (IE 10)
-ms-flex-item-align: $value-2011;
}
// 2011 - flex-line-pack (start | end | center | justify | distribute | stretch)
// 2012 - align-content (flex-start | flex-end | center | space-between | space-around | stretch)
@mixin align-content($value: stretch) {
$value-2011: $value;
@if $value == "flex-start" {
$value-2011: start;
}
@elseif $value == "flex-end" {
$value-2011: end;
}
@elseif $value == "space-between" {
$value-2011: justify;
}
@elseif $value == "space-around" {
$value-2011: distribute;
}
// 2012
@include prefixer(align-content, $value, webkit moz spec);
// 2011 (IE 10)
-ms-flex-line-pack: $value-2011;
}

View File

@@ -1,6 +1,6 @@
// Order of the includes matters, and it is: normal, bold, italic, bold+italic.
@mixin font-face($font-family, $file-path, $weight: normal, $style: normal, $asset-pipeline: false ) {
@mixin font-face($font-family, $file-path, $weight: normal, $style: normal, $asset-pipeline: $asset-pipeline) {
@font-face {
font-family: $font-family;
font-weight: $weight;

View File

@@ -0,0 +1,10 @@
// Font feature settings mixin and property default.
// Examples: @include font-feature-settings("liga");
// @include font-feature-settings("lnum" false);
// @include font-feature-settings("pnum" 1, "kern" 0);
// @include font-feature-settings("ss01", "ss02");
@mixin font-feature-settings($settings...) {
@if length($settings) == 0 { $settings: none; }
@include prefixer(font-feature-settings, $settings, webkit moz ms spec);
}

4
docs/_css/bourbon/css3/_hyphens.scss vendored Normal file
View File

@@ -0,0 +1,4 @@
@mixin hyphens($hyphenation: none) {
// none | manual | auto
@include prefixer(hyphens, $hyphenation, webkit moz ms spec);
}

View File

@@ -1,10 +1,11 @@
@mixin image-rendering ($mode:optimizeQuality) {
@mixin image-rendering ($mode:auto) {
@if ($mode == optimize-contrast) {
@if ($mode == crisp-edges) {
-ms-interpolation-mode: nearest-neighbor; // IE8+
image-rendering: -moz-crisp-edges;
image-rendering: -o-crisp-edges;
image-rendering: -webkit-optimize-contrast;
image-rendering: optimize-contrast;
image-rendering: crisp-edges;
}
@else {

View File

@@ -1,8 +0,0 @@
// Legacy support for inline-block in IE7 (maybe IE6)
@mixin inline-block {
display: inline-block;
vertical-align: baseline;
zoom: 1;
*display: inline;
*vertical-align: auto;
}

View File

@@ -8,36 +8,28 @@
@if $original-prefix-for-webkit {
@include disable-prefix-for-all();
$prefix-for-webkit: true;
$prefix-for-webkit: true !global;
@-webkit-keyframes #{$name} {
@content;
}
}
@if $original-prefix-for-mozilla {
@include disable-prefix-for-all();
$prefix-for-mozilla: true;
$prefix-for-mozilla: true !global;
@-moz-keyframes #{$name} {
@content;
}
}
@if $original-prefix-for-opera {
@include disable-prefix-for-all();
$prefix-for-opera: true;
@-o-keyframes #{$name} {
@content;
}
}
$prefix-for-webkit: $original-prefix-for-webkit !global;
$prefix-for-mozilla: $original-prefix-for-mozilla !global;
$prefix-for-microsoft: $original-prefix-for-microsoft !global;
$prefix-for-opera: $original-prefix-for-opera !global;
$prefix-for-spec: $original-prefix-for-spec !global;
@if $original-prefix-for-spec {
@include disable-prefix-for-all();
$prefix-for-spec: true;
@keyframes #{$name} {
@content;
}
}
$prefix-for-webkit: $original-prefix-for-webkit;
$prefix-for-mozilla: $original-prefix-for-mozilla;
$prefix-for-microsoft: $original-prefix-for-microsoft;
$prefix-for-opera: $original-prefix-for-opera;
$prefix-for-spec: $original-prefix-for-spec;
}

View File

@@ -1,11 +1,9 @@
@mixin linear-gradient($pos, $G1, $G2: false,
$G3: false, $G4: false,
$G5: false, $G6: false,
$G7: false, $G8: false,
$G9: false, $G10: false,
$deprecated-pos1: left top,
$deprecated-pos2: left bottom,
$fallback: false) {
@mixin linear-gradient($pos, $G1, $G2: null,
$G3: null, $G4: null,
$G5: null, $G6: null,
$G7: null, $G8: null,
$G9: null, $G10: null,
$fallback: null) {
// Detect what type of value exists in $pos
$pos-type: type-of(nth($pos, 1));
$pos-spec: null;
@@ -24,7 +22,7 @@
$pos-spec: nth($positions, 2);
}
$full: compact($G1, $G2, $G3, $G4, $G5, $G6, $G7, $G8, $G9, $G10);
$full: $G1, $G2, $G3, $G4, $G5, $G6, $G7, $G8, $G9, $G10;
// Set $G1 as the default fallback color
$fallback-color: nth($G1, 1);
@@ -35,7 +33,6 @@
}
background-color: $fallback-color;
background-image: _deprecated-webkit-gradient(linear, $deprecated-pos1, $deprecated-pos2, $full); // Safari <= 5.0
background-image: -webkit-linear-gradient($pos-degree $full); // Safari 5.1+, Chrome
background-image: unquote("linear-gradient(#{$pos-spec}#{$full})");
}

View File

@@ -1,29 +1,8 @@
$placeholders: '-webkit-input-placeholder',
'-moz-placeholder',
'-ms-input-placeholder';
@mixin placeholder {
$placeholders: ":-webkit-input" ":-moz" "-moz" "-ms-input";
@each $placeholder in $placeholders {
@if $placeholder == "-webkit-input-placeholder" {
&::#{$placeholder} {
@content;
}
}
@else if $placeholder == "-moz-placeholder" {
// FF 18-
&:#{$placeholder} {
@content;
}
// FF 19+
&::#{$placeholder} {
@content;
}
}
@else {
&:#{$placeholder} {
@content;
}
&:#{$placeholder}-placeholder {
@content;
}
}
}

View File

@@ -1,16 +1,12 @@
// Requires Sass 3.1+
@mixin radial-gradient($G1, $G2,
$G3: false, $G4: false,
$G5: false, $G6: false,
$G7: false, $G8: false,
$G9: false, $G10: false,
$G3: null, $G4: null,
$G5: null, $G6: null,
$G7: null, $G8: null,
$G9: null, $G10: null,
$pos: null,
$shape-size: null,
$deprecated-pos1: center center,
$deprecated-pos2: center center,
$deprecated-radius1: 0,
$deprecated-radius2: 460,
$fallback: false) {
$fallback: null) {
$data: _radial-arg-parser($G1, $G2, $pos, $shape-size);
$G1: nth($data, 1);
@@ -18,7 +14,7 @@
$pos: nth($data, 3);
$shape-size: nth($data, 4);
$full: compact($G1, $G2, $G3, $G4, $G5, $G6, $G7, $G8, $G9, $G10);
$full: $G1, $G2, $G3, $G4, $G5, $G6, $G7, $G8, $G9, $G10;
// Strip deprecated cover/contain for spec
$shape-size-spec: _shape-size-stripper($shape-size);
@@ -38,7 +34,6 @@
$shape-size-spec: if(($shape-size-spec != ' ') and ($pos == null), '#{$shape-size-spec}, ', '#{$shape-size-spec} ');
background-color: $fallback-color;
background-image: _deprecated-webkit-gradient(radial, $deprecated-pos1, $deprecated-pos2, $full, $deprecated-radius1, $deprecated-radius2); // Safari <= 5.0 && IOS 4
background-image: -webkit-radial-gradient(unquote(#{$pos}#{$shape-size}#{$full}));
background-image: unquote("radial-gradient(#{$shape-size-spec}#{$pos-spec}#{$full})");
}

View File

@@ -1,16 +1,59 @@
// Shorthand mixin. Supports multiple parentheses-deliminated values for each variable.
// Example: @include transition (all, 2.0s, ease-in-out);
// @include transition ((opacity, width), (1.0s, 2.0s), ease-in, (0, 2s));
// @include transition ($property:(opacity, width), $delay: (1.5s, 2.5s));
// Example: @include transition (all 2s ease-in-out);
// @include transition (opacity 1s ease-in 2s, width 2s ease-out);
// @include transition-property (transform, opacity);
@mixin transition ($properties...) {
@if length($properties) >= 1 {
@include prefixer(transition, $properties, webkit moz spec);
// Fix for vendor-prefix transform property
$needs-prefixes: false;
$webkit: ();
$moz: ();
$spec: ();
// Create lists for vendor-prefixed transform
@each $list in $properties {
@if nth($list, 1) == "transform" {
$needs-prefixes: true;
$list1: -webkit-transform;
$list2: -moz-transform;
$list3: ();
@each $var in $list {
$list3: join($list3, $var);
@if $var != "transform" {
$list1: join($list1, $var);
$list2: join($list2, $var);
}
}
$webkit: append($webkit, $list1);
$moz: append($moz, $list2);
$spec: append($spec, $list3);
}
// Create lists for non-prefixed transition properties
@else {
$webkit: append($webkit, $list, comma);
$moz: append($moz, $list, comma);
$spec: append($spec, $list, comma);
}
}
@if $needs-prefixes {
-webkit-transition: $webkit;
-moz-transition: $moz;
transition: $spec;
}
@else {
$properties: all 0.15s ease-out 0;
@include prefixer(transition, $properties, webkit moz spec);
@if length($properties) >= 1 {
@include prefixer(transition, $properties, webkit moz spec);
}
@else {
$properties: all 0.15s ease-out 0s;
@include prefixer(transition, $properties, webkit moz spec);
}
}
}

View File

@@ -0,0 +1,11 @@
@function assign-inputs($inputs, $pseudo: null) {
$list : ();
@each $input in $inputs {
$input: unquote($input);
$input: if($pseudo, $input + ":" + $pseudo, $input);
$list: append($list, $input, comma);
}
@return $list;
}

View File

@@ -0,0 +1,13 @@
// Programatically determines whether a color is light or dark
// Returns a boolean
// More details here http://robots.thoughtbot.com/closer-look-color-lightness
@function is-light($hex-color) {
$-local-red: red(rgba($hex-color, 1.0));
$-local-green: green(rgba($hex-color, 1.0));
$-local-blue: blue(rgba($hex-color, 1.0));
$-local-lightness: ($-local-red * 0.2126 + $-local-green * 0.7152 + $-local-blue * 0.0722) / 255;
@return $-local-lightness > .6;
}

View File

@@ -1,11 +0,0 @@
// Remove `false` values from a list
@function compact($vars...) {
$list: ();
@each $var in $vars {
@if $var {
$list: append($list, $var, comma);
}
}
@return $list;
}

View File

@@ -0,0 +1,3 @@
@function golden-ratio($value, $increment) {
@return modular-scale($value, $increment, $golden)
}

View File

@@ -1,13 +0,0 @@
@function linear-gradient($pos, $gradients...) {
$type: linear;
$pos-type: type-of(nth($pos, 1));
// if $pos doesn't exist, fix $gradient
@if ($pos-type == color) or (nth($pos, 1) == "transparent") {
$gradients: zip($pos $gradients);
$pos: false;
}
$type-gradient: $type, $pos, $gradients;
@return $type-gradient;
}

View File

@@ -1,40 +1,66 @@
// Scaling Variables
$golden: 1.618;
$minor-second: 1.067;
$major-second: 1.125;
$minor-third: 1.2;
$major-third: 1.25;
$perfect-fourth: 1.333;
$augmented-fourth: 1.414;
$perfect-fifth: 1.5;
$minor-sixth: 1.6;
$major-sixth: 1.667;
$minor-seventh: 1.778;
$major-seventh: 1.875;
$octave: 2;
$major-tenth: 2.5;
$major-eleventh: 2.667;
$major-twelfth: 3;
$double-octave: 4;
@function modular-scale($value, $increment, $ratio) {
$v1: nth($value, 1);
$v2: nth($value, length($value));
$value: $v1;
// scale $v2 to just above $v1
@while $v2 > $v1 {
$v2: ($v2 / $ratio); // will be off-by-1
}
@while $v2 < $v1 {
$v2: ($v2 * $ratio); // will fix off-by-1
}
// check AFTER scaling $v2 to prevent double-counting corner-case
$double-stranded: $v2 > $v1;
@if $increment > 0 {
@for $i from 1 through $increment {
$value: ($value * $ratio);
@if $double-stranded and ($v1 * $ratio) > $v2 {
$value: $v2;
$v2: ($v2 * $ratio);
} @else {
$v1: ($v1 * $ratio);
$value: $v1;
}
}
}
@if $increment < 0 {
$increment: abs($increment);
@for $i from 1 through $increment {
$value: ($value / $ratio);
// adjust $v2 to just below $v1
@if $double-stranded {
$v2: ($v2 / $ratio);
}
@for $i from $increment through -1 {
@if $double-stranded and ($v1 / $ratio) < $v2 {
$value: $v2;
$v2: ($v2 / $ratio);
} @else {
$v1: ($v1 / $ratio);
$value: $v1;
}
}
}
@return $value;
}
// div {
// Increment Up GR with positive value
// font-size: modular-scale(14px, 1, 1.618); // returns: 22.652px
//
// Increment Down GR with negative value
// font-size: modular-scale(14px, -1, 1.618); // returns: 8.653px
//
// Can be used with ceil(round up) or floor(round down)
// font-size: floor( modular-scale(14px, 1, 1.618) ); // returns: 22px
// font-size: ceil( modular-scale(14px, 1, 1.618) ); // returns: 23px
// }
//
// modularscale.com
@function golden-ratio($value, $increment) {
@return modular-scale($value, $increment, 1.618)
}
// div {
// font-size: golden-ratio(14px, 1); // returns: 22.652px
// }
//
// goldenratiocalculator.com

View File

@@ -2,7 +2,12 @@
// eg. for a relational value of 12px write em(12) when the parent is 16px
// if the parent is another value say 24px write em(12, 24)
@function em($pxval, $base: 16) {
@function em($pxval, $base: $em-base) {
@if not unitless($pxval) {
$pxval: strip-units($pxval);
}
@if not unitless($base) {
$base: strip-units($base);
}
@return ($pxval / $base) * 1em;
}

View File

@@ -0,0 +1,15 @@
// Convert pixels to rems
// eg. for a relational value of 12px write rem(12)
// Assumes $em-base is the font-size of <html>
@function rem($pxval) {
@if not unitless($pxval) {
$pxval: strip-units($pxval);
}
$base: $em-base;
@if not unitless($base) {
$base: strip-units($base);
}
@return ($pxval / $base) * 1rem;
}

View File

@@ -1,23 +0,0 @@
// This function is required and used by the background-image mixin.
@function radial-gradient($G1, $G2,
$G3: false, $G4: false,
$G5: false, $G6: false,
$G7: false, $G8: false,
$G9: false, $G10: false,
$pos: null,
$shape-size: null) {
$data: _radial-arg-parser($G1, $G2, $pos, $shape-size);
$G1: nth($data, 1);
$G2: nth($data, 2);
$pos: nth($data, 3);
$shape-size: nth($data, 4);
$type: radial;
$gradient: compact($G1, $G2, $G3, $G4, $G5, $G6, $G7, $G8, $G9, $G10);
$type-gradient: $type, $shape-size $pos, $gradient;
@return $type-gradient;
}

View File

@@ -0,0 +1,5 @@
// Srtips the units from a value. e.g. 12px -> 12
@function strip-units($val) {
@return ($val / ($val * 0 + 1));
}

View File

@@ -0,0 +1,17 @@
// Convert shorthand to the 4-value syntax
@function unpack($shorthand) {
@if length($shorthand) == 1 {
@return nth($shorthand, 1) nth($shorthand, 1) nth($shorthand, 1) nth($shorthand, 1);
}
@else if length($shorthand) == 2 {
@return nth($shorthand, 1) nth($shorthand, 2) nth($shorthand, 1) nth($shorthand, 2);
}
@else if length($shorthand) == 3 {
@return nth($shorthand, 1) nth($shorthand, 2) nth($shorthand, 3) nth($shorthand, 2);
}
@else {
@return $shorthand;
}
}

View File

@@ -0,0 +1,15 @@
//************************************************************************//
// Helper function for str-to-num fn.
// Source: http://sassmeister.com/gist/9647408
//************************************************************************//
@function _convert-units($number, $unit) {
$strings: 'px' 'cm' 'mm' '%' 'ch' 'pica' 'in' 'em' 'rem' 'pt' 'pc' 'ex' 'vw' 'vh' 'vmin' 'vmax', 'deg', 'rad', 'grad', 'turn';
$units: 1px 1cm 1mm 1% 1ch 1pica 1in 1em 1rem 1pt 1pc 1ex 1vw 1vh 1vmin 1vmax, 1deg, 1rad, 1grad, 1turn;
$index: index($strings, $unit);
@if not $index {
@warn "Unknown unit `#{$unit}`.";
@return false;
}
@return $number * nth($units, $index);
}

View File

@@ -1,39 +0,0 @@
// Render Deprecated Webkit Gradient - Linear || Radial
//************************************************************************//
@function _deprecated-webkit-gradient($type,
$deprecated-pos1, $deprecated-pos2,
$full,
$deprecated-radius1: false, $deprecated-radius2: false) {
$gradient-list: ();
$gradient: false;
$full-length: length($full);
$percentage: false;
$gradient-type: $type;
@for $i from 1 through $full-length {
$gradient: nth($full, $i);
@if length($gradient) == 2 {
$color-stop: color-stop(nth($gradient, 2), nth($gradient, 1));
$gradient-list: join($gradient-list, $color-stop, comma);
}
@else if $gradient != null {
@if $i == $full-length {
$percentage: 100%;
}
@else {
$percentage: ($i - 1) * (100 / ($full-length - 1)) + "%";
}
$color-stop: color-stop(unquote($percentage), $gradient);
$gradient-list: join($gradient-list, $color-stop, comma);
}
}
@if $type == radial {
$gradient: -webkit-gradient(radial, $deprecated-pos1, $deprecated-radius1, $deprecated-pos2, $deprecated-radius2, $gradient-list);
}
@else if $type == linear {
$gradient: -webkit-gradient(linear, $deprecated-pos1, $deprecated-pos2, $gradient-list);
}
@return $gradient;
}

View File

@@ -0,0 +1,8 @@
//************************************************************************//
// Helper for linear-gradient-parser
//************************************************************************//
@function _is-num($char) {
$values: '0' '1' '2' '3' '4' '5' '6' '7' '8' '9' 0 1 2 3 4 5 6 7 8 9;
$index: index($values, $char);
@return if($index, true, false);
}

View File

@@ -0,0 +1,25 @@
// Private function for linear-gradient-parser
@function _linear-angle-parser($image, $first-val, $prefix, $suffix) {
$offset: null;
$unit-short: str-slice($first-val, str-length($first-val) - 2, str-length($first-val));
$unit-long: str-slice($first-val, str-length($first-val) - 3, str-length($first-val));
@if ($unit-long == "grad") or
($unit-long == "turn") {
$offset: if($unit-long == "grad", -100grad * 3, -0.75turn);
}
@else if ($unit-short == "deg") or
($unit-short == "rad") {
$offset: if($unit-short == "deg", -90 * 3, 1.6rad);
}
@if $offset {
$num: _str-to-num($first-val);
@return (
webkit-image: -webkit- + $prefix + ($offset - $num) + $suffix,
spec-image: $image
);
}
}

View File

@@ -0,0 +1,41 @@
@function _linear-gradient-parser($image) {
$image: unquote($image);
$gradients: ();
$start: str-index($image, "(");
$end: str-index($image, ",");
$first-val: str-slice($image, $start + 1, $end - 1);
$prefix: str-slice($image, 0, $start);
$suffix: str-slice($image, $end, str-length($image));
$has-multiple-vals: str-index($first-val, " ");
$has-single-position: unquote(_position-flipper($first-val) + "");
$has-angle: _is-num(str-slice($first-val, 0, 0));
@if $has-multiple-vals {
$gradients: _linear-side-corner-parser($image, $first-val, $prefix, $suffix, $has-multiple-vals);
}
@else if $has-single-position != "" {
$pos: unquote($has-single-position + "");
$gradients: (
webkit-image: -webkit- + $image,
spec-image: $prefix + "to " + $pos + $suffix
);
}
@else if $has-angle {
// Rotate degree for webkit
$gradients: _linear-angle-parser($image, $first-val, $prefix, $suffix);
}
@else {
$gradients: (
webkit-image: -webkit- + $image,
spec-image: $image
);
}
@return $gradients;
}

View File

@@ -0,0 +1,31 @@
// Private function for linear-gradient-parser
@function _linear-side-corner-parser($image, $first-val, $prefix, $suffix, $has-multiple-vals) {
$val-1: str-slice($first-val, 0, $has-multiple-vals - 1 );
$val-2: str-slice($first-val, $has-multiple-vals + 1, str-length($first-val));
$val-3: null;
$has-val-3: str-index($val-2, " ");
@if $has-val-3 {
$val-3: str-slice($val-2, $has-val-3 + 1, str-length($val-2));
$val-2: str-slice($val-2, 0, $has-val-3 - 1);
}
$pos: _position-flipper($val-1) _position-flipper($val-2) _position-flipper($val-3);
$pos: unquote($pos + "");
// Use old spec for webkit
@if $val-1 == "to" {
@return (
webkit-image: -webkit- + $prefix + $pos + $suffix,
spec-image: $image
);
}
// Bring the code up to spec
@else {
@return (
webkit-image: -webkit- + $image,
spec-image: $prefix + "to " + $pos + $suffix
);
}
}

View File

@@ -22,7 +22,7 @@
$pos: $pos nth($value, $i);
}
}
$G1: false;
$G1: null;
}
// If not spec calculate correct values
@@ -38,7 +38,7 @@
$pos: $value;
@if $pos == $G1 {
$G1: false;
$G1: null;
}
}
@@ -55,11 +55,11 @@
$shape-size: $value;
@if $value == $G1 {
$G1: false;
$G1: null;
}
@else if $value == $G2 {
$G2: false;
$G2: null;
}
}
}

View File

@@ -0,0 +1,50 @@
@function _radial-gradient-parser($image) {
$image: unquote($image);
$gradients: ();
$start: str-index($image, "(");
$end: str-index($image, ",");
$first-val: str-slice($image, $start + 1, $end - 1);
$prefix: str-slice($image, 0, $start);
$suffix: str-slice($image, $end, str-length($image));
$is-spec-syntax: str-index($first-val, "at");
@if $is-spec-syntax and $is-spec-syntax > 1 {
$keyword: str-slice($first-val, 1, $is-spec-syntax - 2);
$pos: str-slice($first-val, $is-spec-syntax + 3, str-length($first-val));
$pos: append($pos, $keyword, comma);
$gradients: (
webkit-image: -webkit- + $prefix + $pos + $suffix,
spec-image: $image
)
}
@else if $is-spec-syntax == 1 {
$pos: str-slice($first-val, $is-spec-syntax + 3, str-length($first-val));
$gradients: (
webkit-image: -webkit- + $prefix + $pos + $suffix,
spec-image: $image
)
}
@else if str-index($image, "cover") or str-index($image, "contain") {
@warn "Radial-gradient needs to be updated to conform to latest spec.";
$gradients: (
webkit-image: null,
spec-image: $image
)
}
@else {
$gradients: (
webkit-image: -webkit- + $image,
spec-image: $image
)
}
@return $gradients;
}

View File

@@ -0,0 +1,50 @@
//************************************************************************//
// Helper function for linear/radial-gradient-parsers.
// Source: http://sassmeister.com/gist/9647408
//************************************************************************//
@function _str-to-num($string) {
// Matrices
$strings: '0' '1' '2' '3' '4' '5' '6' '7' '8' '9';
$numbers: 0 1 2 3 4 5 6 7 8 9;
// Result
$result: 0;
$divider: 0;
$minus: false;
// Looping through all characters
@for $i from 1 through str-length($string) {
$character: str-slice($string, $i, $i);
$index: index($strings, $character);
@if $character == '-' {
$minus: true;
}
@else if $character == '.' {
$divider: 1;
}
@else {
@if not $index {
$result: if($minus, $result * -1, $result);
@return _convert-units($result, str-slice($string, $i));
}
$number: nth($numbers, $index);
@if $divider == 0 {
$result: $result * 10;
}
@else {
// Move the decimal dot to the left
$divider: $divider * 10;
$number: $number / $divider;
}
$result: $result + $number;
}
}
@return if($minus, $result * -1, $result);
}

View File

@@ -0,0 +1 @@
$asset-pipeline: false !default;

View File

@@ -0,0 +1,6 @@
// Variable settings for /addons/prefixer.scss
$prefix-for-webkit: true !default;
$prefix-for-mozilla: true !default;
$prefix-for-microsoft: true !default;
$prefix-for-opera: true !default;
$prefix-for-spec: true !default; // required for keyframe mixin

View File

@@ -0,0 +1 @@
$em-base: 16px !default;

View File

@@ -0,0 +1,244 @@
---
- - Adam Krebs
- Adam Mark
- Adam Solove
- Alan deLevie
- Alex Zelenskiy
- Alexander Solovyov
- Alexey Raspopov
- Andre Z Sanchez
- Andreas Svensson
- Andres Suarez
- Andrew Davey
- Andrew Rasmussen
- Andrew Zich
- Andrey Popp
- Anthony van der Hoorn
- Areeb Malik
- Ayman Osman
- Ben Alpert
- Ben Foxall
- Ben Newman
- Ben Ripkens
- Bill Fisher
- Bob Eagan
- Bojan Mihelac
- Brandon Bloom
- Brandon Tilley
- Brian Cooke
- Brian Kim
- Brian Reavis
- Brian Rue
- Cam Spiers
- Cassus Adam Banko
- Cat Chen
- Charles Marsh
- Cheng Lou
- Chris Sciolla
- Christian Alfoni
- Christian Roman
- Christoph Pojer
- Christopher Monsanto
- Clay Allsopp
- Connor McSheffrey
- Cotton Hou
- Dan Abramov
- Dan Schafer
- Daniel Gasienica
- Daniel Lo Nigro
- Daniel Miladinov
- Daniel Schonfeld
- Danny Ben-David
- Daryl Lau
- David Hellsing
- David Hu
- Devon Blandin
- Dmitrii Abramov
- Dmitry Mazuro
- Dustin Getz
- Enguerran
- Eric Clemmons
- Eric Florenzano
- Eric Schoffstall
- Evan Coonrod
- Fabio M. Costa
- Felipe Oliveira Carvalho
- Felix Gnass
- Felix Kling
- Fernando Correia
- François-Xavier Bois
- Fred Zhao
- G Scott Olson
- Garren Smith
- Geert Pasteels
- Geert-Jan Brits
- George A Sisco III
- Gilbert
- Glen Mailer
- Greg Hurrell
- Greg Roodt
- Guangqiang Dong
- Guido Bouman
- Harry Hull
- - Harshad Sabne
- Hendrik Swanepoel
- Hugo Jobling
- Ian Obermiller
- Ingvar Stepanyan
- Irae Carvalho
- Isaac Salier-Hellendag
- Ivan Kozik
- Ivan Vergiliev
- Jacob Gable
- Jacob Greenleaf
- Jaime Mingo
- Jakub Malinowski
- James Brantly
- James Ide
- James Seppi
- Jamie Wong
- Jamison Dance
- Jan Hancic
- Jan Kassens
- Jared Forsyth
- Jason Bonta
- Jason Trill
- Jean Lauliac
- Jed Watson
- Jeff Barczewski
- Jeff Carpenter
- Jeff Chan
- Jeff Morrison
- Jeff Welch
- Jeffrey Lin
- Jesse Skinner
- Jignesh Kakadiya
- Jim OBrien
- Jimmy Jea
- Jing Chen
- Johannes Baiter
- Johannes Emerich
- John Watson
- Jon Beebe
- Jonas Enlund
- Jonas Gebhardt
- Jonathan Hsu
- Jordan Walke
- Josh Bassett
- Josh Duck
- Josh Yudaken
- Joshua Ma
- Julen Ruiz Aizpuru
- Julien Bordellier
- Jun Wu
- Juraj Dudak
- Justin Jaffray
- Karl Mikkelsen
- Karpich Dmitry
- Keito Uchiyama
- Kit Randel
- Kunal Mehta
- Kyle Mathews
- Laurence Rowe
- Lee Byron
- Levi McCallum
- Lily
- Logan Allen
- Luigy Leon
- Marcin Kwiatkowski
- Marcin Szczepanski
- Mariano Desanze
- Mark Anderson
- Mark Hintz
- Mark IJbema
- Mark Richardson
- Marshall Roch
- Martin Andert
- Martin Konicek
- Mathieu M-Gosselin
- Matt Harrison
- Matthew Dapena-Tretter
- Matti Nelimarkka
- Max F. Albrecht
- Michael Chan
- - Michael Randers-Pehrson
- Michal Srb
- Mike D Pilsbury
- Miorel Palii
- Mouad Debbar
- Nadeesha Cabral
- Naman Goel
- Nate Hunzaker
- Nathan White
- Nicholas Bergson-Shilcock
- Nick Fitzgerald
- Nick Gavalas
- Nick Merwin
- Nick Thompson
- Nick Williams
- Niklas Boström
- Oleg
- Oleksii Markhovskyi
- Oliver Zeigermann
- Owen Coutts
- Pablo Lacerda de Miranda
- Pascal Hartig
- Paul OShannessy
- Paul Seiffert
- Paul Shen
- Pete Hunt
- Peter Cottle
- Petri Lievonen
- Pieter Vanderwerff
- Rajiv Tirumalareddy
- Randall Randall
- Ray
- Richard D. Worth
- Richard Feldman
- Richard Livesey
- Rick Beerendonk
- Rob Arnold
- Ryan Seddon
- Sahat Yalkabov
- Sam Selikoff
- Sander Spies
- Sean Kinsey
- Sebastian Markbåge
- Sergey Generalov
- Shane O'Sullivan
- Shaun Trennery
- Sheraz
- Shripad K
- Simon Højberg
- Simon Welsh
- Stefan Dombrowski
- Stephen Murphy
- Stoyan Stefanov
- Sundeep Malladi
- Sunny Juneja
- Sven Helmberger
- Sébastien Lorber
- Thomas Aylott
- Thomas Boyt
- Thomas Shaddox
- Thomas Shafer
- ThomasCrvsr
- Timothy Yung
- Tom Haggie
- Tom Hauburger
- Tom MacWright
- Tom Occhino
- Ville Immonen
- Vjeux
- Volkan Unsal
- Wayne Larsen
- WickyNilliams
- Wincent Colaiuta
- XuefengWu
- Yuriy Dybskiy
- Yuval Dekel
- Zach Bruggeman
- cutbko
- davidxi
- imagentleman
- jon madison

97
docs/_data/nav_docs.yml Normal file
View File

@@ -0,0 +1,97 @@
- title: Quick Start
items:
- id: getting-started
title: Getting Started
- id: tutorial
title: Tutorial
- id: thinking-in-react
title: Thinking in React
- title: Community Resources
items:
- id: conferences
title: Conferences
- id: videos
title: Videos
- id: complementary-tools
title: Complementary Tools
- id: examples
title: Examples
- title: Guides
items:
- id: why-react
title: Why React?
- id: displaying-data
title: Displaying Data
subitems:
- id: jsx-in-depth
title: JSX in Depth
- id: jsx-spread
title: JSX Spread Attributes
- id: jsx-gotchas
title: JSX Gotchas
- id: interactivity-and-dynamic-uis
title: Interactivity and Dynamic UIs
- id: multiple-components
title: Multiple Components
- id: reusable-components
title: Reusable Components
- id: transferring-props
title: Transferring Props
- id: forms
title: Forms
- id: working-with-the-browser
title: Working With the Browser
subitems:
- id: more-about-refs
title: More About Refs
- id: tooling-integration
title: Tooling Integration
- id: addons
title: Add-Ons
subitems:
- id: animation
title: Animation
- id: two-way-binding-helpers
title: Two-Way Binding Helpers
- id: class-name-manipulation
title: Class Name Manipulation
- id: test-utils
title: Test Utilities
- id: clone-with-props
title: Cloning Components
- id: update
title: Immutability Helpers
- id: pure-render-mixin
title: PureRenderMixin
- id: perf
title: Performance Tools
- id: advanced-performance
title: Advanced Performance
- title: Reference
items:
- id: top-level-api
title: Top-Level API
- id: component-api
title: Component API
- id: component-specs
title: Component Specs and Lifecycle
- id: tags-and-attributes
title: Supported Tags and Attributes
- id: events
title: Event System
- id: dom-differences
title: DOM Differences
- id: special-non-dom-attributes
title: Special Non-DOM Attributes
- id: reconciliation
title: Reconciliation
- id: glossary
title: React (Virtual) DOM Terminology
- title: Flux
items:
- id: flux-overview
title: Flux Overview
href: http://facebook.github.io/flux/docs/overview.html
- id: flux-todo-list
title: Flux TodoMVC Tutorial
href: http://facebook.github.io/flux/docs/todo-list.html

40
docs/_data/nav_tips.yml Normal file
View File

@@ -0,0 +1,40 @@
- title: Tips
items:
- id: introduction
title: Introduction
- id: inline-styles
title: Inline Styles
- id: if-else-in-JSX
title: If-Else in JSX
- id: self-closing-tag
title: Self-Closing Tag
- id: maximum-number-of-jsx-root-nodes
title: Maximum Number of JSX Root Nodes
- id: style-props-value-px
title: Shorthand for Specifying Pixel Values in style props
- id: children-props-type
title: Type of the Children props
- id: controlled-input-null-value
title: Value of null for Controlled Input
- id: componentWillReceiveProps-not-triggered-after-mounting
title: componentWillReceiveProps Not Triggered After Mounting
- id: props-in-getInitialState-as-anti-pattern
title: Props in getInitialState Is an Anti-Pattern
- id: dom-event-listeners
title: DOM Event Listeners in a Component
- id: initial-ajax
title: Load Initial Data via AJAX
- id: false-in-jsx
title: False in JSX
- id: communicate-between-components
title: Communicate Between Components
- id: expose-component-functions
title: Expose Component Functions
- id: references-to-components
title: References to Components
- id: children-undefined
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

View File

@@ -1,10 +1,11 @@
<div class="nav-docs">
<div class="nav-docs nav-blog">
<div class="nav-docs-section">
<h3>Recent posts</h3>
<ul>
{% for post in site.posts %}
<li><a href="/react{{ post.url }}"{% if page.title == post.title %} class="active"{% endif %}>{{ post.title }}</a></li>
{% endfor %}
{% for post in site.posts limit:10 %}
<li><a href="/react{{ post.url }}"{% if page.title == post.title %} class="active"{% endif %}>{{ post.title }}</a></li>
{% endfor %}
<li><a href="/react/blog/all.html">All posts ...</a></li>
</ul>
</div>
</div>

View File

@@ -1,24 +1,38 @@
<div class="nav-docs">
<div class="nav-docs-section">
<h3>Getting started</h3>
<ul>
<li><a href="/react/docs/getting-started.html"{% if page.id == 'docs-getting-started' %} class="active"{% endif %}>Getting Started</a></li>
<li><a href="/react/docs/tutorial.html"{% if page.id == 'docs-tutorial' %} class="active"{% endif %}>Tutorial</a></li>
<li><a href="/react/docs/common-questions.html"{% if page.id == 'docs-common-questions' %} class="active"{% endif %}>Common Questions</a></li>
</ul>
</div>
<!-- Docs Nav -->
{% for section in site.data.nav_docs %}
<div class="nav-docs-section">
<h3>{{ section.title }}</h3>
<ul>
{% for item in section.items %}
<li>
{{ item | sidebar_item_link}}
{% if item.subitems %}
<ul>
{% for subitem in item.subitems %}
<li>
{{ subitem | sidebar_item_link}}
</li>
{% endfor %}
</ul>
{% endif %}
</li>
{% endfor %}
</ul>
</div>
{% endfor %}
<div class="nav-docs-section">
<h3>Reference</h3>
<ul>
<li><a href="/react/docs/syntax.html"{% if page.id == 'docs-syntax' %} class="active"{% endif %}>JSX Syntax</a></li>
<li><a href="/react/docs/component-basics.html"{% if page.id == 'docs-component-basics' %} class="active"{% endif %}>Component Basics</a></li>
<li><a href="/react/docs/component-data.html"{% if page.id == 'docs-component-data' %} class="active"{% endif %}>Component Data</a></li>
<li><a href="/react/docs/component-lifecycle.html"{% if page.id == 'docs-component-lifecycle' %} class="active"{% endif %}>Component Lifecycle</a></li>
<li><a href="/react/docs/event-handling.html"{% if page.id == 'docs-event-handling' %} class="active"{% endif %}>Event Handling</a></li>
<li><a href="/react/docs/advanced-components.html"{% if page.id == 'docs-advanced-components' %} class="active"{% endif %}>Advanced Components</a></li>
<li><a href="/react/docs/mixins.html"{% if page.id == 'docs-mixins' %} class="active"{% endif %}>Mixins</a></li>
<li><a href="/react/docs/api.html"{% if page.id == 'docs-api' %} class="active"{% endif %}>API</a></li>
</ul>
</div>
<!-- Tips Nav -->
{% for section in site.data.nav_tips %}
<div class="nav-docs-section">
<h3>{{ section.title }}</h3>
<ul>
{% for item in section.items %}
<li>
<a href="/react/tips/{{ item.id }}.html"{% if page.id == item.id %} class="active"{% endif %}>{{ item.title }}</a>
</li>
{% endfor %}
</ul>
</div>
{% endfor %}
</div>

2
docs/_js/es5-sham.min.js vendored Normal file

File diff suppressed because one or more lines are too long

2
docs/_js/es5-shim.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,3 @@
rules:
block-scoped-var: false
no-undef: false

View File

@@ -1,19 +1,14 @@
/**
* @jsx React.DOM
*/
var HELLO_COMPONENT = `
var HelloMessage = React.createClass({
render: function() {
return <div>Hello {this.props.name}</div>;
}
});
var HELLO_COMPONENT = "\
/** @jsx React.DOM */\n\
var HelloMessage = React.createClass({\n\
render: function() {\n\
return <div>{'Hello ' + this.props.name}</div>;\n\
}\n\
});\n\
\n\
React.renderComponent(<HelloMessage name=\"John\" />, mountNode);\
";
React.render(<HelloMessage name="John" />, mountNode);
`;
React.renderComponent(
React.render(
<ReactPlayground codeText={HELLO_COMPONENT} />,
document.getElementById('helloExample')
);

View File

@@ -1,42 +1,37 @@
/**
* @jsx React.DOM
*/
var MARKDOWN_COMPONENT = `
var converter = new Showdown.converter();
var MARKDOWN_COMPONENT = "\
/** @jsx React.DOM */\n\
\n\
var converter = new Showdown.converter();\n\
\n\
var MarkdownEditor = React.createClass({\n\
getInitialState: function() {\n\
return {value: 'Type some *markdown* here!'};\n\
},\n\
handleKeyUp: React.autoBind(function() {\n\
this.setState({value: this.refs.textarea.getDOMNode().value});\n\
}),\n\
render: function() {\n\
return (\n\
<div className=\"MarkdownEditor\">\n\
<h3>Input</h3>\n\
<textarea onKeyUp={this.handleKeyUp} ref=\"textarea\">\n\
{this.state.value}\n\
</textarea>\n\
<h3>Output</h3>\n\
<div\n\
className=\"content\"\n\
dangerouslySetInnerHTML={{\n\
__html: converter.makeHtml(this.state.value)\n\
}}\n\
/>\n\
</div>\n\
);\n\
}\n\
});\n\
\n\
React.renderComponent(<MarkdownEditor />, mountNode);\
";
var MarkdownEditor = React.createClass({
getInitialState: function() {
return {value: 'Type some *markdown* here!'};
},
handleChange: function() {
this.setState({value: this.refs.textarea.getDOMNode().value});
},
render: function() {
return (
<div className="MarkdownEditor">
<h3>Input</h3>
<textarea
onChange={this.handleChange}
ref="textarea"
defaultValue={this.state.value} />
<h3>Output</h3>
<div
className="content"
dangerouslySetInnerHTML={{
__html: converter.makeHtml(this.state.value)
}}
/>
</div>
);
}
});
React.renderComponent(
React.render(<MarkdownEditor />, mountNode);
`;
React.render(
<ReactPlayground codeText={MARKDOWN_COMPONENT} />,
document.getElementById('markdownExample')
);

View File

@@ -1,29 +1,28 @@
/**
* @jsx React.DOM
*/
var TIMER_COMPONENT = `
var Timer = React.createClass({
getInitialState: function() {
return {secondsElapsed: 0};
},
tick: function() {
this.setState({secondsElapsed: this.state.secondsElapsed + 1});
},
componentDidMount: function() {
this.interval = setInterval(this.tick, 1000);
},
componentWillUnmount: function() {
clearInterval(this.interval);
},
render: function() {
return (
<div>Seconds Elapsed: {this.state.secondsElapsed}</div>
);
}
});
var TIMER_COMPONENT = "\
var Timer = React.createClass({\n\
getInitialState: function() {\n\
return {secondsElapsed: 0};\n\
},\n\
tick: React.autoBind(function() {\n\
this.setState({secondsElapsed: this.state.secondsElapsed + 1});\n\
}),\n\
componentDidMount: function() {\n\
setInterval(this.tick, 1000);\n\
},\n\
render: function() {\n\
return React.DOM.div({},\n\
'Seconds Elapsed: ' + this.state.secondsElapsed\n\
);\n\
}\n\
});\n\
\n\
React.renderComponent(Timer({}), mountNode);\
";
React.render(<Timer />, mountNode);
`;
React.renderComponent(
React.render(
<ReactPlayground codeText={TIMER_COMPONENT} />,
document.getElementById('timerExample')
);

View File

@@ -1,57 +1,43 @@
/**
* @jsx React.DOM
*/
var TODO_COMPONENT = `
var TodoList = React.createClass({
render: function() {
var createItem = function(itemText) {
return <li>{itemText}</li>;
};
return <ul>{this.props.items.map(createItem)}</ul>;
}
});
var TodoApp = React.createClass({
getInitialState: function() {
return {items: [], text: ''};
},
onChange: function(e) {
this.setState({text: e.target.value});
},
handleSubmit: function(e) {
e.preventDefault();
var nextItems = this.state.items.concat([this.state.text]);
var nextText = '';
this.setState({items: nextItems, text: nextText});
},
render: function() {
return (
<div>
<h3>TODO</h3>
<TodoList items={this.state.items} />
<form onSubmit={this.handleSubmit}>
<input onChange={this.onChange} value={this.state.text} />
<button>{'Add #' + (this.state.items.length + 1)}</button>
</form>
</div>
);
}
});
var TODO_COMPONENT = "\
/** @jsx React.DOM */\n\
var TodoList = React.createClass({\n\
render: function() {\n\
var items = this.props.items.map(function(item) {\n\
return <li>{item}</li>;\n\
});\n\
return <ul>{items}</ul>;\n\
}\n\
});\n\
\n\
var TodoCreate = React.createClass({\n\
handleSubmit: React.autoBind(function() {\n\
var textInput = this.refs.textInput.getDOMNode();\n\
this.props.onCreate(textInput.value);\n\
textInput.value = '';\n\
return false;\n\
}),\n\
render: function() {\n\
return (\n\
<form onSubmit={this.handleSubmit}>\n\
<input type=\"text\" ref=\"textInput\" />\n\
<button>Add</button>\n\
</form>\n\
);\n\
}\n\
});\n\
\n\
var TodoApp = React.createClass({\n\
getInitialState: function() {\n\
return {items: []};\n\
},\n\
onItemCreate: React.autoBind(function(value) {\n\
this.setState({items: this.state.items.concat([value])});\n\
}),\n\
render: function() {\n\
return (\n\
<div>\n\
<h3>TODO</h3>\n\
<TodoList items={this.state.items} />\n\
<TodoCreate onCreate={this.onItemCreate} />\n\
</div>\n\
);\n\
}\n\
});\n\
\n\
React.renderComponent(<TodoApp />, mountNode);\
";
React.render(<TodoApp />, mountNode);
`;
React.renderComponent(
React.render(
<ReactPlayground codeText={TODO_COMPONENT} />,
document.getElementById('todoExample')
);

7
docs/_js/html-jsx-lib.js Normal file
View File

@@ -0,0 +1,7 @@
// Ideally it would be nice to just redirect, but Github Pages is very basic and
// lacks that functionality.
console.warn(
'html-jsx-lib.js has moved to http://reactjs.github.io/react-magic/' +
'htmltojsx.min.js. If using React-Magic, you are no longer required to ' +
'link to this file. Please delete its <script> tag.'
);

82
docs/_js/html-jsx.js Normal file
View File

@@ -0,0 +1,82 @@
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
/**
* This is a web interface for the HTML to JSX converter contained in
* `html-jsx-lib.js`.
*/
;(function() {
var HELLO_COMPONENT = "\
<!-- Hello world -->\n\
<div class=\"awesome\" style=\"border: 1px solid red\">\n\
<label for=\"name\">Enter your name: </label>\n\
<input type=\"text\" id=\"name\" />\n\
</div>\n\
<p>Enter your HTML here</p>\
";
var HTMLtoJSXComponent = React.createClass({
getInitialState: function() {
return {
outputClassName: 'NewComponent',
createClass: true
};
},
onReactClassNameChange: function(evt) {
this.setState({ outputClassName: evt.target.value });
},
onCreateClassChange: function(evt) {
this.setState({ createClass: evt.target.checked });
},
setInput: function(input) {
this.setState({ input: input });
this.convertToJsx();
},
convertToJSX: function(input) {
var converter = new HTMLtoJSX({
outputClassName: this.state.outputClassName,
createClass: this.state.createClass
});
return converter.convert(input);
},
render: function() {
return (
<div>
<div id="options">
<label>
<input
type="checkbox"
checked={this.state.createClass}
onChange={this.onCreateClassChange} />
Create class
</label>
<label style={{display: this.state.createClass ? '' : 'none'}}>
·
Class name:
<input
type="text"
value={this.state.outputClassName}
onChange={this.onReactClassNameChange} />
</label>
</div>
<ReactPlayground
codeText={HELLO_COMPONENT}
renderCode={true}
transformer={this.convertToJSX}
showCompiledJSTab={false}
editorTabTitle="Live HTML Editor"
/>
</div>
);
}
});
React.render(<HTMLtoJSXComponent />, document.getElementById('jsxCompiler'));
}());

8
docs/_js/html5shiv.min.js vendored Normal file
View File

@@ -0,0 +1,8 @@
/*
HTML5 Shiv v3.6.2 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
*/
(function(l,f){function m(){var a=e.elements;return"string"==typeof a?a.split(" "):a}function i(a){var b=n[a[o]];b||(b={},h++,a[o]=h,n[h]=b);return b}function p(a,b,c){b||(b=f);if(g)return b.createElement(a);c||(c=i(b));b=c.cache[a]?c.cache[a].cloneNode():r.test(a)?(c.cache[a]=c.createElem(a)).cloneNode():c.createElem(a);return b.canHaveChildren&&!s.test(a)?c.frag.appendChild(b):b}function t(a,b){if(!b.cache)b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag();
a.createElement=function(c){return!e.shivMethods?b.createElem(c):p(c,a,b)};a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/\w+/g,function(a){b.createElem(a);b.frag.createElement(a);return'c("'+a+'")'})+");return n}")(e,b.frag)}function q(a){a||(a=f);var b=i(a);if(e.shivCSS&&!j&&!b.hasCSS){var c,d=a;c=d.createElement("p");d=d.getElementsByTagName("head")[0]||d.documentElement;c.innerHTML="x<style>article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}</style>";
c=d.insertBefore(c.lastChild,d.firstChild);b.hasCSS=!!c}g||t(a,b);return a}var k=l.html5||{},s=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,r=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,j,o="_html5shiv",h=0,n={},g;(function(){try{var a=f.createElement("a");a.innerHTML="<xyz></xyz>";j="hidden"in a;var b;if(!(b=1==a.childNodes.length)){f.createElement("a");var c=f.createDocumentFragment();b="undefined"==typeof c.cloneNode||
"undefined"==typeof c.createDocumentFragment||"undefined"==typeof c.createElement}g=b}catch(d){g=j=!0}})();var e={elements:k.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup main mark meter nav output progress section summary time video",version:"3.6.2",shivCSS:!1!==k.shivCSS,supportsUnknownElements:g,shivMethods:!1!==k.shivMethods,type:"default",shivDocument:q,createElement:p,createDocumentFragment:function(a,b){a||(a=f);if(g)return a.createDocumentFragment();
for(var b=b||i(a),c=b.frag.cloneNode(),d=0,e=m(),h=e.length;d<h;d++)c.createElement(e[d]);return c}};l.html5=e;q(f)})(this,document);

View File

@@ -0,0 +1,11 @@
(function() {
var tag = document.querySelector(
'script[type="application/javascript;version=1.7"]'
);
if (!tag || tag.textContent.indexOf('window.onload=function(){') !== -1) {
alert('Bad JSFiddle configuration, please fork the original React JSFiddle');
}
tag.setAttribute('type', 'text/jsx;harmony=true');
tag.textContent = tag.textContent.replace(/^\/\/<!\[CDATA\[/, '');
})();

View File

@@ -1,19 +1,45 @@
/**
* @jsx React.DOM
*/
var HELLO_COMPONENT = "\
/** @jsx React.DOM */\n\
var HelloMessage = React.createClass({\n\
render: function() {\n\
return <div>{'Hello ' + this.props.name}</div>;\n\
return <div>Hello {this.props.name}</div>;\n\
}\n\
});\n\
\n\
React.renderComponent(<HelloMessage name=\"John\" />, mountNode);\
React.render(<HelloMessage name=\"John\" />, mountNode);\
";
React.renderComponent(
<ReactPlayground codeText={HELLO_COMPONENT} renderCode={true} />,
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')
);

View File

@@ -1,8 +1,3 @@
/**
* @jsx React.DOM
*/
var IS_MOBILE = (
navigator.userAgent.match(/Android/i)
|| navigator.userAgent.match(/webOS/i)
@@ -14,25 +9,33 @@ var IS_MOBILE = (
);
var CodeMirrorEditor = React.createClass({
componentDidMount: function(root) {
if (IS_MOBILE) {
return;
}
componentDidMount: function() {
if (IS_MOBILE) return;
this.editor = CodeMirror.fromTextArea(this.refs.editor.getDOMNode(), {
mode: 'javascript',
lineNumbers: false,
lineWrapping: true,
smartIndent: false, // javascript mode does bad things with jsx indents
matchBrackets: true,
theme: 'solarized-light'
theme: 'solarized-light',
readOnly: this.props.readOnly
});
this.editor.on('change', this.onChange.bind(this));
this.onChange();
this.editor.on('change', this.handleChange);
},
onChange: function() {
if (this.props.onChange) {
var content = this.editor.getValue();
this.props.onChange(content);
componentDidUpdate: function() {
if (this.props.readOnly) {
this.editor.setValue(this.props.codeText);
}
},
handleChange: function() {
if (!this.props.readOnly) {
this.props.onChange && this.props.onChange(this.editor.getValue());
}
},
render: function() {
// wrap in a div to fully contain CodeMirror
var editor;
@@ -40,91 +43,167 @@ var CodeMirrorEditor = React.createClass({
if (IS_MOBILE) {
editor = <pre style={{overflow: 'scroll'}}>{this.props.codeText}</pre>;
} else {
editor = <textarea ref="editor">{this.props.codeText}</textarea>;
editor = <textarea ref="editor" defaultValue={this.props.codeText} />;
}
return (
<div class={this.props.className}>
<div style={this.props.style} className={this.props.className}>
{editor}
</div>
);
}
});
var selfCleaningTimeout = {
componentDidUpdate: function() {
clearTimeout(this.timeoutID);
},
setTimeout: function() {
clearTimeout(this.timeoutID);
this.timeoutID = setTimeout.apply(null, arguments);
}
};
var ReactPlayground = React.createClass({
MODES: {XJS: 'XJS', JS: 'JS'}, //keyMirror({XJS: true, JS: true}),
mixins: [selfCleaningTimeout],
MODES: {JSX: 'JSX', JS: 'JS'}, //keyMirror({JSX: true, JS: true}),
propTypes: {
codeText: React.PropTypes.string.isRequired,
transformer: React.PropTypes.func,
renderCode: React.PropTypes.bool,
showCompiledJSTab: React.PropTypes.bool,
editorTabTitle: React.PropTypes.string
},
getDefaultProps: function() {
return {
transformer: function(code) {
return JSXTransformer.transform(code).code;
},
editorTabTitle: 'Live JSX Editor',
showCompiledJSTab: true
};
},
getInitialState: function() {
return {mode: this.MODES.XJS, code: this.props.codeText};
return {
mode: this.MODES.JSX,
code: this.props.codeText,
};
},
bindState: function(name) {
return function(value) {
var newState = {};
newState[name] = value;
this.setState(newState);
}.bind(this);
handleCodeChange: function(value) {
this.setState({code: value});
this.executeCode();
},
getDesugaredCode: function() {
return JSXTransformer.transform(this.state.code).code;
handleCodeModeSwitch: function(mode) {
this.setState({mode: mode});
},
compileCode: function() {
return this.props.transformer(this.state.code);
},
render: function() {
var content;
if (this.state.mode === this.MODES.XJS) {
content =
<CodeMirrorEditor
onChange={this.bindState('code')}
class="playgroundStage"
codeText={this.state.code}
/>;
} else if (this.state.mode === this.MODES.JS) {
content =
<div class="playgroundJS playgroundStage">
{this.getDesugaredCode()}
</div>;
}
var isJS = this.state.mode === this.MODES.JS;
var compiledCode = '';
try {
compiledCode = this.compileCode();
} catch (err) {}
var JSContent =
<CodeMirrorEditor
key="js"
className="playgroundStage CodeMirror-readonly"
onChange={this.handleCodeChange}
codeText={compiledCode}
readOnly={true}
/>;
var JSXContent =
<CodeMirrorEditor
key="jsx"
onChange={this.handleCodeChange}
className="playgroundStage"
codeText={this.state.code}
/>;
var JSXTabClassName =
'playground-tab' + (isJS ? '' : ' playground-tab-active');
var JSTabClassName =
'playground-tab' + (isJS ? ' playground-tab-active' : '');
var JSTab =
<div
className={JSTabClassName}
onClick={this.handleCodeModeSwitch.bind(this, this.MODES.JS)}>
Compiled JS
</div>;
var JSXTab =
<div
className={JSXTabClassName}
onClick={this.handleCodeModeSwitch.bind(this, this.MODES.JSX)}>
{this.props.editorTabTitle}
</div>
return (
<div class="playground">
<div class="playgroundCode">
{content}
<div className="playground">
<div>
{JSXTab}
{this.props.showCompiledJSTab && JSTab}
</div>
<div class="playgroundPreview">
<div className="playgroundCode">
{isJS ? JSContent : JSXContent}
</div>
<div className="playgroundPreview">
<div ref="mount" />
</div>
</div>
);
},
componentDidMount: function() {
this.executeCode();
},
componentDidUpdate: function() {
this.executeCode();
componentDidUpdate: function(prevProps, prevState) {
// execute code only when the state's not being updated by switching tab
// this avoids re-displaying the error, which comes after a certain delay
if (this.props.transformer !== prevProps.transformer ||
this.state.code !== prevState.code) {
this.executeCode();
}
},
executeCode: function() {
var mountNode = this.refs.mount.getDOMNode();
try {
React.unmountAndReleaseReactRootNode(mountNode);
React.unmountComponentAtNode(mountNode);
} catch (e) { }
try {
var compiledCode = this.compileCode();
if (this.props.renderCode) {
React.renderComponent(
<pre>{this.getDesugaredCode()}</pre>,
React.render(
<CodeMirrorEditor codeText={compiledCode} readOnly={true} />,
mountNode
);
} else {
eval(this.getDesugaredCode());
eval(compiledCode);
}
} catch (e) {
React.renderComponent(
<div content={e.toString()} class="playgroundError" />,
mountNode
);
} catch (err) {
this.setTimeout(function() {
React.render(
<div className="playgroundError">{err.toString()}</div>,
mountNode
);
}, 500);
}
}
});

Some files were not shown because too many files have changed in this diff Show More