Compare commits

...

753 Commits

Author SHA1 Message Date
Paul O’Shannessy
3845e214a4 v0.11.2 2014-09-16 11:09:36 -07:00
jeffmo
530201526a Add support for a --strip-types flag to bin/jsx
(cherry picked from commit 808730df59)

Conflicts:
	vendor/fbtransform/visitors.js
2014-09-16 10:34:31 -07:00
Paul O’Shannessy
55e216cae8 Update shrinkwrap again
Travis ran into some problems, hopefully this fixes it.
2014-09-16 10:10:47 -07:00
Paul O’Shannessy
94643c8225 Update shrinkwrap 2014-09-16 09:07:29 -07:00
jeffmo
fc499aa5f7 Bump esprima + jstransform versions
Conflicts:
	package.json
2014-09-15 17:43:42 -07:00
Paul O’Shannessy
99632781fd Merge pull request #2033 from pekim/master
Add support for <dialog> tag.
2014-09-15 17:37:38 -07:00
Paul O’Shannessy
ad52ef949f Merge pull request #1848 from fgnass/master
add picture element and related attributes
2014-09-15 17:37:14 -07:00
Paul O’Shannessy
c86c9d15df Merge pull request #2177 from zpao/0.11-createElement
Add createElement for 0.11
2014-09-15 16:16:45 -07:00
Paul O’Shannessy
eef717ced7 Add createElement for 0.11
This also adds the deprecation notice to createDescriptor. Chances are
that nobody is using that, but doesn't hurt.
2014-09-12 15:18:33 -07:00
Christopher Chedeau
bb9f22787d Update 2014-09-12-community-round-up-22.md 2014-09-12 11:36:58 -07:00
Christopher Chedeau
3ea1b517d7 Community roundup #22 2014-09-12 11:36:58 -07:00
Paul O’Shannessy
61a9d686ee Merge pull request #2147 from naman34/patch-2
added the missing **
2014-09-04 16:27:29 -07:00
Paul O’Shannessy
f1389a8859 JSX spec blog post 2014-09-03 16:02:52 -07:00
Paul O’Shannessy
6adc67c4c9 Fix broken link in animation docs
Missed in #2068
2014-09-03 15:51:34 -07:00
Cheng Lou
4adeaed871 Merge pull request #2068 from ChrisSki/patch-1
Update 09.1-animation.md
2014-09-03 15:51:27 -07:00
Paul O’Shannessy
5b2341fa58 Merge pull request #2120 from zpao/svg-logo
[docs] SVG logo
2014-09-03 15:51:22 -07:00
Paul O’Shannessy
db1d5d263f Merge pull request #2124 from Daniel15/htmltojsx-fixes
Small tweaks to HTML to JSX page
2014-09-03 15:51:13 -07:00
Paul O’Shannessy
120457b465 Merge pull request #2091 from julen/docs/LinkedState
Docs: renamed input's state to `inputValue`
2014-09-03 15:51:09 -07:00
Paul O’Shannessy
ca87d5d9da Merge pull request #2075 from IvanVergiliev/patch-1
Add 2048-react to open-source demos
2014-09-03 15:51:03 -07:00
Paul O’Shannessy
593e67f9b0 Merge pull request #2119 from naman34/patch-1
added production example
2014-09-03 15:50:58 -07:00
Ben Alpert
78f6c07cd2 Merge pull request #2080 from fisherwebdev/master
[docs] Update Flux TodoMVC Tutorial
2014-09-03 15:50:53 -07:00
Ben Alpert
e9f40faf8e Merge pull request #2083 from chenglou/docs-retina-icon
[Docs] Make retina react logo work
2014-09-03 15:50:49 -07:00
Cheng Lou
2eba8f5a9e Merge pull request #2078 from michaelrp/patch-1
Including missing validation check
2014-09-03 15:50:44 -07:00
Paul O’Shannessy
be5e3c5ef4 Merge pull request #2076 from whatasunnyday/master
Add example to if else in JSX.
2014-09-03 15:50:40 -07:00
Paul O’Shannessy
f77df86595 Merge pull request #2062 from dmitriiabramov/patch-1
remove doubled whitespace chars in jsDoc
2014-09-03 15:50:36 -07:00
Cheng Lou
5a181591f8 Merge pull request #2058 from chantastic/patch-2
docs(flux-todo-list): fix TodoStore syntax
2014-09-03 15:50:31 -07:00
Ben Alpert
0dd329370a Merge pull request #2038 from zpao/update-testutil-docs
TestUtils docs: isComponentOfType -> isDescriptorOfType
2014-09-03 15:50:27 -07:00
Paul O’Shannessy
73d5012e1d Merge pull request #1832 from rayqian/master
Add chinese translation for 02-displaying-data.md
2014-09-03 15:50:22 -07:00
Paul O’Shannessy
e6768e5039 Merge pull request #1867 from WickyNilliams/patch-1
Add note about key prop being excluded by cloneWithProps
2014-09-03 15:50:19 -07:00
Paul O’Shannessy
70bc593b05 Merge pull request #2007 from janhancic/better-docs-for-select-multiple
Add a 'note' about passing arrays into the `value` attribute
2014-09-03 15:50:15 -07:00
Paul O’Shannessy
fd9b0a8de6 Merge pull request #2010 from nw/patch-1
Update ref-01-top-level-api.md
2014-09-03 15:50:11 -07:00
Ben Alpert
9a1f997f74 [docs] Move "| React" to end of OG title
For consistency!
2014-09-03 15:50:04 -07:00
Paul O’Shannessy
6eaaf37e44 [docs] Move "| React" to end of page title
Looks better in search results
2014-09-03 15:49:59 -07:00
Paul O’Shannessy
e6791bcd91 Merge pull request #1952 from slorber/master
Update 09.2-form-input-binding-sugar.md -> document checkedLink
2014-09-03 15:49:47 -07:00
Paul O’Shannessy
719198f51f Merge pull request #2035 from zpao/jekyll-update
[Docs] Update Jekyll + more
2014-08-13 15:25:32 -07:00
Jed Watson
b8d28a73a5 Updating "Tutorial" label as per suggestion
(cherry picked from commit bfd0a53d3e)
2014-08-13 13:07:01 -07:00
Jed Watson
bc612fb375 Adding "Tutorial" label to Flux Todo List nav item
(cherry picked from commit 2e6ff6449b)
2014-08-13 13:07:01 -07:00
Andre Z Sanchez
2c3460b8db Fix typo
(cherry picked from commit 6f49827c12)
2014-08-12 15:15:30 -07:00
Paul O’Shannessy
66e22a9acf Remove TodoMVC flux example
It lives at https://github.com/facebook/flux/tree/master/examples/flux-todomvc now.

(cherry picked from commit 1033c4805f)

Conflicts:
	examples/todomvc-flux/js/components/Footer.react.js
	examples/todomvc-flux/js/components/MainSection.react.js
	examples/todomvc-flux/js/stores/TodoStore.js
	examples/todomvc-flux/package.json
2014-08-12 15:15:25 -07:00
Adam Mark
2c40e8c98b Copy edit (fix grammar)
(cherry picked from commit 8642262aad)
2014-08-12 15:14:46 -07:00
Adam Mark
97376ba1ba Close <section> tag in sample markup
(cherry picked from commit 77d7b4928e)
2014-08-12 15:14:46 -07:00
Sam Selikoff
4fe7d32f29 Clarify section introducing callbacks
(cherry picked from commit 90888debd0)
2014-08-12 15:14:46 -07:00
Sam Selikoff
d26961562b Clarify section introducing props
(cherry picked from commit 255f238cee)
2014-08-12 15:14:46 -07:00
Ben Alpert
8fcf04aa73 [docs] Add parens to defeat ASI in example
Fixes #1996.

(cherry picked from commit e39a28c175)
2014-08-12 15:14:46 -07:00
Ben Alpert
89872fcb30 Wording tweaks to reconciliation docs
(cherry picked from commit e2dad02ef2)
2014-08-12 15:14:46 -07:00
Julien Bordellier
9ebc6477fc Using the markdown's quote syntax and explaining why use include jQuery
(cherry picked from commit 46c0bbfb11)
2014-08-12 15:14:46 -07:00
Jim OBrien
8b2844203c typo
(cherry picked from commit 0e7526e401)
2014-08-12 15:14:46 -07:00
Julen Ruiz Aizpuru
57774a7b6a Docs: added note about setState() side-effects
(cherry picked from commit 1219663e9a)
2014-08-12 15:14:46 -07:00
Julien Bordellier
a4e8cc1fe4 Adding a note just below the jQuery inclusion in the tutorial to inform that jQuery is not mandatory.
It's linked with #603

(cherry picked from commit 5eca8d604f)
2014-08-12 15:14:46 -07:00
cutbko
d0f83ed8ea Update ref-08-reconciliation.md
(cherry picked from commit d0494ac85c)
2014-08-12 15:14:46 -07:00
Shane O'Sullivan
b3248327b2 Update 2014-07-28-community-roundup-20.md
(cherry picked from commit 460ca72abb)
2014-08-12 15:14:46 -07:00
Christopher Chedeau
25caaad45c typo "refere" -> "reference" 2014-08-03 18:51:47 +02:00
Christopher Chedeau
cb68cedf73 english + casing + 02 -> 03 2014-08-03 18:29:53 +02:00
Christopher Chedeau
af67277dd6 Community Roundup #21 2014-08-03 18:29:53 +02:00
Vjeux
7d1e091b4b update background color for image 2014-07-30 21:04:23 +02:00
Vjeux
1f0f89d254 fix spurious ) 2014-07-30 19:42:59 +02:00
Vjeux
aaa8ffe6b2 Include image 2014-07-30 19:31:55 +02:00
Vjeux
fc4ccdcbd8 Flux blog post about dispatcher 2014-07-30 19:08:29 +02:00
Christopher Chedeau
8ce7ebe009 Rename "Ice Lab studio" to "Icelab" 2014-07-28 11:50:37 +02:00
Shane O'Sullivan
81245c94f4 Fix small language nits 2014-07-28 11:50:30 +02:00
David Hu
a5efe9447d 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).

(cherry picked from commit 721f397303)
2014-07-27 16:05:44 -07:00
Shane O'Sullivan
42ae273fd9 Fix typo for 'fundations'
(cherry picked from commit 0c4b2728c8)
2014-07-27 13:30:32 -07:00
Ben Alpert
75e686a1db Wording tweaks to community roundup
(cherry picked from commit e30b60cc58)
2014-07-27 13:06:50 -07:00
Vjeux
c006ec1b8c Community Round-up #20 2014-07-27 14:24:23 +02:00
Paul O’Shannessy
13cfbd1641 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 11:30:55 -07:00
Paul O’Shannessy
7e946bcb9c v0.11.1 2014-07-25 11:29:12 -07:00
Paul O’Shannessy
7cb534dc08 [docs] increase base font-weight
Closes #1926

(cherry picked from commit eb8f766005)
2014-07-24 21:01:54 -07:00
Ben Alpert
925f459288 Simpler way to prevent flushing updates on server
Test Plan: Only failing tests in jest are immutable tests that were already failing.

(cherry picked from commit 6259d88f03)
2014-07-24 20:54:14 -07:00
petehunt
067644a4ae Fix browser-tranforms
(cherry picked from commit e8efa2a1e9)
2014-07-23 21:10:51 -07:00
Andreas Svensson
5c4c13fcee Remove empty TextNode left behind by IE8 setInnerHTML workaround
(cherry picked from commit 8a135c0e75)
2014-07-23 18:59:58 -07:00
Andreas Svensson
eb6d101bae getModifierState should always return a boolean
(cherry picked from commit 030071dd8b)
2014-07-23 11:06:25 -07:00
Andreas Svensson
b0ab09fc30 getModifierState incorrectly exposed as SyntheticMouseEvent.getEventModifierState
(cherry picked from commit 6f0db65777)
2014-07-23 11:06:25 -07:00
Ben Alpert
df0a678fbb Don't initialize reconcile transaction on server
...when calling setState from within a componentWillMount. Fixes #1866.

Test Plan: jest

(cherry picked from commit 54d91c293d)
2014-07-23 11:06:25 -07:00
Andreas Svensson
975ce371e8 getModifierState is case sensitive
(cherry picked from commit 495d866a66)
2014-07-23 11:06:25 -07:00
Cheng Lou
a712e75e83 [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.

(cherry picked from commit d95a4ef983)
2014-07-23 11:04:34 -07:00
Tom Hauburger
aabb85f849 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
(cherry picked from commit c94bb20cb8)
2014-07-23 11:04:34 -07:00
Ben Alpert
a962487c54 Reword sentence in reconciliation docs
(cherry picked from commit 93712246c8)
2014-07-23 11:04:34 -07:00
Glen Mailer
c28f00c19a Note how to access Perf in docs
(cherry picked from commit 83fd5583bf)
2014-07-23 11:04:02 -07:00
James Seppi
0ad2737713 fix typo
Closes #1859.

(cherry picked from commit 6d1ede34df)
2014-07-17 15:58:43 -07:00
Kyle Mathews
14664ceefd Update 2014-07-17-react-v0.11.md
(cherry picked from commit bd5e8aa076)
2014-07-17 15:22:28 -07:00
Ben Alpert
e8a11eed73 Merge pull request #1835 from amm385/patch-1
Update videos.md
2014-07-17 15:21:10 -07:00
Paul O’Shannessy
d1e3e157c4 Release materials for 0.11 2014-07-17 13:47:06 -07:00
Paul O’Shannessy
95d82cacd6 Update version to 0.11.0 2014-07-17 13:47:06 -07:00
Paul O’Shannessy
0d5e5bee3c shrinkwrap for 0.11 [skip ci] 2014-07-17 13:47:06 -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
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
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
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
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
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
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
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
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
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
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
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
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
466 changed files with 17871 additions and 6612 deletions

View File

@@ -12,3 +12,6 @@ trim_trailing_whitespace = true
[*.md]
max_line_length = 0
trim_trailing_whitespace = false
[COMMIT_EDITMSG]
max_line_length = 0

1
.gitignore vendored
View File

@@ -12,7 +12,6 @@ build/
docs/code
docs/_site
docs/.sass-cache
docs/css/react.css
docs/js/*
docs/downloads
examples/shared/*.js

View File

@@ -1,12 +1,26 @@
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>
Jaime Mingo <j.mingov@3boll.com>
James Brantly <james@jbrantly.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>
@@ -18,8 +32,10 @@ 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>
@@ -29,7 +45,10 @@ 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>
Sander Spies <sandermail@gmail.com>
@@ -39,3 +58,5 @@ 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

@@ -2,12 +2,15 @@
language: node_js
node_js:
- '0.10'
cache:
directories:
- node_modules
script:
- |
grunt $TEST_TYPE
after_script:
- |
if [ "$TEST_TYPE" = test:full ] && [ "$SERVER" ]; then
if [ "$TEST_TYPE" = test ] && [ "$SERVER" ]; then
grunt build
curl \
-F "react=@build/react.js" \
@@ -26,16 +29,9 @@ after_script:
fi
env:
matrix:
- TEST_TYPE=test:full
- TEST_TYPE=test
- TEST_TYPE=lint
- TEST_TYPE=perf:full
- TEST_TYPE=test:coverage
- TEST_TYPE=test:webdriver:saucelabs BROWSER_NAME=ie11
- TEST_TYPE=test:webdriver:saucelabs BROWSER_NAME=ie10
- TEST_TYPE=test:webdriver:saucelabs BROWSER_NAME=ie9
- TEST_TYPE=test:webdriver:saucelabs BROWSER_NAME=ie8
- TEST_TYPE=test:webdriver:saucelabs:ios
- TEST_TYPE=test:webdriver:saucelabs BROWSER_NAME=safari
- TEST_TYPE=test:webdriver:saucelabs:modern
global:
# SERVER
- secure: qPvsJ46XzGrdIuPA70b55xQNGF8jcK7N1LN5CCQYYocXLa+fBrl+fTE77QvehOPhqwJXcj6kOxI+sY0KrVwV7gmq2XY2HZGWUSCxTN0SZlNIzqPA80Y7G/yOjA4PUt8LKgP+8tptyhTAY56qf+hgW8BoLiKOdztYF2p+3zXOLuA=
@@ -47,6 +43,7 @@ matrix:
- env: TEST_TYPE=lint
- 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

82
AUTHORS
View File

@@ -1,3 +1,5 @@
Adam Krebs <amk528@cs.nyu.edu>
Adam Solove <asolove@gmail.com>
Alan deLevie <adelevie@gmail.com>
Alex Zelenskiy <azelenskiy@fb.com>
Alexander Solovyov <alexander@solovyov.net>
@@ -5,82 +7,131 @@ Andreas Svensson <andreas@syranide.com>
Andrew Davey <andrew@equin.co.uk>
Andrew Zich <azich@fb.com>
Andrey Popp <8mayday@gmail.com>
Anthony van der Hoorn <anthony.vanderhoorn@gmail.com>
Ayman Osman <aymano.osman@gmail.com>
Ben Alpert <spicyjalapeno@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>
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>
Cheng Lou <chenglou92@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>
Dan Schafer <dschafer@fb.com>
Daniel Gasienica <dgasienica@zynga.com>
Daniel Lo Nigro <danlo@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>
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 Kling <fkling@fb.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>
Geert Pasteels <geert.pasteels@gmail.com>
Geert-Jan Brits <gbrits@gmail.com>
George A Sisco III <george.sisco@gmail.com>
Gilbert <gilbertbgarza@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>
Jaime Mingo <j.mingov@3boll.com>
Jakub Malinowski <jakubmal@gmail.com>
James Brantly <james@jbrantly.com>
James Ide <ide@fb.com>
Jamie Wong <jamie.lf.wong@gmail.com>
Jamison Dance <jergason@gmail.com>
Jan Kassens <jkassens@fb.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>
Jeff Barczewski <jeff.barczewski@gmail.com>
Jeff Carpenter <gcarpenterv@gmail.com>
Jeff Morrison <jeff@anafx.com>
Jeff Welch <whatthejeff@gmail.com>
Jeffrey Lin <lin.jeffrey@gmail.com>
Jignesh Kakadiya <jigneshhk1992@gmail.com>
Jing Chen <jingc@fb.com>
Johannes Baiter <johannes.baiter@gmail.com>
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>
Jun Wu <quark@lihdd.net>
Juraj Dudak <jdudak@fb.com>
Justin Jaffray <justinjaffray@khanacademy.org>
Karl Mikkelsen <karl@kingkarl.com>
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>
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 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>
Michal Srb <xixixao@seznam.cz>
Mouad Debbar <mdebbar@fb.com>
Nadeesha Cabral <nadeesha.cabral@gmail.com>
Nate Hunzaker <nate.hunzaker@gmail.com>
Nicholas Bergson-Shilcock <me@nicholasbs.net>
Nick Gavalas <njg57@cornell.edu>
Nick Thompson <ncthom91@gmail.com>
Niklas Boström <nbostrom@gmail.com>
Owen Coutts <owenc@fb.com>
Pascal Hartig <passy@twitter.com>
Paul OShannessy <paul@oshannessy.com>
@@ -88,21 +139,40 @@ 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>
Ryan Seddon <seddon.ryan@gmail.com>
Sahat Yalkabov <sakhat@gmail.com>
Sander Spies <sandermail@gmail.com>
Sean Kinsey <oyvind@fb.com>
Sebastian Markbåge <sebastian@calyptus.eu>
Shaun Trennery <shaun.trennery@gmail.com>
Simon Højberg <r.hackr@gmail.com>
Stefan Dombrowski <sdo451@gmail.com>
Stephen Murphy <smurphy3@apple.com>
Stoyan Stefanov <ssttoo@ymail.com>
Sundeep Malladi <sundeep.malladi@gmail.com>
Sven Helmberger <fforw@gmx.de>
Thomas Aylott <oblivious@subtlegradient.com>
Thomas Boyt <thomas.boyt@venmo.com>
Thomas Shaddox <thomas@heyzap.com>
Thomas Shafer <thomasjshafer@gmail.com>
Timothy Yung <yungsters@gmail.com>
Tom Haggie <thaggie@gmail.com>
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>
Wincent Colaiuta <win@wincent.com>
Zach Bruggeman <zbruggeman@me.com>
Yuriy Dybskiy <yuriy@dybskiy.com>
Yuval Dekel <thedekel@fb.com>
Zach Bruggeman <mail@bruggie.com>
davidxi <davidgraycn@gmail.com>
imagentleman <imagentlemail@gmail.com>
plievone <plievone@cc.hut.fi>

View File

@@ -1,3 +1,96 @@
## 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
@@ -12,6 +105,7 @@
- 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

View File

@@ -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

View File

@@ -20,15 +20,14 @@ module.exports = function(grunt) {
copy: require('./grunt/config/copy'),
jsx: require('./grunt/config/jsx'),
browserify: require('./grunt/config/browserify'),
populist: require('./grunt/config/populist'),
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', '.module-cache'],
jshint: require('./grunt/config/jshint'),
compare_size: require('./grunt/config/compare_size'),
complexity: require('./grunt/config/complexity')
compare_size: require('./grunt/config/compare_size')
});
grunt.config.set('compress', require('./grunt/config/compress'));
@@ -67,7 +66,8 @@ module.exports = function(grunt) {
grunt.registerTask('npm-react:release', npmReactTasks.buildRelease);
grunt.registerTask('npm-react:pack', npmReactTasks.packRelease);
grunt.registerTask('npm-react-tools:pack', npmReactToolsTasks.pack);
grunt.registerTask('npm-react-tools:release', npmReactToolsTasks.buildRelease);
grunt.registerTask('npm-react-tools:pack', npmReactToolsTasks.packRelease);
grunt.registerTask('version-check', versionCheckTask);
@@ -150,6 +150,18 @@ module.exports = function(grunt) {
'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',
@@ -179,7 +191,20 @@ module.exports = function(grunt) {
'test:webdriver:phantomjs',
'coverage:parse'
]);
grunt.registerTask('test', ['build:test', 'build:basic', 'test:webdriver:phantomjs']);
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']);
@@ -196,6 +221,7 @@ module.exports = function(grunt) {
'browserify:addonsMin',
'npm-react:release',
'npm-react:pack',
'npm-react-tools:release',
'npm-react-tools:pack',
'copy:react_docs',
'compare_size'

View File

@@ -1,4 +1,4 @@
# [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.
@@ -8,10 +8,6 @@ React is a JavaScript library for building user interfaces.
[Learn how to use React in your own project.](http://facebook.github.io/react/docs/getting-started.html)
## The `react` npm package has recently changed!
If you're looking for jeffbski's [React.js](https://github.com/jeffbski/autoflow) project, it's now in `npm` as `autoflow` rather than `react`.
## Examples
We have several examples [on the website](http://facebook.github.io/react/). Here is the first one to get you started:
@@ -40,12 +36,12 @@ The fastest way to get started is to serve JavaScript from the CDN (also availab
```html
<!-- The core React library -->
<script src="http://fb.me/react-0.8.0.js"></script>
<script src="http://fb.me/react-0.11.1.js"></script>
<!-- In-browser JSX transformer, remove when pre-compiling JSX. -->
<script src="http://fb.me/JSXTransformer-0.8.0.js"></script>
<script src="http://fb.me/JSXTransformer-0.11.1.js"></script>
```
We've also built a [starter kit](http://facebook.github.io/react/downloads/react-0.8.0.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.11.1.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:
@@ -87,6 +83,10 @@ We use grunt to automate many tasks. Run `grunt -h` to see a mostly complete lis
```sh
# Build and run tests with PhantomJS
grunt test
# 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 JSHint
grunt lint
# Wipe out build directory

22
bin/jsx
View File

@@ -2,8 +2,7 @@
// -*- mode: js -*-
"use strict";
var visitors = require('../vendor/fbtransform/visitors');
var transform = require('jstransform').transform;
var transform = require('../main').transform;
require('commoner').version(
require('../package.json').version
@@ -12,13 +11,18 @@ require('commoner').version(
}).option(
'--harmony',
'Turns on JS transformations such as ES6 Classes etc.'
).option(
'--strip-types',
'Strips out type annotations.'
).option(
'--source-map-inline',
'Embed inline sourcemap in transformed source'
).process(function(id, source) {
// This is where JSX, ES6, etc. desugaring happens.
var visitorList;
if (this.options.harmony) {
visitorList = visitors.getAllVisitors();
} else {
visitorList = visitors.transformVisitors.react;
}
return transform(visitorList, source).code;
var options = {
harmony: this.options.harmony,
sourceMap: this.options.sourceMapInline,
stripTypes: this.options.stripTypes
};
return transform(source, options);
});

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

@@ -3,19 +3,17 @@ source 'https://rubygems.org'
gem 'rake'
# jekyll, which builds it all
gem 'jekyll', '~>1.3.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'
gem 'sanitize', '~>2.0'

View File

@@ -1,61 +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.5)
highline (~> 1.6.11)
execjs (2.2.1)
fast-stemmer (1.0.2)
ffi (1.9.3)
highline (1.6.20)
jekyll (1.3.0)
jekyll (2.2.0)
classifier (~> 1.3)
colorator (~> 0.1)
commander (~> 4.1.3)
liquid (~> 2.5.2)
listen (~> 1.3)
maruku (~> 0.6.0)
pygments.rb (~> 0.5.0)
redcarpet (~> 2.3.0)
safe_yaml (~> 0.9.7)
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)
liquid (2.5.4)
listen (1.3.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)
rb-kqueue (>= 0.2)
maruku (0.6.1)
syntax (>= 1.0.0)
mini_portile (0.5.2)
nokogiri (1.6.0)
mini_portile (~> 0.5.0)
posix-spawn (0.3.6)
pygments.rb (0.5.4)
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)
rake (10.1.0)
rb-fsevent (0.9.3)
rb-inotify (0.9.2)
rake (10.3.2)
rb-fsevent (0.9.4)
rb-inotify (0.9.5)
ffi (>= 0.5.0)
rb-kqueue (0.2.0)
ffi (>= 0.5.0)
redcarpet (2.3.0)
safe_yaml (0.9.7)
redcarpet (3.1.2)
safe_yaml (1.0.3)
sanitize (2.0.6)
nokogiri (>= 1.4.4)
sass (3.2.12)
syntax (1.0.0)
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.3.0)
jekyll (~> 2.0)
jekyll-redirect-from
json
rake
rb-fsevent
redcarpet
sanitize
sass
sanitize (~> 2.0)

View File

@@ -32,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/
```
@@ -43,10 +43,9 @@ 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
@@ -55,7 +54,13 @@ $ rake watch # Automatically compiles as needed.
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,19 +2,13 @@ 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"
end
desc "watch css & js"
desc "watch js"
task :watch do
Process.spawn "sass --style=compressed --watch _css/react.scss:css/react.css"
Process.spawn "../bin/jsx --watch _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 => [:update_version, :default] do
system "jekyll build -d ../../react-gh-pages"
end
task :default => [:css, :js]
task :default => [:js]

View File

@@ -1,21 +1,37 @@
---
baseurl: /react
name: React
description: A JavaScript library for building user interfaces
url: http://facebook.github.io
permalink: /blog/:year/:month/:day/:title.html
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
markdown: redcarpet
redcarpet:
extensions:
- fenced_code_blocks
pygments: true
name: React
markdown: redcarpet
react_version: 0.9.0-rc1
description: A JavaScript library for building user interfaces
relative_permalinks: true
paginate: 5
paginate_path: /blog/page:num/
timezone: America/Los_Angeles
sass:
style: :compressed
sass_dir: _css
gems:
- jekyll-redirect-from
react_version: 0.11.1

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,179 @@
---
- - Adam Krebs
- Adam Solove
- Alan deLevie
- Alex Zelenskiy
- Alexander Solovyov
- Andreas Svensson
- Andrew Davey
- Andrew Zich
- Andrey Popp
- Anthony van der Hoorn
- Ayman Osman
- Ben Alpert
- Ben Newman
- Ben Ripkens
- Bill Fisher
- Bob Eagan
- Bojan Mihelac
- Brandon Bloom
- Brian Cooke
- Brian Kim
- Brian Reavis
- Brian Rue
- Cam Spiers
- Cassus Adam Banko
- Cat Chen
- Cheng Lou
- Christian Roman
- Christoph Pojer
- Christopher Monsanto
- Clay Allsopp
- Connor McSheffrey
- Dan Schafer
- Daniel Gasienica
- Daniel Lo Nigro
- Daniel Miladinov
- Daniel Schonfeld
- Danny Ben-David
- Daryl Lau
- David Hellsing
- David Hu
- Devon Blandin
- Dmitry Mazuro
- Dustin Getz
- Enguerran
- Eric Clemmons
- Eric Florenzano
- Eric Schoffstall
- Evan Coonrod
- Fabio M. Costa
- Felipe Oliveira Carvalho
- Felix Kling
- Fernando Correia
- François-Xavier Bois
- Fred Zhao
- G Scott Olson
- Geert Pasteels
- Geert-Jan Brits
- George A Sisco III
- Gilbert
- 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
- Jaime Mingo
- Jakub Malinowski
- James Brantly
- James Ide
- Jamie Wong
- Jamison Dance
- Jan Kassens
- Jared Forsyth
- Jason Bonta
- Jason Trill
- Jean Lauliac
- Jeff Barczewski
- Jeff Carpenter
- Jeff Morrison
- Jeff Welch
- Jeffrey Lin
- Jignesh Kakadiya
- Jing Chen
- Johannes Baiter
- John Watson
- Jon Beebe
- Jonas Enlund
- Jonas Gebhardt
- Jonathan Hsu
- Jordan Walke
- Josh Bassett
- Josh Duck
- Josh Yudaken
- Joshua Ma
- Julen Ruiz Aizpuru
- Jun Wu
- Juraj Dudak
- Justin Jaffray
- Karl Mikkelsen
- Keito Uchiyama
- Kit Randel
- Kunal Mehta
- Kyle Mathews
- Laurence Rowe
- Levi McCallum
- Lily
- Logan Allen
- Luigy Leon
- Marcin Kwiatkowski
- Marcin Szczepanski
- Mariano Desanze
- Mark Richardson
- Marshall Roch
- - Martin Andert
- Martin Konicek
- Mathieu M-Gosselin
- Matt Harrison
- Matthew Dapena-Tretter
- Matti Nelimarkka
- Michal Srb
- Mouad Debbar
- Nadeesha Cabral
- Nate Hunzaker
- Nicholas Bergson-Shilcock
- Nick Gavalas
- Nick Thompson
- Niklas Boström
- Owen Coutts
- 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
- Ryan Seddon
- Sahat Yalkabov
- Sander Spies
- Sean Kinsey
- Sebastian Markbåge
- Shaun Trennery
- Simon Højberg
- Stefan Dombrowski
- Stephen Murphy
- Stoyan Stefanov
- Sundeep Malladi
- Sven Helmberger
- Thomas Aylott
- Thomas Boyt
- Thomas Shaddox
- Thomas Shafer
- Timothy Yung
- Tom Haggie
- Tom Occhino
- Ville Immonen
- Vjeux
- Volkan Unsal
- Wayne Larsen
- Wincent Colaiuta
- Yuriy Dybskiy
- Yuval Dekel
- Zach Bruggeman
- davidxi
- imagentleman

View File

@@ -4,12 +4,16 @@
title: Getting Started
- id: tutorial
title: Tutorial
- id: thinking-in-react
title: Thinking in React
- title: Community Resources
items:
- id: videos
title: Videos
- id: complementary-tools
title: Complementary Tools
- id: example-apps
title: Example Apps
- id: examples
title: Examples
- title: Guides
items:
- id: why-react
@@ -49,8 +53,12 @@
title: Test Utilities
- id: clone-with-props
title: Cloning Components
- id: examples
title: Examples
- id: update
title: Immutability Helpers
- id: pure-render-mixin
title: PureRenderMixin
- id: perf
title: Performance Tools
- title: Reference
items:
- id: top-level-api
@@ -69,3 +77,9 @@
title: Special Non-DOM Attributes
- id: reconciliation
title: Reconciliation
- title: Flux
items:
- id: flux-overview
title: Flux Overview
- id: flux-todo-list
title: Flux TodoMVC Tutorial

View File

@@ -30,3 +30,7 @@
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

View File

@@ -79,6 +79,8 @@ var HELLO_COMPONENT = "\
codeText={HELLO_COMPONENT}
renderCode={true}
transformer={this.convertToJSX}
showCompiledJSTab={false}
editorTabTitle="Live HTML Editor"
/>
</div>
);

View File

@@ -13,15 +13,38 @@ var HelloMessage = React.createClass({\n\
React.renderComponent(<HelloMessage name=\"John\" />, mountNode);\
";
var transformer = function(code) {
return JSXTransformer.transform(code).code;
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.renderComponent(
<ReactPlayground
codeText={HELLO_COMPONENT}
renderCode={true}
transformer={transformer}
showCompiledJSTab={false}
/>,
<CompilerPlayground />,
document.getElementById('jsxCompiler')
);

View File

@@ -79,6 +79,8 @@ var ReactPlayground = React.createClass({
codeText: React.PropTypes.string.isRequired,
transformer: React.PropTypes.func,
renderCode: React.PropTypes.bool,
showCompiledJSTab: React.PropTypes.bool,
editorTabTitle: React.PropTypes.string
},
getDefaultProps: function() {
@@ -86,6 +88,7 @@ var ReactPlayground = React.createClass({
transformer: function(code) {
return JSXTransformer.transform(code).code;
},
editorTabTitle: 'Live JSX Editor',
showCompiledJSTab: true
};
},
@@ -150,7 +153,7 @@ var ReactPlayground = React.createClass({
<div
className={JSXTabClassName}
onClick={this.handleCodeModeSwitch.bind(this, this.MODES.JSX)}>
Live JSX Editor
{this.props.editorTabTitle}
</div>
return (
@@ -173,10 +176,11 @@ var ReactPlayground = React.createClass({
this.executeCode();
},
componentWillUpdate: function(nextProps, nextState) {
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.state.code !== nextState.code) {
if (this.props.transformer !== prevProps.transformer ||
this.state.code !== prevState.code) {
this.executeCode();
}
},

View File

@@ -4,14 +4,14 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>React | {{ page.title }}</title>
<title>{{ page.title }} | React</title>
<meta name="viewport" content="width=device-width">
<meta property="og:title" content="React | {{ page.title }}" />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://facebook.github.io/react{{ page.url }}" />
<meta property="og:image" content="http://facebook.github.io/react/img/logo_og.png" />
<meta property="og:description" content="A JavaScript library for building user interfaces" />
<meta property="fb:app_id" content="623268441017527" />
<meta property="og:title" content="{{ page.title }} | React">
<meta property="og:type" content="website">
<meta property="og:url" content="http://facebook.github.io/react{{ page.url }}">
<meta property="og:image" content="http://facebook.github.io/react/img/logo_og.png">
<meta property="og:description" content="A JavaScript library for building user interfaces">
<meta property="fb:app_id" content="623268441017527">
<link rel="shortcut icon" href="/react/favicon.ico">
<link rel="alternate" type="application/rss+xml" title="{{ site.name }}" href="{{ site.url }}{{ site.baseurl }}/feed.xml">
@@ -30,7 +30,7 @@
<![endif]-->
<script type="text/javascript" src="/react/js/codemirror.js"></script>
<script type="text/javascript" src="/react/js/javascript.js"></script>
<script type="text/javascript" src="/react/js/react.min.js"></script>
<script type="text/javascript" src="/react/js/react.js"></script>
<script type="text/javascript" src="/react/js/JSXTransformer.js"></script>
<script type="text/javascript" src="/react/js/live_editor.js"></script>
<script type="text/javascript" src="/react/js/showdown.js"></script>
@@ -42,7 +42,7 @@
<div class="nav-main">
<div class="wrap">
<a class="nav-home" href="/react/index.html">
<img class="nav-logo" alt="" src="/react/img/logo_small.png" width="38" height="38">
<img class="nav-logo" src="/react/img/logo.svg" width="36" height="36">
React
</a>
<ul class="nav-site">
@@ -74,7 +74,10 @@
{{ content }}
<footer class="wrap">
<div class="left">A Facebook &amp; Instagram collaboration.</div>
<div class="left">
A Facebook &amp; Instagram collaboration.<br>
<a href="/react/acknowledgements.html">Acknowledgements</a>
</div>
<div class="right">&copy; 2014 Facebook Inc.</div>
</footer>
</div>

View File

@@ -7,8 +7,12 @@ sectionid: docs
{% include nav_docs.html %}
<div class="inner-content">
<h1>{{ page.title }}</h1>
<h1>
{{ page.title }}
<a class="edit-page-link" href="https://github.com/facebook/react/tree/master/docs/{{ page.path }}" target="_blank">Edit on GitHub</a>
</h1>
<div class="subHeader">{{ page.description }}</div>
{{ content }}
<div class="docs-prevnext">
@@ -19,7 +23,5 @@ sectionid: docs
<a class="docs-next" href="/react/docs/{{ page.next }}">Next &rarr;</a>
{% endif %}
</div>
<div class="fb-comments" data-width="650" data-num-posts="10" data-href="{{ site.url }}{{ site.baseurl }}{{ page.url }}"></div>
</div>
</section>

View File

@@ -16,6 +16,5 @@ sectionid: blog
</div>
<div class="fb-like" data-send="true" data-width="650" data-show-faces="false"></div>
<div class="fb-comments" data-width="650" data-num-posts="10" data-href="{{ site.url }}{{ site.baseurl }}{{ page.url }}"></div>
</div>
</section>

View File

@@ -1,6 +0,0 @@
<html>
<head>
<meta http-equiv="refresh" content="0; {{ page.destination }}">
</head>
<body></body>
</html>

View File

@@ -19,7 +19,5 @@ sectionid: tips
<a class="docs-next" href="/react/tips/{{ page.next }}">Next &rarr;</a>
{% endif %}
</div>
<div class="fb-comments" data-width="650" data-num-posts="10" data-href="{{ site.url }}{{ site.baseurl }}{{ page.url }}"></div>
</div>
</section>

View File

@@ -1,6 +1,5 @@
---
title: JSFiddle Integration
layout: post
author: Christopher Chedeau
---

View File

@@ -1,6 +1,5 @@
---
title: Why did we build React?
layout: post
author: Pete Hunt
---
@@ -75,7 +74,7 @@ some pretty cool things with it:
- We've built internal prototypes that run React apps in a web worker and use
React to drive **native iOS views** via an Objective-C bridge.
- You can run React
[on the server](http://github.com/petehunt/react-server-rendering)
[on the server](http://github.com/petehunt/react-server-rendering-example)
for SEO, performance, code sharing and overall flexibility.
- Events behave in a consistent, standards-compliant way in all browsers
(including IE8) and automatically use

View File

@@ -1,6 +1,5 @@
---
title: "Community Round-up #1"
layout: post
author: Vjeux
---

View File

@@ -1,6 +1,5 @@
---
title: "Community Round-up #2"
layout: post
author: Vjeux
---

View File

@@ -1,6 +1,5 @@
---
title: "React v0.3.3"
layout: post
author: Paul O'Shannessy
---

View File

@@ -1,6 +1,5 @@
---
title: "Community Round-up #3"
layout: post
author: Vjeux
---

View File

@@ -1,6 +1,5 @@
---
title: "New in React v0.4: Autobind by Default"
layout: post
author: Paul O'Shannessy
---

View File

@@ -1,6 +1,5 @@
---
title: "Community Round-up #4"
layout: post
author: Vjeux
---

View File

@@ -1,6 +1,5 @@
---
title: "New in React v0.4: Prop Validation and Default Values"
layout: post
author: Paul O'Shannessy
---

View File

@@ -1,6 +1,5 @@
---
title: "React v0.4.0"
layout: post
author: Paul O'Shannessy
---

View File

@@ -1,6 +1,5 @@
---
title: "Community Round-up #5"
layout: post
author: Vjeux
---

View File

@@ -1,6 +1,5 @@
---
title: "React v0.4.1"
layout: post
author: Paul O'Shannessy
---

View File

@@ -1,6 +1,5 @@
---
title: "Use React and JSX in Ruby on Rails"
layout: post
author: Paul O'Shannessy
---

View File

@@ -1,6 +1,5 @@
---
title: "Community Round-up #6"
layout: post
author: Vjeux
---
@@ -58,7 +57,7 @@ este.demos.react.todoApp = este.react.create (`/** @lends {React.ReactComponent.
[Zaim Bakar](http://zaim.github.io/) shared his boilerplate to get started with Stylus CSS processor.
> This is my boilerplate React project using Grunt as the build tool, and Stylus as my CSS preprocessor.
>
>
> - Very minimal HTML boilerplate
> - Uses Stylus, with nib included
> - Uses two build targets:

View File

@@ -1,6 +1,5 @@
---
title: "Use React and JSX in Python Applications"
layout: post
author: Kunal Mehta
---

View File

@@ -1,6 +1,5 @@
---
title: "Community Round-up #7"
layout: post
author: Vjeux
---

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