Compare commits

..

283 Commits

Author SHA1 Message Date
Jim
76c87da026 Blog post for react render and top level API
(cherry picked from commit c0f951665d)
2015-10-02 12:01:52 -07:00
Trinh Hoang Nhu
fcc51bc523 Add missing comma (,) between propTypes and render
Add missing comma (,) between `propTypes` and `render`
(cherry picked from commit 3c56146a44)
2015-10-02 12:01:28 -07:00
Yuichi Hagio
8e495cd849 Update 02-displaying-data.ja-JP.md
1. Fixed a spelling mistake to be more readable.
2. Removed the English lines that were already translated below.
(cherry picked from commit d724393f0e)
2015-10-02 12:00:38 -07:00
Paul O’Shannessy
9c89a5b73d Install babel, shrinkwrap 2015-09-25 20:29:27 -07:00
Vipul A M
2f76d0016d Cherry-pick squashed version of #4131 - switch website to use babel 2015-09-25 20:29:26 -07:00
Paul O’Shannessy
d5680caefe Merge pull request #4846 from zpao/docs-use-babel
[docs] Remove references to react-tools, JSXTransformer, replace with Babel.
(cherry picked from commit d3d2504e72)
2015-09-25 20:24:55 -07:00
Paul O’Shannessy
64ff2ea3c6 Merge pull request #4978 from zpao/tutorial-server
[docs] Make the server required for the tutorial
(cherry picked from commit 6ff4ba9512)
2015-09-25 20:22:54 -07:00
Paul O’Shannessy
4597bf074b Merge pull request #4956 from reggi/patch-1
doc: typo existant to existent
(cherry picked from commit 1ce5ba4c56)
2015-09-25 20:22:46 -07:00
Paul O’Shannessy
fe9fa883bb Merge pull request #4853 from zpao/jsfiddle-babel
[docs] Add jsfiddle integration for Babel
(cherry picked from commit 78b50485f6)
2015-09-25 20:22:38 -07:00
Paul O’Shannessy
7077c5ed96 Merge pull request #4931 from bspaulding/safe-taint-docs
Extracted "safe taint" in docs/homepage to align with best practice
(cherry picked from commit 06568114f3)
2015-09-22 11:04:48 -07:00
Paul O’Shannessy
217c54d7a7 Merge pull request #4921 from benjaffe/master
[docs] Clarify when autobinding does(n't) happens
(cherry picked from commit 56ccd82374)
2015-09-22 11:04:43 -07:00
Paul O’Shannessy
a3adc3a2d6 Merge pull request #4899 from iamchenxin/master
Update zh-CN docs.
(cherry picked from commit aac4219e80)
2015-09-22 11:04:36 -07:00
Paul O’Shannessy
6a43405632 Merge pull request #4802 from 8398a7/patch-1
Update Japanese translation to 75fafe1

(cherry picked from commit c6ecda7503)
2015-09-22 11:03:31 -07:00
Paul O’Shannessy
fd290d7c6d Merge pull request #4874 from brigand/patch-6
Clarifies "Fetching from the server"
(cherry picked from commit 609f14eed4)
2015-09-14 20:44:03 -07:00
Paul O’Shannessy
2c42c7cfa2 Merge pull request #4868 from AnSavvides/docs-readability
Make docs more consistent
(cherry picked from commit e97da42b67)
2015-09-14 19:45:46 -07:00
Paul O’Shannessy
1da84956be Merge pull request #4869 from arush/patch-1
DOCS - typo in ref callback example
(cherry picked from commit b53dfa6d27)
2015-09-14 19:45:42 -07:00
Jim
b8d2947689 Merge pull request #4855 from iamchenxin/master
Maintain why-react-zh-CN sync to the current why-react
(cherry picked from commit 2fcf54939b)
2015-09-14 19:45:38 -07:00
Paul O’Shannessy
de0f651d15 Merge pull request #4833 from youngminz/master
Update Korean translation
(cherry picked from commit ed11f83763)
2015-09-14 19:45:15 -07:00
Steven Luscher
d62018227e Community Roundup #27 – Relay Edition
(cherry picked from commit f30b0d1f1c)
2015-09-14 08:36:48 -07:00
Ben Alpert
080c48c090 Add Babel version to blog post
(cherry picked from commit 4b3b56f36a)
2015-09-10 13:29:26 -07:00
Paul O’Shannessy
5b193e03eb Merge pull request #4824 from facebook/prefill-stack-overflow-tag
Pre-fill tag when asking a Stack Overflow question
(cherry picked from commit 12b6f3d03c)
2015-09-10 10:01:09 -07:00
Paul O’Shannessy
299b2fdd5c Merge pull request #4780 from matchu/patch-1
avoid the phrase "key property"
(cherry picked from commit ea8e06283c)
2015-09-10 10:01:06 -07:00
Paul O’Shannessy
ad3a024f9b Merge pull request #4739 from henrik/patch-1
docs: "also lets pass" -> "also lets you pass"
(cherry picked from commit dc23faf64d)
2015-09-10 10:00:57 -07:00
Paul O’Shannessy
80dd480a47 Merge pull request #4724 from AnSavvides/test-util-readability
Make definitions more readable & optional params more obvious
(cherry picked from commit 77703dbb80)
2015-09-10 10:00:52 -07:00
Ben Alpert
dcfbf801e4 Merge pull request #4703 from spicyj/rarr
Clarify use of arrow functions
(cherry picked from commit d4f38933f2)
2015-09-10 10:00:46 -07:00
Ben Alpert
32663aabc6 0.14 RC blog post
(cherry picked from commit 5bf56134be)
2015-09-10 09:51:13 -07:00
Ben Alpert
ad8e207c32 New devtools blog post
(cherry picked from commit f5bd8fc0ad)
2015-09-02 15:16:12 -07:00
Edvin Erikson
7f1c1022b5 Updated event pooling note in docs
(cherry picked from commit 6793a7197e)
2015-08-31 11:28:33 -07:00
Edvin Erikson
e5a89f5865 Added documentation about pooled events
(cherry picked from commit 1e3c3e1b6b)
2015-08-31 11:28:33 -07:00
Paul O’Shannessy
4fda63c77b Merge pull request #4684 from lyip1992/patch-3
Update 10.1-animation.md
(cherry picked from commit 27e5a563db)
2015-08-25 09:56:13 -07:00
Paul O’Shannessy
1ba4023de0 Merge pull request #4686 from lyip1992/patch-5
Update 06-transferring-props.md
(cherry picked from commit d5e5261e38)
2015-08-25 09:56:13 -07:00
Paul O’Shannessy
f4dfb0a184 Merge pull request #4687 from lyip1992/patch-6
Update 04-multiple-components.md
(cherry picked from commit 7dbcff2df4)
2015-08-25 09:56:13 -07:00
Paul O’Shannessy
dc8c5b1ecf Merge pull request #4688 from lyip1992/patch-7
Update 02.3-jsx-gotchas.md
(cherry picked from commit cca1065183)
2015-08-25 09:56:12 -07:00
Paul O’Shannessy
7263473999 Merge pull request #4685 from lyip1992/patch-4
Update 08.1-more-about-refs.md
(cherry picked from commit adfbc64d4b)
2015-08-25 09:56:12 -07:00
Paul O’Shannessy
bcbad461d1 Merge pull request #4678 from ning-github/patch-1
Remove redundancy regarding 'latest React news'
(cherry picked from commit 6508b1ad27)
2015-08-25 09:56:12 -07:00
Jim
b01f1c920c Merge pull request #4679 from ning-github/patch-2
Fix typo
(cherry picked from commit b36ee449cb)
2015-08-25 09:56:12 -07:00
Ben Alpert
c20b8fec2f Fix formatting in test utils docs
(cherry picked from commit 66881ae083)
2015-08-25 09:48:07 -07:00
Ben Alpert
356b8f3559 Capitalize Babel
(cherry picked from commit 61962c1751)
2015-08-20 13:34:23 -07:00
Kyle Kelley
7d914eab27 Update tooling docs to suggest babel
`react-tools` is deprecated, `babel` is our future

* https://facebook.github.io/react/blog/2015/06/12/deprecating-jstransform-and-react-tools.html
* https://babeljs.io/docs/usage/jsx/

(cherry picked from commit 009902bcd0)
2015-08-20 13:16:32 -07:00
Ben Alpert
9cd6048720 Spruce up refs docs
Fixes #4651.

(cherry picked from commit 1db20999f0)
2015-08-19 16:35:58 -07:00
Tyler Brock
3154f055cf Clarify invocation order of componentDidMount
OP is delivering on promise made here: https://discuss.reactjs.org/t/how-do-you-invoke-the-render-callback-in-jsx/1744
(cherry picked from commit 1e10bb5923)
2015-08-19 16:35:57 -07:00
Levi Buzolic
b793785882 Update Advanced Performance code examples so they would output values
Noticed the code examples in *Advanced Performance* wouldn't be rendering the example props, this could lead to some minor confusion for new users.
(cherry picked from commit 009f766d6e)
2015-08-19 16:35:57 -07:00
Mikolaj Dadela
cfa922a3d7 Updated the Performance tools doc page.
Now it’s possible to read the page from top to the bottom without
asking oneself “Ok, but how do I get these measurements?”

(cherry picked from commit 75fafe1c0b)
2015-08-19 16:35:57 -07:00
Kohei TAKATA
a4e0bf2fc7 Translate ref-01-top-level-api.md to Japanese
(cherry picked from commit ae38ea9275)
2015-08-19 16:35:57 -07:00
MIKAMI Yoshiyuki
7a623e21fd Fix Markdown conversion with marked
(cherry picked from commit 47ce8ecacb)
2015-08-19 16:35:57 -07:00
Kohei TAKATA
6d8930650c Translate 01-introduction.md to Japanese
(cherry picked from commit edca54fb93)
2015-08-19 16:35:57 -07:00
li.li
0093870008 update component api docs
(cherry picked from commit f027ca8ca0)
2015-08-19 16:35:57 -07:00
Domenico Matteo
fd2e0bae59 improve ReactTestUtils.Simulate documentation
(cherry picked from commit 97e219e785)
2015-08-19 16:35:57 -07:00
Matthew Johnston
5ef792995f ReactEurope roundup blog post
(cherry picked from commit 0b07fed32c)
2015-08-13 17:16:28 -07:00
Paul O’Shannessy
841ba07f24 Fix grammar in Relay blog post
Brings in #4617 properly

(cherry picked from commit 530a30c1d5)
2015-08-12 12:10:31 -07:00
Paul O’Shannessy
0ec71215de Merge pull request #4619 from jaredly/beta-2
update devtools post to note beta 2
(cherry picked from commit 1b7d6c381f)
2015-08-12 12:08:33 -07:00
Jim
e719951cdd Merge pull request #4613 from tako-black/translate_advanced-performance_to_japanese
Translate 11-advanced-performance.md to Japanese
(cherry picked from commit d7b59de1c3)
2015-08-12 12:04:59 -07:00
Jim
95463d395d Merge pull request #4602 from tako-black/update_tutorial_ja-JP
Change tutorial.ja-JP.md to use marked
(cherry picked from commit bcd32768e6)
2015-08-12 12:04:59 -07:00
Sebastian Markbåge
2dc652a900 Merge pull request #4554 from chernysh/chernysh-added-docs-img-events
Added documentation for <img> events
(cherry picked from commit 7f119d41c7)
2015-08-12 12:04:24 -07:00
Jim
62487d9233 Merge pull request #4552 from psibi/patch-1
Include Haskell language
(cherry picked from commit c97ed7b804)
2015-08-12 12:01:52 -07:00
Jim
abf95dcbd2 Merge pull request #4381 from mikrofusion/clarify-main-ideas
clarify the two main ideas behind react.
(cherry picked from commit ff7996b58a)
2015-08-12 12:01:51 -07:00
Jim
d2544377e3 Merge pull request #4541 from marocchino/update-korean
Update Korean translation to e88c7bf
(cherry picked from commit 134e0700cd)
2015-08-12 12:01:29 -07:00
Jim
0ef62a8ea1 Merge pull request #4537 from afhole/patch-1
Update 02.1-jsx-in-depth.md
(cherry picked from commit 50d73f9a13)
2015-08-12 11:58:32 -07:00
Paul O’Shannessy
58bc35de1c Merge pull request #2664 from jasonwebster/patch-1
Add additional supported methods to event documentation
(cherry picked from commit b766c62bb9)
2015-08-12 11:58:32 -07:00
Jim
223fc26ee7 Merge pull request #4506 from tako-black/translate_perf_to_japanese
Translate 10.9-perf.md to Japanese
(cherry picked from commit 98d4fde55c)
2015-08-12 11:58:31 -07:00
Jim
f0abb45dce Merge pull request #4469 from KevinTCoughlin/kevintcoughlin/#4265
Fixes #4265 - Clarify React.render note in documentation
(cherry picked from commit fab001aa80)
2015-08-12 11:58:31 -07:00
Jim
22eb779351 Merge pull request #4495 from tako-black/translate_pure-render-mixin_to_japanese
Translate 10.8-pure-render-mixin.md to Japanese
(cherry picked from commit be39979460)
2015-08-12 11:58:31 -07:00
Paul O’Shannessy
158d1c7755 Merge pull request #4486 from yangmillstheory/docfix
Fix grammar
(cherry picked from commit 3056066ede)
2015-08-12 11:58:31 -07:00
Jim
041248881b Merge pull request #4483 from marocchino/update-korean
Update Korean translation to 991c437
(cherry picked from commit 44997df9eb)
2015-08-12 11:58:30 -07:00
Joseph Savona
cac6bc870d Relay Technical Preview - blog post 2015-08-11 12:09:17 -07:00
youmoo
35225abeba Update 2015-05-01-graphql-introduction.md
Or the alternative:

`REST is an acronym for Representational State Transfer, which is an architectural style rather than a formal protocol`.

Sorry , I'am not a native speaker:)
(cherry picked from commit 0a19e0c0e5)
2015-08-07 19:32:32 -07:00
Jared Forsyth
f92f1e7f33 Add blog post about the new devtools beta
(cherry picked from commit 1343cc0c9b)
2015-08-03 15:15:29 -07:00
Jim
6e4865946b Merge pull request #4478 from tako-black/translate_update_to_japanese
Translate 10.7-update.md to Japanese
(cherry picked from commit f23fe004bb)
2015-07-24 17:41:25 -07:00
Paul O’Shannessy
252f3571e5 Merge pull request #4386 from AnSavvides/4369-walkthrough-clarification
[#4369] Make getting started a little less confusing
(cherry picked from commit bcfba9178f)
2015-07-24 17:41:25 -07:00
Jim
55fe64dd94 Merge pull request #4472 from tako-black/translate_create-fragment_to_japanese
Translate 10.6-create-fragment.md to Japanese
(cherry picked from commit 318c288bd3)
2015-07-24 17:41:25 -07:00
Jim
fa05a157e4 Merge pull request #4459 from tako-black/translate_clone-with-props_to_japanese
Translate 10.5-clone-with-props.md to Japanese
(cherry picked from commit 3dcc4b8b90)
2015-07-24 17:41:24 -07:00
Jim
ae5224a05f Merge pull request #4471 from Yeti-or/yeti-or.fix-docs
Docs: Fix jsx iife example
(cherry picked from commit 42caf036e2)
2015-07-24 17:41:24 -07:00
Jim
9aa45c7517 Merge pull request #4460 from tako-black/enclose_variables_in_back_quote
Enclose variables in back quote
(cherry picked from commit b71ad1f600)
2015-07-24 17:41:24 -07:00
Jim
95f77e6c0a Merge pull request #4455 from marocchino/update-korean
Update Korean translation to e928c65
(cherry picked from commit e10c873d09)
2015-07-24 17:41:24 -07:00
Paul O’Shannessy
a8c729ee7b Merge pull request #4404 from jbonta/component_api_docs
Make component api docs clearer
(cherry picked from commit 82a9a5595e)
2015-07-24 17:41:24 -07:00
Jim
503b3cfe0a Merge pull request #4443 from tako-black/translate_test-utils_to_japanese
Translate 10.4test-utils.md to Japanese
(cherry picked from commit f000fa564e)
2015-07-24 17:41:23 -07:00
Jim
0229aea457 Merge pull request #4444 from tako-black/Add_period
Add period
(cherry picked from commit dc0d4bae7b)
2015-07-24 17:41:23 -07:00
Ben Alpert
b7f9cd4f25 counterexample -> antipattern
(cherry picked from commit d13fafa5dd)
2015-07-20 08:29:11 -07:00
Paul O’Shannessy
f8477dcf58 Merge pull request #4413 from zpao/more-default-value-docs-chagnes
Tweaks to new content in forms documentation
(cherry picked from commit c72f2e455a)
2015-07-17 14:24:29 -07:00
Jim
ff19f79a33 Merge pull request #4379 from eriklharper/patch-1
Add more information about defaultValue
(cherry picked from commit 976b51adf8)
2015-07-17 14:24:28 -07:00
Jim
c4d8d1503d Merge pull request #4407 from Simek/patch-4
split code block for readability
(cherry picked from commit aa5f503595)
2015-07-17 14:24:28 -07:00
Jim
ab9f340857 Merge pull request #4409 from tako-black/translate_class-name-manipulation_to_japanese
Translate 10.3-class-name-manipulation.md to Japanese
(cherry picked from commit b66fa7eb05)
2015-07-17 14:24:28 -07:00
Paul O’Shannessy
ef7ff3ba88 Merge pull request #3186 from benekastah/patch-1
Modify sample CSS so that it works in Safari
(cherry picked from commit ddb84f44a8)
2015-07-17 14:24:28 -07:00
Jim
6297aa4118 Merge pull request #4382 from tako-black/enclose_a_name_of_library_in_back_quote
Enclose a name of library in back quote
(cherry picked from commit d6c062b213)
2015-07-17 14:24:27 -07:00
Jim
26fa6256e5 Merge pull request #4383 from tako-black/translate_form-input-binding-sugar_to_japanese
Translate 10.2-form-input-binding-sugar.md to Japanese
(cherry picked from commit d76a686c7f)
2015-07-17 14:24:27 -07:00
Jim
04539d9e17 Merge pull request #4377 from sugarshin/typo_docs
Delete unnecessary control code.
(cherry picked from commit 432d887f4a)
2015-07-17 14:24:27 -07:00
Jim
329efd4d70 Merge pull request #4371 from tako-black/translate_animation_to_japanese
Translate 10.1-animation.md to Japanese
(cherry picked from commit 704ea0bb83)
2015-07-17 14:24:27 -07:00
Paul O’Shannessy
1d9ee9dcdb Merge pull request #4144 from lukehorvat/docs/iife-jsx
Add IIFE example to JSX documentation
(cherry picked from commit 4d178415e8)
2015-07-17 14:24:27 -07:00
Paul O’Shannessy
b84f325a20 Merge pull request #4291 from rwoodnz/patch-2
indicate file name requried for static file
(cherry picked from commit e9b3974d7c)
2015-07-17 14:24:26 -07:00
Paul O’Shannessy
f676fa41ef Merge pull request #4357 from yangmillstheory/docfix
Warn against JSX transform failure for non-HTTP-served JSX
(cherry picked from commit e9915f0735)
2015-07-17 14:24:26 -07:00
Paul O’Shannessy
dd570dcb5c Merge pull request #4363 from tako-black/change_css_to_uppercase
Change `css` to uppercase
(cherry picked from commit fa7aeb65ac)
2015-07-17 14:24:26 -07:00
Jim
5396d5180d Merge pull request #4362 from makky3939/translate_04_self_closing_tag
Translate 4-self-closing-tag.md to Japanese
(cherry picked from commit bd390afc22)
2015-07-17 14:24:26 -07:00
Jim
73fce2dd31 Merge pull request #4356 from makky3939/fix_03-interactivity-and-dynamic-uis_ja-JP_md
Update 03-interactivity-and-dynamic-uis.ja-JP.md
(cherry picked from commit ea964e760c)
2015-07-17 14:24:26 -07:00
Jim
34d9e8482e Merge pull request #4358 from makky3939/remove_controll_character_from_jp_docs
Remove controll character from jp.md
(cherry picked from commit 0572747d74)
2015-07-17 14:24:26 -07:00
Jim
649804e4d4 Merge pull request #4351 from tako-black/translate_addons_to_japanese
Translate 10-addons.md to Japanese
(cherry picked from commit 2b3d83fe34)
2015-07-17 14:24:25 -07:00
Jim
86682159d1 Merge pull request #4348 from himkt/master
remove controll character from 02-displaying-data.ja-JP.md
(cherry picked from commit 13c9bb4845)
2015-07-17 14:24:25 -07:00
Jim
257c4288d9 Merge pull request #4346 from makky3939/fix_typo_09-tooling-integration_ja-JP_md
fix typo 09-tooling-integration.ja-JP.md
(cherry picked from commit 7661d6c7da)
2015-07-17 14:24:25 -07:00
Paul O’Shannessy
177df50d7f Merge pull request #4337 from tako-black/translate_tooling-integration_to_japanese
Translate 09.tooling-integration.md to Japanese
(cherry picked from commit 4ec2575cd8)
2015-07-17 14:24:25 -07:00
Jim
cdb2988155 Merge pull request #4334 from tako-black/add_meta_tag_in_the_header_of_html
Add meta tag in the header of HTML in translated documentation.
(cherry picked from commit 6c0ab0b60e)
2015-07-17 14:24:25 -07:00
Jim
017d377c26 Merge pull request #4320 from tako-black/translate_more-about-refs_to_japanese
Translate 08.1-more-about-refs.md to Japanese
(cherry picked from commit a9e2111b34)
2015-07-17 14:24:24 -07:00
Paul O’Shannessy
71a6e5da7a Merge pull request #4319 from tako-black/enclose_a_name_of_function_in_back_quote
Enclose a name of function in back quote
(cherry picked from commit 59eddf8943)
2015-07-17 14:24:24 -07:00
Frankie Bagnardi
c0f32a9078 Blog: move "refs to custom components..." fixes #4305
Just to prevent the TL;DR confusion. Separate paragraph and moved up above the code block. `s/References/Refs` for consistency.

(cherry picked from commit 335f7d5e57)
2015-07-15 16:36:47 +02:00
Paul O’Shannessy
e3e209d8e1 Merge pull request #4314 from devonharvey/patch-1
Fix typo on line 91 of tutorial.md
(cherry picked from commit 6eaf03df1a)
2015-07-08 10:26:14 -07:00
Jim
a76d3f22c2 Merge pull request #4312 from tako-black/translate_working-with-the-browser_to_japanese
Translate 08-working-with-the-browser.md to Japanese
(cherry picked from commit c3f0d7c6bd)
2015-07-08 10:26:14 -07:00
Jim
322fd3b56a Merge pull request #4310 from tako-black/enclose_a_value_of_variable_in_back_quote
Enclose a value of variable in back quote
(cherry picked from commit ed0d41bb88)
2015-07-08 10:26:14 -07:00
Jim
80225fb613 Merge pull request #4300 from tako-black/translate_forms_to_japanese
Translate 07-forms.md to Japanese
(cherry picked from commit 25be80c959)
2015-07-08 10:26:14 -07:00
Jim
c9119c1135 Merge pull request #4299 from tako-black/enclose_a_value_in_back_quote
Enclose a value of variable in back quote
(cherry picked from commit 2284c0f449)
2015-07-08 10:26:14 -07:00
Jim
ce0ff2a975 Merge pull request #4292 from dariocravero/patch-1
Update 2015-07-03-react-v0.14-beta-1.md
(cherry picked from commit a8955e7c3e)
2015-07-08 10:26:13 -07:00
Jim
085f5319e9 Merge pull request #4290 from rwoodnz/patch-1
Suggest open index.html in browser regularly.
(cherry picked from commit abf965c3c5)
2015-07-08 10:26:13 -07:00
Paul O’Shannessy
30a44efd43 Merge pull request #4289 from joshuago/patch-1
Fix typos
(cherry picked from commit 5370987cc0)
2015-07-08 10:26:13 -07:00
Jim
2fde241c5e Merge pull request #4276 from tako-black/translate_transferring-props_to_japanese
Translate 06-transferring-props.md to Japanese
(cherry picked from commit 2d86486fd1)
2015-07-08 10:26:13 -07:00
Jim
7f23486f7e Merge pull request #4266 from tako-black/translate_reusable-components_to_japanese
Translate 05-reusable-components.md to Japanese
(cherry picked from commit c3e411a0dc)
2015-07-08 10:26:13 -07:00
Jim
f995ca79d1 Merge pull request #4262 from coryhouse/patch-1
Removed redundant word
(cherry picked from commit bde585f4e0)
2015-07-08 10:26:12 -07:00
Jim
ea4f405840 Merge pull request #4252 from bhamodi/patch-2
Update url to save a redirect
(cherry picked from commit ae9b2c0649)
2015-07-08 10:26:10 -07:00
Jim
8972a956bd Merge pull request #4249 from tako-black/translate_multiple-components_to_japanese
Translate 04-multiple-components.md to Japanese
(cherry picked from commit d9d442808a)
2015-07-08 10:13:02 -07:00
Paul O’Shannessy
b8b8477265 Merge pull request #4242 from tako-black/translate_interactivity-and-dynamic-uis_to_japanese
Translate 03-interactivity-and-dynamic-uis.md to Japanese
(cherry picked from commit dd3244c4f2)
2015-07-08 10:13:02 -07:00
Jim
1fab5ae1a6 Merge pull request #4240 from tako-black/translate_jsx-gotchas_to_japanese
Translate 02.3-jsx-gotchas.md to Japanese
(cherry picked from commit e695ebb5c6)
2015-07-08 10:13:01 -07:00
Jim
8a3c65851e Merge pull request #4232 from marocchino/update-docs
Update translated docs
(cherry picked from commit 5fb8cbc6ca)
2015-07-08 10:13:01 -07:00
Paul O’Shannessy
f92d447ab8 Merge pull request #4229 from tako-black/translate_jsx-spread_to_japanese
Translate 02.2-jsx-spread.md to Japanese
(cherry picked from commit 859a5d5c3c)
2015-07-08 10:13:01 -07:00
Jim
ba9cbe2567 Merge pull request #4222 from tako-black/translate_jsx-in-depth_to_japanese
Translate 02.1-jsx-in-depth.ja-JP.md to Japanese
(cherry picked from commit 9bcc8dab93)
2015-07-08 10:13:01 -07:00
Ben Alpert
418bc097d5 Merge pull request #4204 from dpercy/patch-1
Fix docs typo: "overridden" -> "overwritten"
(cherry picked from commit ef00e856aa)
2015-07-08 10:13:01 -07:00
Ben Alpert
4e1918d4ea Fix react-addons-update package name
(cherry picked from commit cb5913a842)
2015-07-04 17:26:57 +02:00
Ben Alpert
52c9efedb3 beta1 blog post
Closes #4275.

(cherry picked from commit b2db10f43e)
2015-07-03 10:50:24 +02:00
Andres Kalle
8a83957e8c Typo fix
(cherry picked from commit af2071af63)
2015-06-30 15:58:07 +02:00
Kohei TAKATA
c3aee0aecc Change 'Javascript' to 'JavaScript'
(cherry picked from commit aefb608fd6)
2015-06-27 03:02:10 -07:00
Kohei TAKATA
bef8b1af6c Translate 02-displaying-data.md to Japanese
(cherry picked from commit af34ca7b41)
2015-06-24 20:20:00 -07:00
Tay Yang Shun
4d3aaa75ae Add site title to first code snippet of getting started
(cherry picked from commit bd9d4b2499)
2015-06-24 20:19:33 -07:00
Kohei TAKATA
2ce18630c1 Fix link of getting-started.ja-JP.md
(cherry picked from commit 3c53d25587)
2015-06-22 22:41:49 -07:00
Kohei TAKATA
0f938506e3 Translate 01-why-react.md to Japanese
(cherry picked from commit 1d3906f91d)
2015-06-22 22:41:45 -07:00
Cristovao Verstraeten
fcb0d942b1 update script sources to be even with the example file in reactjs/react-tutorial repo ... apply to japanese and korean translation (+2 squashed commit)
Squashed commit:

[4564e55] Ensures we don't need to update this page for every release.

[b0d60f9] update script sources to be even with the example file in reactjs/react-tutorial repo

(cherry picked from commit c227a398ba)
2015-06-22 22:41:38 -07:00
Shim Won
41821af38d Update Korean transltaion to 4c778e2
(cherry picked from commit e67c0943b8)
2015-06-22 22:41:32 -07:00
Ben Alpert
3cf37af574 Fix typo in blog post
(#4183)

(cherry picked from commit df05c6efb8)
2015-06-20 16:49:52 -07:00
Ingvar Stepanyan
d48ce78261 Update 2015-06-12-deprecating-jstransform-and-react-tools.md
Add paragraph about parsing JSX after deprecation of esprima-fb.
(cherry picked from commit cab21c7783)
2015-06-16 10:58:03 -07:00
Dustan Kasten
eff75729f2 s/parse/parser in jstransform deprecation blog post
(cherry picked from commit 54e77a251c)
2015-06-12 21:52:31 -07:00
Paul O’Shannessy
4c50ced1a8 [blog] Deprecate JSTransform & react-tools 2015-06-12 16:48:16 -07:00
Jim
7cf376483f Merge pull request #4074 from jimfb/docs-context-parameter-confusing
Fixed confusing use of the word/name `context` in documentation
2015-06-10 15:59:26 -07:00
Ben Alpert
b2fb150972 Merge pull request #4070 from tako-black/fix_md_file
Fix code of getting-started-ja-JP
2015-06-10 15:59:22 -07:00
Paul O’Shannessy
f6d9da57c6 Merge pull request #4046 from basarat/patch-2
📝 document changes for classes
2015-06-10 15:59:18 -07:00
Scott Feeney
0620cec299 Merge pull request #4003 from AnSavvides/on-change-vs-on-input
[#3964] Add note about React's onChange vs. DOM's oninput
2015-06-10 15:59:13 -07:00
Ben Alpert
2b60d3c31f Merge pull request #3884 from glenjamin/patch-3
Document boolean attributes in JSX
2015-06-10 15:59:08 -07:00
Paul O’Shannessy
a590c90fb0 Merge pull request #4063 from zpao/fix-ja-docs
fix japanese docs permalinks
2015-06-08 20:17:27 -07:00
Ben Alpert
7bee7eff7e Merge pull request #3993 from arianf/doctype
added missing DOCTYPE
2015-06-01 14:32:23 -07:00
Paul O’Shannessy
cc0c897a79 Merge pull request #3980 from cody/http
Revert links to non-https fiddles back to http in old blog posts
2015-06-01 14:32:18 -07:00
Paul O’Shannessy
d34b93cdb9 Merge pull request #3935 from julen/docs/transition-group
Docs: value for `transitionAppear` must be boolean
2015-06-01 14:32:09 -07:00
Ben Alpert
616454f95f Merge pull request #3931 from marocchino/update-korean
Update Korean transltaion to 5bee4a5
2015-06-01 14:32:04 -07:00
Ben Alpert
dc482ec339 Merge pull request #3909 from spicyj/tir-redirect
Redirect Thinking in React blog post to docs
2015-06-01 14:32:00 -07:00
Christopher Chedeau
ad2e54a25c [Blog post] React Native Release Process 2015-05-22 13:19:22 -07:00
Paul O’Shannessy
af44a476d0 Merge pull request #3803 from zpao/docs-fancy-authors
[docs] Give authors links.
2015-05-21 11:45:03 -07:00
Paul O’Shannessy
246cd6e7ac Merge pull request #3888 from marocchino/korean-update
Update Korean Translation to 5275244
2015-05-21 11:44:56 -07:00
Paul O’Shannessy
20b41da601 Merge pull request #3892 from spicyj/docs-wwb
[docs] Clarify wording in Working with the Browser
2015-05-21 11:44:49 -07:00
Paul O’Shannessy
9c0f0f58ca Merge pull request #3889 from garethnic/WorkBrowser
change wording in 'Working with the Browser'
2015-05-21 11:44:42 -07:00
Paul O’Shannessy
78b97cb5b2 Merge pull request #3905 from troeggla/replace-getdomnode
Replaced call to deprected .getDOMNode() with React.findDOMNode().
2015-05-21 11:44:37 -07:00
Ben Alpert
daee5502cf Merge pull request #3910 from spicyj/gh-3904
Clarify tutorial instructions
2015-05-21 11:44:32 -07:00
Jim
c72390a94c Merge pull request #3856 from chaseadamsio/chaseadamsio-patch-1
Change object typo to objects
2015-05-21 11:43:45 -07:00
Paul O’Shannessy
b8e11d04db Merge pull request #3881 from ef718/docs-grammar
Fix punctuation and grammar
2015-05-21 11:43:39 -07:00
Paul O’Shannessy
36a058b7a0 Merge pull request #3837 from davidneat/transition-group-appear-high-level-docs
Added transitionAppear docs
2015-05-21 11:42:35 -07:00
Paul O’Shannessy
d3d819fff5 [docs] Fix 404 due to relative url
Closes #3914

(cherry picked from commit 021574e07d)
2015-05-21 11:40:24 -07:00
Paul O’Shannessy
be7fe9cb40 Followup to #3852, use https
(cherry picked from commit cfa354415b)
2015-05-21 11:40:09 -07:00
Ben Alpert
dc47b92da8 Deprecate reactjs Google Group
(cherry picked from commit ffabf4b5ff)
2015-05-13 15:17:00 -07:00
Ben Alpert
9947e4ee9b Merge pull request #3852 from thewarpaint/patch-1
Add Wikipedia link to Cross-site scripting article on "XSS attack" string
2015-05-10 22:16:08 -07:00
Ben Alpert
17e04d5034 Merge pull request #3805 from hejld/master
Removed redundant grave accent character from Component API docs
2015-05-10 22:16:03 -07:00
Ben Alpert
118845f53a Merge pull request #3797 from marocchino/update-korean
Update Korean Translation to 9484d0f
2015-05-10 22:15:57 -07:00
Paul O’Shannessy
2b372f188a Merge pull request #3778 from masterfung/docs-update
updated some typos, grammers, and made sentences sound better
2015-05-10 22:15:51 -07:00
Paul O’Shannessy
107ce2b80d Update website with 0.13.3 builds 2015-05-08 16:32:30 -07:00
Paul O’Shannessy
2668de126c Fix docs for #3690 2015-05-08 13:53:50 -07:00
Paul O’Shannessy
179b6380cf v0.13.3 blog post 2015-05-08 13:53:49 -07:00
Paul O’Shannessy
668d6a3fed v0.13.3 2015-05-08 13:53:49 -07:00
Paul O’Shannessy
1d950ddbd4 Readme for 0.13.3 2015-05-08 13:53:49 -07:00
Paul O’Shannessy
95e864fd07 Changelog for 0.13.3 2015-05-08 13:53:49 -07:00
Ben Alpert
13e67bed24 Merge pull request #3841 from spicyj/yolo
Preserve prototype with replaceState
2015-05-08 13:53:49 -07:00
Paul O’Shannessy
b8ae729d3f Revert "Reset changes to code made in #3693"
This reverts commit 405346545f.
2015-05-08 13:53:48 -07:00
Ben Alpert
e9126cf90b Add forgotten clipPath wrapper in getMarkupWrap
(cherry picked from commit 3b10a7b038)
2015-05-08 13:53:48 -07:00
Ben Alpert
80ea01d364 Fix context warning with non-pure getChildContext
Fixes #3709.
2015-05-08 11:36:29 -07:00
Ben Alpert
92a7e5f41c Merge pull request #3802 from spicyj/cleaner-depr
Better warning messages for deprecated methods
2015-05-08 11:20:37 -07:00
Ben Alpert
56b0a496f4 Merge pull request #3727 from spicyj/dsih
Relax dangerouslySetInnerHTML validation
2015-05-08 10:49:56 -07:00
Scott Feeney
135499782e Merge pull request #3716 from graue/optional-shallow-render-context
Shallow render components that define contextTypes
2015-05-08 10:49:36 -07:00
codesuki
bd6e42fab4 Added support for SVG clipPath element and clip-path attribute 2015-05-08 10:46:25 -07:00
Paul O’Shannessy
e64c0a50f9 Bump version for dev 2015-05-08 10:40:07 -07:00
Paul O’Shannessy
b7ea06614d Update 2015-05-01-graphql-introduction.md
typo fix
2015-05-01 17:01:59 -07:00
Paul O’Shannessy
a72828817b Fix a couple grammar issues in GraphQL blog post 2015-05-01 12:35:50 -07:00
Paul O’Shannessy
49cbc88cd2 GraphQL Introduction Blog Post
(cherry picked from commit 693da719a3)
2015-05-01 11:20:03 -07:00
Jim
fd36708b1d Merge pull request #3794 from jsfb/fix-thinking-in-react-blog-post
Fixed jsfiddles broken on https.  Fixes 3735.
2015-05-01 11:09:28 -07:00
Paul O’Shannessy
9643243116 Merge pull request #3784 from ef718/docs-punctuation
Add punctuation
2015-05-01 11:09:22 -07:00
Jim
a12ef37050 Merge pull request #3767 from kubosho/patch-1
Use jQuery 2.1.3 (latest) to be up-to-date and consistent with other docs)
2015-05-01 11:09:17 -07:00
Paul O’Shannessy
7a967b680b Merge pull request #3734 from marocchino/update-korean
Update Translation to 0183f70
2015-05-01 11:09:12 -07:00
Jim
4c7479a2a0 Merge pull request #3723 from jsfb/fix-bad-homepage-link
Fix bad links in docs.  Fixes #3654.
2015-05-01 11:09:07 -07:00
Paul O’Shannessy
9611a4b105 Merge pull request #3691 from jonscottclark/patch-1
Add 'cache: false' to $.ajax when fetching comments (docs/tutorial)
2015-05-01 11:09:02 -07:00
Ben Alpert
0493fa21f7 Merge pull request #3429 from AoDev/patch-1
Add a note about react classe name convention
2015-05-01 11:08:58 -07:00
mheiber
f05bfaea33 Update cloneWithProps documentation
Updated documentation to reflect that using React.cloneElement is the new way to copy an element and preserve `key` and `ref`.

Fixes #3432, closes #3447.

(cherry picked from commit 39442aaa84)
2015-04-22 17:06:12 -07:00
Paul O’Shannessy
405346545f Reset changes to code made in #3693
Reverting this bit in the stable branch so builds aren't changed. We can pick
this up again if we do a 0.13.3.
2015-04-20 22:17:59 -07:00
Paul O’Shannessy
5ef593e4a0 Merge pull request #3693 from reedloden/swap-http-to-https
SSL/TLSize all the things! (convert http:// to https:// where appropriate)
2015-04-20 11:08:54 -07:00
Paul O’Shannessy
92252f5781 Merge pull request #3694 from adamzap/fix-tutorial-line-highlighting
Fix missing line highlight in tutorial
2015-04-20 11:05:02 -07:00
Paul O’Shannessy
b14a7be10d Merge pull request #3703 from JimBobSquarePants/patch-1
Example is JSX not JS.
2015-04-20 11:04:56 -07:00
Paul O’Shannessy
3ff97a9277 Merge pull request #3705 from zpao/doc/update-supported-attrs
[docs] Update supported HTML attributes
2015-04-20 11:04:51 -07:00
Paul O’Shannessy
7a2c84d81a Tweak wording in 0.13.2 blog post
(cherry picked from commit feef6e885b)
2015-04-18 16:08:25 -07:00
Paul O’Shannessy
6ed202288b v0.13.2 blog post 2015-04-18 15:33:58 -07:00
Paul O’Shannessy
179f904525 Update website with 0.13.2 builds 2015-04-18 15:33:58 -07:00
Paul O’Shannessy
c98c7ccd28 v0.13.2 2015-04-18 15:28:48 -07:00
Paul O’Shannessy
78cca021f3 Update Patent Grant
https://code.facebook.com/posts/1639473982937255/updating-our-open-source-patent-grant/
2015-04-18 15:28:48 -07:00
Paul O’Shannessy
e1437078fc Readme for 0.13.2 2015-04-18 15:28:48 -07:00
Paul O’Shannessy
4f1c61f915 Changelog for 0.13.2 2015-04-18 15:28:48 -07:00
Ben Alpert
4cecb72965 Merge pull request #3675 from spicyj/gh-3655
Add warning for getDefaultProps on ES6 classes
2015-04-17 18:35:19 -07:00
Paul O’Shannessy
db6dcd695f Merge pull request #3485 from jnu/ie10-flex-unitless
Treat flexPositive, flexNegative as unitless styles
2015-04-17 18:35:19 -07:00
Paul O’Shannessy
16cb748161 Update test for backporting #3507 2015-04-17 18:35:19 -07:00
Jim
2e3ac9b683 Merge pull request #3638 from devicehubnet/master
check if type.prototype is object in instantiateReactComponent
2015-04-17 18:35:19 -07:00
Paul O’Shannessy
3509628c22 re-shrinkwrap 2015-04-17 18:35:18 -07:00
Paul O’Shannessy
742d8567e8 Merge pull request #3662 from zpao/update-uglify
Update uglify dependency
2015-04-17 18:35:18 -07:00
Paul O’Shannessy
1c03cd6fd9 Merge pull request #3636 from cody/jsx-target
Add target option to npm readme
2015-04-17 18:35:18 -07:00
Ben Alpert
8b4377ed68 Merge pull request #3627 from spicyj/mut-warn-clone
Refer to cloneElement in mutation warning
2015-04-17 18:35:18 -07:00
Paul O’Shannessy
2c7e818c7c Merge pull request #3618 from TimeBomb/master
Document new es6module flag in react-tools README
2015-04-17 18:35:18 -07:00
Paul O’Shannessy
717ad76529 Merge pull request #3614 from kassens/set_style_null
Fix for style not always reset when set to null
2015-04-17 18:35:18 -07:00
Paul O’Shannessy
9b2176fc23 Merge pull request #3563 from quizlet/fix-addons-hasownproperty
Fix immutability helper to check hasOwnProperty safely
2015-04-17 18:35:18 -07:00
Paul O’Shannessy
7b07d85398 Merge pull request #3519 from jonchester/patch-1
Add IE-specific 'unselectable' attribute
2015-04-17 18:35:18 -07:00
Paul O’Shannessy
6d021d31ef Merge pull request #3513 from agelter/master
Added support for the 'low', 'high', and 'optimum' attributes that are missing from the <meter> tag.
2015-04-17 18:35:18 -07:00
Paul O’Shannessy
ed8b4d6533 Merge pull request #3507 from dpellier/master
Add scoped property to the list of DOM standard properties
2015-04-17 18:35:18 -07:00
Paul O’Shannessy
440d7b9fd0 Merge pull request #3499 from sverrejoh/patch-1
Don't add 'px' to strokeDashoffset CSS Properties
2015-04-17 18:35:17 -07:00
Jim
28483ea245 Merge pull request #3494 from letiemble/B_Context_Rerender
Fix the context handling when updating a rendered component.
2015-04-17 18:35:17 -07:00
Paul O’Shannessy
4d142ad5f1 Version bump for dev 2015-04-17 18:35:17 -07:00
Paul O’Shannessy
4a700aedf8 Merge pull request #3678 from marocchino/update-korean
Update Translation to 6a7a4fd
2015-04-17 18:13:28 -07:00
Paul O’Shannessy
4423200007 Merge pull request #3673 from ultrafez/patch-1
"Advanced performance" typo fix
2015-04-17 18:13:16 -07:00
Jim
f4d7c704dd Merge pull request #3625 from dmin/patch-1
Docs: Fix example JSX output
2015-04-17 18:12:57 -07:00
Christopher Chedeau
fab11d22b8 Update 2015-04-17-react-native-v0.4.md 2015-04-17 09:14:29 -07:00
Christopher Chedeau
c3cf556ca0 React Native 0.4 Blog Post 2015-04-17 09:14:29 -07:00
Ben Alpert
3fd813f752 Merge pull request #3456 from cody/html-jsx
Fix HTML to JSX converter to work with https
2015-04-14 14:43:35 -07:00
Ben Alpert
8109af6d7f Merge pull request #3663 from spicyj/san-md
[docs] Use marked instead of Showdown and escape HTML
(cherry picked from commit be03fa7f46)
2015-04-13 16:46:05 -07:00
Paul O’Shannessy
e0c9fbc9f5 Merge pull request #3658 from sbezludny/patch-1
Fixed typo
2015-04-13 16:12:32 -07:00
Paul O’Shannessy
a1b4f40f9d Merge pull request #3642 from marocchino/ko-update
Update Korean translation to 0185c68
2015-04-13 16:12:32 -07:00
Paul O’Shannessy
aa7eb4302d Merge pull request #3641 from ljharb/patch-1
Updating `es5-shim` URL
2015-04-13 16:12:32 -07:00
Jim
5b18053ac0 Merge pull request #3635 from garethnic/reuseCompDoc
Clarify sentence in Reusable Components doc
2015-04-13 16:12:32 -07:00
Paul O’Shannessy
03595c918a Merge pull request #3584 from ThornWinters/patch-1
More Uniform Formating
2015-04-13 16:12:32 -07:00
Paul O’Shannessy
8680314086 [docs] Fix typo
Introduced in #3589
2015-04-08 10:39:43 -07:00
Paul O’Shannessy
396c6b68ed Merge pull request #3612 from gaearon/patch-1
Mention Flux in “communicate between components”
2015-04-08 10:38:17 -07:00
Ben Alpert
cc8f9d3c30 Merge pull request #3590 from koba04/patch-1
component.render method returns a ReactElement.
2015-04-08 10:38:06 -07:00
Ben Alpert
5daf9f39c0 Merge pull request #3589 from theseyi/master
Documentation: Fixed typo / grammar in 'clone with props'
2015-04-08 10:37:55 -07:00
Ben Alpert
8685fed099 Merge pull request #3588 from marocchino/ko-update
Update Korean translation to d402bd3
2015-04-08 10:36:40 -07:00
Paul O’Shannessy
4bf4112542 Merge pull request #3567 from chenglou/rm-getdomnode
Remove some `getDOMNode` from docs and DOMComponent test
2015-04-03 10:40:52 -07:00
Paul O’Shannessy
ff4c157ed7 Merge pull request #3562 from dalinaum/rename
Rename 19--dangerouslySetInnerHTML.md -> 19-dangerously-set-inner-html.md
2015-04-03 10:40:52 -07:00
Paul O’Shannessy
397fa72d1d Merge pull request #3544 from prathamesh-sonpatki/fix-link-to-display-name
Fixed link to displayName component spec from JSX in depth article
2015-04-03 10:40:52 -07:00
Paul O’Shannessy
b2043987cc Merge pull request #3539 from russellpwirtz/patch-1
Update tutorial.md
2015-04-03 10:40:52 -07:00
Paul O’Shannessy
6343ec5d79 Merge pull request #3537 from marocchino/korean-update
Update Korean translations
2015-04-03 10:40:52 -07:00
Ben Alpert
12b794a3b8 Merge pull request #3529 from uzarubin/patch-1
Swapping defaultChecked and defaultValue
2015-04-03 10:40:52 -07:00
Paul O’Shannessy
449726408e Merge pull request #3511 from AnSavvides/glossary-space
Minor space change to be in line with coding style everywhere else
2015-04-03 10:39:59 -07:00
Paul O’Shannessy
e63149d4f0 Merge pull request #3504 from clariroid/docsJP
Translate 2 docs into Japanese
2015-04-03 10:39:59 -07:00
Paul O’Shannessy
40f77d2715 Merge pull request #3498 from AnSavvides/patch-1
Include latest version of jQuery in tutorial
2015-04-03 10:39:59 -07:00
Paul O’Shannessy
1b4bc922f9 Merge pull request #3491 from bobbyrenwick/transition-group-appear-docs
adding docs for componentWillAppear and componentDidAppear
2015-04-03 10:39:59 -07:00
Paul O’Shannessy
4c779313af Merge pull request #3487 from zpao/doc/video
[docs] Videos: use https, right width videos
2015-04-03 10:39:58 -07:00
Paul O’Shannessy
be13240980 Merge pull request #3483 from julen/docs/document-body-footgun
Docs: do not render components to `document.body`
2015-04-03 10:39:58 -07:00
Paul O’Shannessy
29f11069f3 Merge pull request #3271 from delftswa2014/fix/todo-example
Added the key attribute into the todo example
2015-04-03 10:36:17 -07:00
Paul O’Shannessy
263084f5b7 Merge pull request #3240 from reactkr/translate-ko-release
Korean translation for docs
2015-04-03 10:36:17 -07:00
Ben Alpert
ad02e8bb56 [docs] Fix type on renderIntoDocument
Fixes #3581.

(cherry picked from commit d402bd3831)
2015-04-03 09:12:23 -07:00
Ben Alpert
35bc0f0b41 Fix inverted feature test in .travis.yml
I messed this up in #3540.

(cherry picked from commit 9c12e48f68)
2015-04-01 15:17:46 -07:00
Ahmad Wali Sidiqi
3b5ff0aea7 Fix small typo in 11-advanced-performance.md.
"React didn't even had"->"React didn't even have"

http://english.stackexchange.com/questions/204603/proper-usage-of-didnt-had-or-didnt-have
(cherry picked from commit 4fe1b59849)
2015-03-31 17:03:23 -07:00
Ben Alpert
d77f417767 Squelch git warning on Travis
(cherry picked from commit 835fc3d0fb)
2015-03-30 11:26:14 -07:00
Ben Alpert
946c3f04cc Set name and email a different way
(cherry picked from commit 76805fdfda)
2015-03-30 11:20:34 -07:00
Ben Alpert
d30547792c Set git name and email for Travis
(cherry picked from commit be566e0aa6)
2015-03-30 11:17:49 -07:00
Ben Alpert
6d577d83b8 [docs] English tweaks (and testing Travis)
(cherry picked from commit b7c4da59ca)
2015-03-30 11:11:02 -07:00
Ben Alpert
7f5292bea4 Autobuild website on Travis from stable branch
$REACT_WEBSITE_BRANCH in https://travis-ci.org/facebook/react/settings/env_vars now needs to point to the stable branch (currently 0.13-stable). I haven't tested the commit-and-push part of this but everything else works so I'm hopeful.

(cherry picked from commit accb4f6047)
2015-03-30 10:57:48 -07:00
Ben Alpert
987f243c73 Keep docs/js/{react,JSXTransformer}.js in repo
This way we don't need to rebuild them each time for the website.

(cherry picked from commit 0b6c7c29fe)
2015-03-30 10:57:48 -07:00
Paul O’Shannessy
0a9d6c6bbf Update TravisCI to use exiting env var
$TRAVIS_COMMIT_RANGE was broken but it seems what we're doing is worse and
resulting in false negatives.

The result of the bad range was that we weren't running lint or tests for
things we should have been. It actually looks like $TRAVIS_COMMIT has been
wrong and it's not clear why this has been working at all.

(cherry picked from commit 08b1515f7f)
2015-03-30 10:57:48 -07:00
Christopher Chedeau
54e82a552a Roundup 26 2015-03-30 07:25:14 -07:00
Ben Alpert
65f40df8b5 [docs] Split up second sentence more
(cherry picked from commit eef22ece37)
2015-03-26 12:30:48 -07:00
Ben Alpert
4924cdc436 [docs] Tweak words on homepage
(cherry picked from commit cf956ac8be)
2015-03-26 12:30:48 -07:00
Ben Alpert
67805ed12d Add React Native blog post
(cherry picked from commit 951adcdd4c)
2015-03-26 10:11:10 -07:00
Ben Alpert
5b86aca6ff [docs] Update site nav
(cherry picked from commit ca66399402)
2015-03-26 10:06:38 -07:00
Joseph Savona
d10c8fc1af Merge pull request #3463 from josephsavona/relay-components
Building The Facebook News Feed With Relay
2015-03-19 13:04:22 -07:00
Paul O’Shannessy
9b7de5b196 0.13 blog post, starter kit 2015-03-16 16:54:35 -07:00
Paul O’Shannessy
f308c03455 v0.13.1 2015-03-16 16:50:30 -07:00
Paul O’Shannessy
d4424e87a7 Update Readme for 0.13.1 2015-03-16 16:41:33 -07:00
Paul O’Shannessy
3003dcc0b1 Changelog for 0.13.1 2015-03-16 16:40:40 -07:00
Paul O’Shannessy
8436732a23 Merge pull request #3427 from zpao/full-page-dom-components
Ensure FullPageComponents are treated as DOM components
(cherry picked from commit dacd4db1fa)
2015-03-16 16:27:28 -07:00
Ben Alpert
a82e70ed34 Merge pull request #3414 from spicyj/gh-3407
Fix up Perf a bit better for 0.13
(cherry picked from commit 0a312bba89)
2015-03-16 16:27:28 -07:00
Ben Alpert
2e72fd8e43 Merge pull request #3412 from spicyj/gh-3329
Squash getDOMNode warning from isDOMComponent
(cherry picked from commit ed257cb691)
2015-03-16 16:27:28 -07:00
Ben Alpert
6cc7567eff Merge pull request #3410 from robertknight/3409-style-null-to-nonnull
Fix incorrect update of style when props.style transitions from null to non-null
(cherry picked from commit bcd70ad500)
2015-03-16 16:27:27 -07:00
Paul O’Shannessy
cfbf1d559f Merge pull request #3402 from vkramskikh/fix-empty-selects-with-value
Fix for empty <select> elements with value
(cherry picked from commit 68a2f89cc6)
2015-03-16 16:27:27 -07:00
Paul O’Shannessy
ce9fd5f028 Merge pull request #3381 from zpao/jsx-nonstrictmodule
Fix module option parsing of jsx command
(cherry picked from commit b0a59a643a)
2015-03-16 16:27:27 -07:00
Paul O’Shannessy
9432aceb4d version bump for dev 2015-03-16 16:27:27 -07:00
Paul O’Shannessy
9f95d8793e Merge pull request #3419 from xmo-odoo/patch-1
Link to inserting raw HTML document
2015-03-16 16:24:13 -07:00
Jim
9e0954abdd Merge pull request #3422 from jviereck/doc-typo-fix
Fix small typo ("of" instead of "or")
2015-03-16 16:24:08 -07:00
Paul O’Shannessy
71f65d3da6 Merge pull request #3394 from cody/getDOMNode
Fix in docs: getDOMNode --> findDOMNode
2015-03-16 16:24:03 -07:00
Paul O’Shannessy
fe8d706c1c v0.13 starter kit 2015-03-10 14:47:44 -07:00
Paul O’Shannessy
edb8f7f4af v0.13.0 2015-03-10 14:45:29 -07:00
Paul O’Shannessy
594f816930 Update readme for 0.13 2015-03-10 14:45:29 -07:00
Paul O’Shannessy
94bf54a328 shrinkwrap 2015-03-10 14:45:29 -07:00
2720 changed files with 121571 additions and 468500 deletions

View File

@@ -1,538 +0,0 @@
version: 2
aliases:
- &docker
- image: circleci/openjdk:8-jdk-node-browsers
- &environment
TZ: /usr/share/zoneinfo/America/Los_Angeles
- &restore_yarn_cache
restore_cache:
name: Restore node_modules cache
keys:
- v2-node-{{ arch }}-{{ .Branch }}-{{ checksum "yarn.lock" }}
- v2-node-{{ arch }}-{{ .Branch }}-
- v2-node-{{ arch }}-
- &run_yarn
run:
name: Install Packages
command: yarn --frozen-lockfile
- &attach_workspace
at: build
- &process_artifacts
docker: *docker
environment: *environment
steps:
- checkout
- attach_workspace: *attach_workspace
- *restore_yarn_cache
- *run_yarn
- run: node ./scripts/rollup/consolidateBundleSizes.js
- run: ./scripts/circleci/pack_and_store_artifact.sh
- store_artifacts:
path: ./node_modules.tgz
- store_artifacts:
path: ./build.tgz
- store_artifacts:
path: ./build/bundle-sizes.json
- store_artifacts:
# TODO: Update release script to use local file instead of pulling
# from artifacts.
path: ./scripts/error-codes/codes.json
- persist_to_workspace:
root: build
paths:
- bundle-sizes.json
jobs:
setup:
docker: *docker
environment: *environment
steps:
- checkout
- run:
name: Nodejs Version
command: node --version
- *restore_yarn_cache
- *run_yarn
- save_cache:
name: Save node_modules cache
key: v2-node-{{ arch }}-{{ .Branch }}-{{ checksum "yarn.lock" }}
paths:
- ~/.cache/yarn
yarn_lint:
docker: *docker
environment: *environment
steps:
- checkout
- *restore_yarn_cache
- *run_yarn
- run: node ./scripts/prettier/index
- run: node ./scripts/tasks/eslint
- run: ./scripts/circleci/check_license.sh
- run: ./scripts/circleci/check_modules.sh
- run: ./scripts/circleci/test_print_warnings.sh
yarn_flow:
docker: *docker
environment: *environment
steps:
- checkout
- *restore_yarn_cache
- *run_yarn
- run: node ./scripts/tasks/flow-ci
RELEASE_CHANNEL_stable_yarn_test:
docker: *docker
environment: *environment
steps:
- checkout
- *restore_yarn_cache
- *run_yarn
- run: yarn test --release-channel=stable --ci
yarn_test:
docker: *docker
environment: *environment
steps:
- checkout
- *restore_yarn_cache
- *run_yarn
- run: yarn test --ci
RELEASE_CHANNEL_stable_yarn_test_www:
docker: *docker
environment: *environment
steps:
- checkout
- *restore_yarn_cache
- *run_yarn
- run: yarn test --release-channel=www-classic --ci
RELEASE_CHANNEL_stable_yarn_test_www_variant:
docker: *docker
environment: *environment
steps:
- checkout
- *restore_yarn_cache
- *run_yarn
- run: yarn test --release-channel=www-classic --variant --ci
RELEASE_CHANNEL_stable_yarn_test_prod_www:
docker: *docker
environment: *environment
steps:
- checkout
- *restore_yarn_cache
- *run_yarn
- run: yarn test --release-channel=www-classic --prod --ci
RELEASE_CHANNEL_stable_yarn_test_prod_www_variant:
docker: *docker
environment: *environment
steps:
- checkout
- *restore_yarn_cache
- *run_yarn
- run: yarn test --release-channel=www-classic --prod --variant --ci
yarn_test_www:
docker: *docker
environment: *environment
steps:
- checkout
- *restore_yarn_cache
- *run_yarn
- run: yarn test --release-channel=www-modern --ci
yarn_test_www_variant:
docker: *docker
environment: *environment
steps:
- checkout
- *restore_yarn_cache
- *run_yarn
- run: yarn test --release-channel=www-modern --variant --ci
yarn_test_prod_www:
docker: *docker
environment: *environment
steps:
- checkout
- *restore_yarn_cache
- *run_yarn
- run: yarn test --release-channel=www-modern --prod --ci
yarn_test_prod_www_variant:
docker: *docker
environment: *environment
steps:
- checkout
- *restore_yarn_cache
- *run_yarn
- run: yarn test --release-channel=www-modern --prod --variant --ci
RELEASE_CHANNEL_stable_yarn_test_persistent:
docker: *docker
environment: *environment
steps:
- checkout
- *restore_yarn_cache
- *run_yarn
- run: yarn test --release-channel=stable --persistent --ci
RELEASE_CHANNEL_stable_yarn_test_prod:
docker: *docker
environment: *environment
steps:
- checkout
- *restore_yarn_cache
- *run_yarn
- run: yarn test --release-channel=stable --prod --ci
yarn_test_prod:
docker: *docker
environment: *environment
steps:
- checkout
- *restore_yarn_cache
- *run_yarn
- run: yarn test --release-channel=experimental --prod --ci
RELEASE_CHANNEL_stable_yarn_build:
docker: *docker
environment: *environment
parallelism: 20
steps:
- checkout
- *restore_yarn_cache
- *run_yarn
- run:
environment:
RELEASE_CHANNEL: stable
command: |
./scripts/circleci/add_build_info_json.sh
./scripts/circleci/update_package_versions.sh
yarn build
- run: echo "stable" >> build/RELEASE_CHANNEL
- persist_to_workspace:
root: build
paths:
- RELEASE_CHANNEL
- facebook-www
- facebook-react-native
- node_modules
- react-native
- dist
- sizes/*.json
yarn_build:
docker: *docker
environment: *environment
parallelism: 20
steps:
- checkout
- *restore_yarn_cache
- *run_yarn
- run:
environment:
RELEASE_CHANNEL: experimental
command: |
./scripts/circleci/add_build_info_json.sh
./scripts/circleci/update_package_versions.sh
yarn build
- run: echo "experimental" >> build/RELEASE_CHANNEL
- persist_to_workspace:
root: build
paths:
- RELEASE_CHANNEL
- facebook-www
- facebook-react-native
- node_modules
- react-native
- dist
- sizes/*.json
build_devtools_and_process_artifacts:
docker: *docker
environment: *environment
parallelism: 20
steps:
- checkout
- attach_workspace: *attach_workspace
- *restore_yarn_cache
- *run_yarn
- run:
environment:
RELEASE_CHANNEL: experimental
command: ./scripts/circleci/pack_and_store_devtools_artifacts.sh
- store_artifacts:
path: ./build/devtools.tgz
# These jobs are named differently so we can distinguish the stable and
# and experimental artifacts
process_artifacts: *process_artifacts
process_artifacts_experimental: *process_artifacts
sizebot_stable:
docker: *docker
environment: *environment
steps:
- checkout
- attach_workspace: *attach_workspace
- *restore_yarn_cache
- *run_yarn
# This runs in the process_artifacts job, too, but it's faster to run
# this step in both jobs instead of running the jobs sequentially
- run: node ./scripts/rollup/consolidateBundleSizes.js
- run:
environment:
RELEASE_CHANNEL: stable
command: node ./scripts/tasks/danger
sizebot_experimental:
docker: *docker
environment: *environment
steps:
- checkout
- attach_workspace: *attach_workspace
- *restore_yarn_cache
- *run_yarn
# This runs in the process_artifacts job, too, but it's faster to run
# this step in both jobs instead of running the jobs sequentially
- run: node ./scripts/rollup/consolidateBundleSizes.js
- run:
environment:
RELEASE_CHANNEL: experimental
command: node ./scripts/tasks/danger
yarn_lint_build:
docker: *docker
environment: *environment
steps:
- checkout
- attach_workspace: *attach_workspace
- *restore_yarn_cache
- *run_yarn
- run: yarn lint-build
- run: scripts/circleci/check_minified_errors.sh
RELEASE_CHANNEL_stable_yarn_lint_build:
docker: *docker
environment: *environment
steps:
- checkout
- attach_workspace: *attach_workspace
- *restore_yarn_cache
- *run_yarn
- run:
environment:
RELEASE_CHANNEL: stable
command: yarn lint-build
- run: scripts/circleci/check_minified_errors.sh
RELEASE_CHANNEL_stable_yarn_test_build:
docker: *docker
environment: *environment
steps:
- checkout
- attach_workspace: *attach_workspace
- *restore_yarn_cache
- *run_yarn
- run: yarn test --release-channel=stable --build --ci
yarn_test_build:
docker: *docker
environment: *environment
steps:
- checkout
- attach_workspace: *attach_workspace
- *restore_yarn_cache
- *run_yarn
- run: yarn test --release-channel=experimental --build --ci
yarn_test_build_devtools:
docker: *docker
environment: *environment
steps:
- checkout
- attach_workspace: *attach_workspace
- *restore_yarn_cache
- *run_yarn
- run: yarn test --project=devtools --build --ci
RELEASE_CHANNEL_stable_yarn_test_dom_fixtures:
docker: *docker
environment: *environment
steps:
- checkout
- attach_workspace: *attach_workspace
- *restore_yarn_cache
- run:
name: Run DOM fixture tests
environment:
RELEASE_CHANNEL: stable
command: |
cd fixtures/dom
yarn --frozen-lockfile
yarn prestart
yarn test --maxWorkers=2
test_fuzz:
docker: *docker
environment: *environment
steps:
- checkout
- *restore_yarn_cache
- *run_yarn
- run:
name: Run fuzz tests
command: |
FUZZ_TEST_SEED=$RANDOM yarn test fuzz --ci
FUZZ_TEST_SEED=$RANDOM yarn test --prod fuzz --ci
RELEASE_CHANNEL_stable_yarn_test_build_prod:
docker: *docker
environment: *environment
steps:
- checkout
- attach_workspace: *attach_workspace
- *restore_yarn_cache
- *run_yarn
- run: yarn test --release-channel=stable --build --prod --ci
yarn_test_build_prod:
docker: *docker
environment: *environment
steps:
- checkout
- attach_workspace: *attach_workspace
- *restore_yarn_cache
- *run_yarn
- run: yarn test --release-channel=experimental --build --prod --ci
workflows:
version: 2
stable:
jobs:
- setup
- yarn_lint:
requires:
- setup
- yarn_flow:
requires:
- setup
- RELEASE_CHANNEL_stable_yarn_test:
requires:
- setup
- RELEASE_CHANNEL_stable_yarn_test_prod:
requires:
- setup
- RELEASE_CHANNEL_stable_yarn_test_persistent:
requires:
- setup
- RELEASE_CHANNEL_stable_yarn_test_www:
requires:
- setup
- RELEASE_CHANNEL_stable_yarn_test_www_variant:
requires:
- setup
- RELEASE_CHANNEL_stable_yarn_test_prod_www:
requires:
- setup
- RELEASE_CHANNEL_stable_yarn_test_prod_www_variant:
requires:
- setup
- RELEASE_CHANNEL_stable_yarn_build:
requires:
- setup
- process_artifacts:
requires:
- RELEASE_CHANNEL_stable_yarn_build
- sizebot_stable:
requires:
- RELEASE_CHANNEL_stable_yarn_build
- RELEASE_CHANNEL_stable_yarn_lint_build:
requires:
- RELEASE_CHANNEL_stable_yarn_build
- RELEASE_CHANNEL_stable_yarn_test_build:
requires:
- RELEASE_CHANNEL_stable_yarn_build
- RELEASE_CHANNEL_stable_yarn_test_build_prod:
requires:
- RELEASE_CHANNEL_stable_yarn_build
- RELEASE_CHANNEL_stable_yarn_test_dom_fixtures:
requires:
- RELEASE_CHANNEL_stable_yarn_build
experimental:
jobs:
- setup
- yarn_test:
requires:
- setup
- yarn_test_prod:
requires:
- setup
- yarn_test_www:
requires:
- setup
- yarn_test_www_variant:
requires:
- setup
- yarn_test_prod_www:
requires:
- setup
- yarn_test_prod_www_variant:
requires:
- setup
- yarn_build:
requires:
- setup
- process_artifacts_experimental:
requires:
- yarn_build
- sizebot_experimental:
requires:
- yarn_build
- yarn_test_build:
requires:
- yarn_build
- yarn_test_build_prod:
requires:
- yarn_build
- yarn_lint_build:
requires:
- yarn_build
- yarn_test_build_devtools:
requires:
- yarn_build
# FIXME: Temporarily disabled to unblock master.
# - build_devtools_and_process_artifacts:
# requires:
# - yarn_build
fuzz_tests:
triggers:
- schedule:
# Fuzz tests run hourly
cron: "0 * * * *"
filters:
branches:
only:
- master
jobs:
- setup
- test_fuzz:
requires:
- setup

View File

@@ -1,10 +0,0 @@
{
"packages": ["packages/react", "packages/react-dom", "packages/scheduler"],
"buildCommand": "build --type=NODE react/index,react-dom/index,react-dom/server,scheduler/index,scheduler/tracing",
"publishDirectory": {
"react": "build/node_modules/react",
"react-dom": "build/node_modules/react-dom",
"scheduler": "build/node_modules/scheduler"
},
"sandboxes": ["new"]
}

View File

@@ -1,4 +1,4 @@
# https://editorconfig.org
# http://editorconfig.org
root = true
[*]
@@ -6,7 +6,6 @@ charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
max_line_length = 80
trim_trailing_whitespace = true

View File

@@ -1,21 +1,21 @@
# Third party
**/node_modules
# Not written by hand
packages/react-art/npm/lib
# Build products
build/
coverage/
fixtures/
scripts/bench/benchmarks/**/*.js
# React repository clone
scripts/bench/remote-repo/
packages/react-devtools-core/dist
packages/react-devtools-extensions/chrome/build
packages/react-devtools-extensions/firefox/build
packages/react-devtools-extensions/shared/build
packages/react-devtools-inline/dist
packages/react-devtools-shell/dist
# We can probably lint these later but not important at this point
src/vendor
# eslint uses JSX* node types to determine if using JSX. esprima-fb still uses
# XJS* nodes. When we fix that (https://github.com/facebook/esprima/pull/85) we
# can enable linting the tests and fix those errors.
src/**/__tests__/**
# This should be enabled but that folder has too much in it that doesn't belong
src/test
test/the-files-to-test.generated.js
# This is synced with a different file internally, don't want to lint it yet
vendor/fbtransform/syntax.js
vendor/jasmine/
vendor/jasmine-jsreporter/
# But not in docs/_js/examples/*
docs/_js/*.js
docs/js/
# gems
docs/vendor/bundle/
# This should be more like examples/**/thirdparty/** but
# we should fix https://github.com/facebook/esprima/pull/85 first
examples/

51
.eslintrc Normal file
View File

@@ -0,0 +1,51 @@
---
parser: esprima-fb
env:
browser: true
node: true
globals:
__DEV__: true
rules:
# ERRORS
space-before-blocks: 2
indent: [2, 2, indentSwitchCase: true]
brace-style: 2
space-after-keywords: 2
strict: 2
# We actually have a transform to support this and we fix this for bundled
# releases but not for the npm package, so enforce it strictly
no-comma-dangle: 2
# Make this a warning for now. We do this in a few places so we might need to
# disable
no-unused-expressions: 2
block-scoped-var: 2
eol-last: 2
dot-notation: 2
consistent-return: 2
no-unused-vars: [2, args: none]
quotes: [2, 'single']
# WARNINGS
# This is the only one that's hard to track since we don't lint just changes.
max-len: [1, 80]
# WISHLIST. One day...
# We'll need a custom version of this that does a subset of the whole rule.
# Otherwise this is just too noisy.
# valid-jsdoc: 1
# DISABLED. These aren't compatible with our style
# We use this for private/internal variables
no-underscore-dangle: 0
# We pass constructors around / access them from members
new-cap: 0
# We do this a lot.
no-use-before-define: 0
# We do this in a few places to align values
key-spacing: 0
# DISABLED. These currently cause errors when running.
no-multi-spaces: 0

View File

@@ -1,184 +0,0 @@
'use strict';
const {
es5Paths,
esNextPaths,
} = require('./scripts/shared/pathsByLanguageVersion');
const restrictedGlobals = require('confusing-browser-globals');
const OFF = 0;
const ERROR = 2;
module.exports = {
extends: ['fbjs', 'prettier'],
// Stop ESLint from looking for a configuration file in parent folders
root: true,
plugins: ['jest', 'no-for-of-loops', 'react', 'react-internal'],
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 8,
sourceType: 'script',
ecmaFeatures: {
experimentalObjectRestSpread: true,
},
},
// We're stricter than the default config, mostly. We'll override a few rules
// and then enable some React specific ones.
rules: {
'accessor-pairs': OFF,
'brace-style': [ERROR, '1tbs'],
'consistent-return': OFF,
'dot-location': [ERROR, 'property'],
// We use console['error']() as a signal to not transform it:
'dot-notation': [ERROR, {allowPattern: '^(error|warn)$'}],
'eol-last': ERROR,
eqeqeq: [ERROR, 'allow-null'],
indent: OFF,
'jsx-quotes': [ERROR, 'prefer-double'],
'keyword-spacing': [ERROR, {after: true, before: true}],
'no-bitwise': OFF,
'no-inner-declarations': [ERROR, 'functions'],
'no-multi-spaces': ERROR,
'no-restricted-globals': [ERROR].concat(restrictedGlobals),
'no-restricted-syntax': [ERROR, 'WithStatement'],
'no-shadow': ERROR,
'no-unused-expressions': ERROR,
'no-unused-vars': [ERROR, {args: 'none'}],
'no-use-before-define': OFF,
'no-useless-concat': OFF,
quotes: [ERROR, 'single', {avoidEscape: true, allowTemplateLiterals: true}],
'space-before-blocks': ERROR,
'space-before-function-paren': OFF,
'valid-typeof': [ERROR, {requireStringLiterals: true}],
// We apply these settings to files that should run on Node.
// They can't use JSX or ES6 modules, and must be in strict mode.
// They can, however, use other ES6 features.
// (Note these rules are overridden later for source files.)
'no-var': ERROR,
strict: ERROR,
// Enforced by Prettier
// TODO: Prettier doesn't handle long strings or long comments. Not a big
// deal. But I turned it off because loading the plugin causes some obscure
// syntax error and it didn't seem worth investigating.
'max-len': OFF,
// React & JSX
// Our transforms set this automatically
'react/jsx-boolean-value': [ERROR, 'always'],
'react/jsx-no-undef': ERROR,
// We don't care to do this
'react/jsx-sort-prop-types': OFF,
'react/jsx-space-before-closing': ERROR,
'react/jsx-uses-react': ERROR,
'react/no-is-mounted': OFF,
// This isn't useful in our test code
'react/react-in-jsx-scope': ERROR,
'react/self-closing-comp': ERROR,
// We don't care to do this
'react/jsx-wrap-multilines': [
ERROR,
{declaration: false, assignment: false},
],
// Prevent for...of loops because they require a Symbol polyfill.
// You can disable this rule for code that isn't shipped (e.g. build scripts and tests).
'no-for-of-loops/no-for-of-loops': ERROR,
// CUSTOM RULES
// the second argument of warning/invariant should be a literal string
'react-internal/no-primitive-constructors': ERROR,
'react-internal/no-to-warn-dev-within-to-throw': ERROR,
'react-internal/invariant-args': ERROR,
'react-internal/warning-args': ERROR,
'react-internal/no-production-logging': ERROR,
'react-internal/no-cross-fork-imports': ERROR,
},
overrides: [
{
// We apply these settings to files that we ship through npm.
// They must be ES5.
files: es5Paths,
parser: 'espree',
parserOptions: {
ecmaVersion: 5,
sourceType: 'script',
},
rules: {
'no-var': OFF,
strict: ERROR,
},
},
{
// We apply these settings to the source files that get compiled.
// They can use all features including JSX (but shouldn't use `var`).
files: esNextPaths,
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 8,
sourceType: 'module',
},
rules: {
'no-var': ERROR,
'prefer-const': ERROR,
strict: OFF,
},
},
{
files: ['**/__tests__/*.js'],
rules: {
// https://github.com/jest-community/eslint-plugin-jest
'jest/no-focused-tests': ERROR,
'jest/valid-expect': ERROR,
'jest/valid-expect-in-promise': ERROR,
},
},
{
files: [
'**/__tests__/**/*.js',
'scripts/**/*.js',
'packages/*/npm/**/*.js',
'packages/dom-event-testing-library/**/*.js',
'packages/react-devtools*/**/*.js',
],
rules: {
'react-internal/no-production-logging': OFF,
'react-internal/warning-args': OFF,
},
},
{
files: ['packages/react-native-renderer/**/*.js'],
globals: {
nativeFabricUIManager: true,
},
},
{
files: ['packages/react-transport-dom-webpack/**/*.js'],
globals: {
__webpack_chunk_load__: true,
__webpack_require__: true,
},
},
],
globals: {
SharedArrayBuffer: true,
spyOnDev: true,
spyOnDevAndProd: true,
spyOnProd: true,
__PROFILE__: true,
__UMD__: true,
__EXPERIMENTAL__: true,
__VARIANT__: true,
gate: true,
trustedTypes: true,
},
};

View File

@@ -1,41 +0,0 @@
---
name: "🐛 Bug Report"
about: Report a reproducible bug or regression.
title: 'Bug: '
labels: 'Status: Unconfirmed'
---
<!--
Please provide a clear and concise description of what the bug is. Include
screenshots if needed. Please test using the latest version of the relevant
React packages to make sure your issue has not already been fixed.
-->
React version:
## Steps To Reproduce
1.
2.
<!--
Your bug will get fixed much faster if we can run your code and it doesn't
have dependencies other than React. Issues without reproduction steps or
code examples may be immediately closed as not actionable.
-->
Link to code example:
<!--
Please provide a CodeSandbox (https://codesandbox.io/s/new), a link to a
repository on GitHub, or provide a minimal code example that reproduces the
problem. You may provide a screenshot of the application if you think it is
relevant to your bug report. Here are some tips for providing a minimal
example: https://stackoverflow.com/help/mcve.
-->
## The current behavior
## The expected behavior

View File

@@ -1,7 +0,0 @@
contact_links:
- name: 📃 Documentation Issue
url: https://github.com/reactjs/reactjs.org/issues/new
about: This issue tracker is not for documentation issues. Please file documentation issues here.
- name: 🤔 Questions and Help
url: https://reactjs.org/community/support.html
about: This issue tracker is not for support questions. Please refer to the React community's help and discussion forums.

View File

@@ -1,27 +0,0 @@
<!--
Thanks for submitting a pull request!
We appreciate you spending the time to work on these changes. Please provide enough information so that others can review your pull request. The three fields below are mandatory.
Before submitting a pull request, please make sure the following is done:
1. Fork [the repository](https://github.com/facebook/react) and create your branch from `master`.
2. Run `yarn` in the repository root.
3. If you've fixed a bug or added code that should be tested, add tests!
4. Ensure the test suite passes (`yarn test`). Tip: `yarn test --watch TestName` is helpful in development.
5. Run `yarn test-prod` to test in the production environment. It supports the same options as `yarn test`.
6. If you need a debugger, run `yarn debug-test --watch TestName`, open `chrome://inspect`, and press "Inspect".
7. Format your code with [prettier](https://github.com/prettier/prettier) (`yarn prettier`).
8. Make sure your code lints (`yarn lint`). Tip: `yarn linc` to only check changed files.
9. Run the [Flow](https://flowtype.org/) type checks (`yarn flow`).
10. If you haven't already, complete the CLA.
Learn more about contributing: https://reactjs.org/docs/how-to-contribute.html
-->
## Summary
<!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? -->
## Test Plan
<!-- Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface. -->

34
.github/stale.yml vendored
View File

@@ -1,34 +0,0 @@
# Configuration for probot-stale - https://github.com/probot/stale
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 90
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- "Partner"
- "React Core Team"
- "Resolution: Backlog"
- "Type: Bug"
- "Type: Discussion"
- "Type: Needs Investigation"
- "Type: Regression"
# Label to use when marking an issue as stale
staleLabel: "Resolution: Stale"
issues:
# Comment to post when marking an issue as stale.
markComment: >
This issue has been automatically marked as stale.
**If this issue is still affecting you, please leave any comment** (for example, "bump"), and we'll keep it open.
We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!
# Comment to post when closing a stale issue.
closeComment: >
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you!
pulls:
# Comment to post when marking a pull request as stale.
markComment: >
This pull request has been automatically marked as stale.
**If this pull request is still relevant, please leave any comment** (for example, "bump"), and we'll keep it open.
We are sorry that we haven't been able to prioritize reviewing it yet. Your contribution is very much appreciated.
# Comment to post when closing a stale pull request.
closeComment: >
Closing this pull request after a prolonged period of inactivity. If this issue is still present in the latest release, please ask for this pull request to be reopened. Thank you!

35
.gitignore vendored
View File

@@ -1,37 +1,22 @@
.DS_STORE
node_modules
scripts/flow/*/.flowconfig
.flowconfig
*~
*.pyc
static
.grunt
_SpecRunner.html
__benchmarks__
build/
remote-repo/
coverage/
.module-cache
fixtures/dom/public/react-dom.js
fixtures/dom/public/react.js
*.gem
docs/.bundle
docs/code
docs/_site
docs/.sass-cache
docs/js/*
docs/downloads
docs/vendor/bundle
examples/shared/*.js
test/the-files-to-test.generated.js
*.log*
chrome-user-data
*.sublime-project
*.sublime-workspace
.idea
*.iml
.vscode
*.swp
*.swo
packages/react-devtools-core/dist
packages/react-devtools-extensions/chrome/build
packages/react-devtools-extensions/chrome/*.crx
packages/react-devtools-extensions/chrome/*.pem
packages/react-devtools-extensions/firefox/build
packages/react-devtools-extensions/firefox/*.xpi
packages/react-devtools-extensions/firefox/*.pem
packages/react-devtools-extensions/shared/build
packages/react-devtools-extensions/.tempUserDataDir
packages/react-devtools-inline/dist
packages/react-devtools-shell/dist

View File

@@ -1,118 +1,62 @@
Adam Timberlake <adam.timberlake@gmail.com>
Alex Mykyta <dancingwithcows@gmail.com>
Alex Pien <alexpien@gmail.com>
Alex Pien <alexpien@gmail.com> <pien@pien-mbp.dhcp.thefacebook.com>
Alex Pien <alexpien@gmail.com> <pien@pien-mbp.local>
Andreas Savvides <asavvides@twitter.com> <AnSavvides@users.noreply.github.com>
Andreas Savvides <asavvides@twitter.com> <andreas@nibbli.com>
Andreas Svensson <andreas@syranide.com>
Andres Suarez <zertosh@gmail.com>
Andrew Kulakov <avk@8xx8.ru>
Andrew Sokolov <asokolov@atlassian.com>
Anto Aravinth <anto.aravinth.cse@gmail.com>
Baraa Hamodi <bhamodi@uwaterloo.ca> <baraa@optimizely.com>
Ben Halpern <bendhalpern@gmail.com>
Ben Alpert <ben@benalpert.com> <balpert@fb.com>
Ben Alpert <ben@benalpert.com> <spicyjalapeno@gmail.com>
Ben Newman <bn@cs.stanford.edu> <benjamn@fb.com>
Benjamin Woodruff <github@benjam.info> <bgw@fb.com>
Bill Fisher <fisherwebdev@gmail.com>
Blaine Kasten <blainekasten@gmail.com>
Brandon Tilley <brandon@brandontilley.com>
Changsoon Bok <winmain@gmail.com>
Cheng Lou <chenglou92@gmail.com> <chenglou@fb.com>
Christian Oliff <christianoliff@yahoo.com>
Christoph Pojer <christoph.pojer@gmail.com>
Christoph Pojer <christoph.pojer@gmail.com> <cpojer@fb.com>
Connor McSheffrey <c@conr.me> <connor.mcsheffrey@gmail.com>
Conor Hastings <hastings.conorm@gmail.com> <conor@socialtables.com>
Dan Schafer <dschafer@fb.com>
Daniel Gasienica <daniel@gasienica.ch> <daniel@fiftythree.com>
Daniel Gasienica <daniel@gasienica.ch> <dgasienica@zynga.com>
Daniel Hejl <daniel.hejl@hotmail.com>
Daniel Lo Nigro <daniel@dan.cx> <danlo@fb.com>
Dave Galbraith <dave@jut.io>
Dennis Johnson <songawee@gmail.com>
Dmitry Blues <dmitri.blyus@gmail.com>
Dongsheng Liu <bellanchor@gmail.com>
Erik Harper <eharper@mixpo.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>
Fyodor Ivanishchev <cbrwizard@gmail.com>
Gabe Levi <gabelevi@gmail.com> <glevi@fb.com>
Geert Pasteels <geert.pasteels@gmail.com>
George A Sisco III <george.sisco@gmail.com>
Georgii Dolzhykov <thorn.mailbox@gmail.com>
Harry Hull <harry.hull1@gmail.com>
Hendrik Swanepoel <hendrik.swanepoel@gmail.com>
Hyeock Kwon <doublus@gmail.com>
Ian Obermiller <ian@obermillers.com> <iano@fb.com>
Ilia Pavlenkov <dortonway@gmail.com>
Ilyá Belsky <gelias.gbelsky@gmail.com>
Ingvar Stepanyan <me@rreverser.com> <rreverser@ubuntu.rreverser.a4.internal.cloudapp.net>
Irae Carvalho <irae@irae.pro.br>
Ivan Vergiliev <ivan.vergiliev@gmail.com>
JJ Weber <jj.weber@gmail.com>
Jae Hun Ro <jhr24@duke.edu>
Jaime Mingo <j.mingov@3boll.com>
James Brantly <james@jbrantly.com>
Jan Hancic <jan.hancic@gmail.com> <jan.hancic@caplin.com>
Jan Kassens <jan@kassens.net> <jkassens@fb.com>
Jason Bonta <jbonta@gmail.com> <jasonbonta@fb.com>
Jason Quense <monastic.panic@gmail.com>
Jason Trill <jason@jasontrill.com>
Jeff Chan <jefftchan@gmail.com> <jeff@quizlet.com>
Jeff Morrison <jeff@anafx.com> <Jeff@anafx.com>
Jeff Morrison <jeff@anafx.com> <jeffmo@fb.com>
Jeff Morrison <jeff@anafx.com> <lbljeffmo@gmail.com>
Jeffrey Lin <lin.jeffrey@gmail.com> <jeffreylin@fb.com>
Jim Sproch <jsproch@fb.com>
Jim Sproch <jsproch@fb.com> <jsfb@github>
Jim Sproch <jsproch@fb.com> <none@no-reply.com>
Jinwoo Oh <arkist@gmail.com>
Jinxiu Lee <lee.jinxiu@gmail.com>
Jiyeon Seo <zzzeons@gmail.com>
Jon Chester <jonchester@fb.com>
Jon Madison <jon@tfftech.com>
Jonathan Hsu <jhiswin@gmail.com>
Jonathan Persson <persson.jonathan@gmail.com> <jonathan.persson@creuna.se>
Jordan Walke <jordojw@gmail.com>
Jordan Walke <jordojw@gmail.com> <jordanjcw@fb.com>
Joseph Savona <joesavona@fb.com> <josephsavona@users.noreply.github.com>
Josh Duck <josh@fb.com> <github@joshduck.com>
Juan Serrano <germ13@users.noreply.github.com>
Jun Wu <quark@lihdd.net>
Justin Robison <jrobison151@gmail.com>
Keito Uchiyama <projects@keito.me> <keito@fb.com>
Kevin Coughlin <kevintcoughlin@gmail.com> <kevincoughlin@tumblr.com>
Krystian Karczewski <karcz.k@gmail.com>
Kunal Mehta <k.mehta@berkeley.edu> <kunalm@fb.com>
Laurence Rowe <l@lrowe.co.uk> <laurence@lrowe.co.uk>
Lea Rosema <terabaud@gmail.com>
Marcin K. <katzoo@github.mail>
Mark Anderson <undernewmanagement@users.noreply.github.com>
Mark Funk <mfunk86@gmail.com> <mark@boomtownroi.com>
Martin Andert <mandert@gmail.com>
Mathieu M-Gosselin <mathieumg@gmail.com> <mathieumg@atx33.com>
Matsunoki <himkt@klis.tsukuba.ac.jp>
Matt Brookes <matt@brookes.net>
Matt Dunn-Rankin <mdunnrankin@gmail.com> <matchu1993@gmail.com>
Matt Zabriskie <mzabriskie@gmail.com>
Matthew Johnston <matthewjohnston4@outlook.com> <matthewjohnston4@users.noreply.github.com>
Matthew Looi <looi.matthew@gmail.com>
Mattijs Kneppers <mattijs@arttech.nl>
Max Heiber <max.heiber@gmail.com>
Max Stoiber <contact@mstoiber.com>
Michal Srb <xixixao@seznam.cz> xixixao <xixixao@seznam.cz>
Michelle Todd <himichelletodd@gmail.com> <michelle@khanacademy.org>
Mihai Parparita <mihai.parparita@gmail.com> <mihai@persistent.info>
Minwe LUO <minwe@yunshipei.com>
Murray M. Moss <murray@mmoss.name> <MMoss@cainc.com>
Murray M. Moss <murray@mmoss.name> <mmoss@users.noreply.github.com>
Neri Marschik <marschik_neri@cyberagent.co.jp>
Nick Gavalas <njg57@cornell.edu>
Nick Thompson <ncthom91@gmail.com> <nickt@instagram.com>
Patrick Stapleton <github@gdi2290.com>
Paul OShannessy <paul@oshannessy.com> <poshannessy@fb.com>
Paul Shen <paul@mnml0.com> <paulshen@fb.com>
Pete Hunt <floydophone@gmail.com>
@@ -123,43 +67,23 @@ Petri Lievonen <plievone@cc.hut.fi>
Petri Lievonen <plievone@cc.hut.fi> <petri.lievonen@tkk.fi>
Pieter Vanderwerff <me@pieter.io> <pieter@heyday.co.nz>
Pouja Nikray <poujanik@gmail.com>
Rainer Oviir <roviir@gmail.com> <raineroviir@rainers-MacBook-Pro.local>
Ray <ray@tomo.im>
Richard Feldman <richard.t.feldman@gmail.com> <richard@noredink.com>
Richard Livesey <Livesey7@hotmail.co.uk>
Rob Arnold <robarnold@cs.cmu.edu>
Robert Binna <rbinna@gmail.com> <speedskater@users.noreply.github.com>
Robin Frischmann <robin@rofrischmann.de>
Sander Spies <sandermail@gmail.com>
Scott Feeney <scott@oceanbase.org> <smf@fb.com>
Sebastian Markbåge <sebastian@calyptus.eu> <sema@fb.com>
Sergey Rubanov <chi187@gmail.com>
Shogun Sea <shogunsea08@gmail.com> <xxin@groupon.com>
Soichiro Kawamura <mail@w-st.com>
Sophie Alpert <git@sophiebits.com> <balpert@fb.com>
Sophie Alpert <git@sophiebits.com> <ben@benalpert.com>
Sophie Alpert <git@sophiebits.com> <sophiebits@fb.com>
Sophie Alpert <git@sophiebits.com> <spicyjalapeno@gmail.com>
Sota Ohara <ohrst.18@gmail.com>
Steven Luscher <react@steveluscher.com> <github@steveluscher.com>
Steven Luscher <react@steveluscher.com> <steveluscher@fb.com>
Steven Luscher <react@steveluscher.com> <steveluscher@instagram.com>
Steven Luscher <react@steveluscher.com> <steveluscher@users.noreply.github.com>
Stoyan Stefanov <ssttoo@ymail.com>
Tengfei Guo <terryr3rd@yeah.net> <tfguo369@gmail.com>
Thomas Aylott <oblivious@subtlegradient.com> <aylott@fb.com>
Timothy Yung <yungsters@gmail.com> <yungsters@fb.com>
Tomoya Suzuki <tmysz.dev@gmail.com>
Vasiliy Loginevskiy <Yeti.or@gmail.com>
Vasiliy Loginevskiy <Yeti.or@gmail.com> <yeti-or@yandex-team.ru>
Vjeux <vjeuxx@gmail.com>
Vjeux <vjeuxx@gmail.com> <vjeux@fb.com>
Volkan Unsal <spocksplanet@gmail.com>
Wander Wang <wander.wang@ismole.com>
Xavier Morel <xmo-odoo@users.noreply.github.com>
YouBao Nong <noyobo@gmail.com> <nongyoubao@alibaba-inc.com>
Yutaka Nakajima <nakazye@gmail.com>
Zach Bruggeman <mail@bruggie.com> <zbruggeman@me.com>
iawia002 <z2d@jifangcheng.com> <850127508@qq.com>
元彦 <yuanyan@users.noreply.github.com>
张敏 <cookfront@gmail.com>

1
.nvmrc
View File

@@ -1 +0,0 @@
v12.16.2

View File

@@ -1,6 +0,0 @@
packages/react-devtools-core/dist
packages/react-devtools-extensions/chrome/build
packages/react-devtools-extensions/firefox/build
packages/react-devtools-extensions/shared/build
packages/react-devtools-inline/dist
packages/react-devtools-shell/dist

View File

@@ -1,21 +0,0 @@
'use strict';
const {esNextPaths} = require('./scripts/shared/pathsByLanguageVersion');
module.exports = {
bracketSpacing: false,
singleQuote: true,
jsxBracketSameLine: true,
trailingComma: 'es5',
printWidth: 80,
parser: 'babel',
overrides: [
{
files: esNextPaths,
options: {
trailingComma: 'all',
},
},
],
};

99
.travis.yml Normal file
View File

@@ -0,0 +1,99 @@
---
language: node_js
node_js:
- '0.10'
sudo: false
cache:
directories:
- docs/vendor/bundle
- node_modules
before_install:
- |
if [ "$TEST_TYPE" != build_website ] && \
! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.md$)|(^(docs|examples))/'
then
echo "Only docs were updated, stopping build process."
exit
fi
script:
- |
if [ "$TEST_TYPE" = build_website ]; then
if [ "$TRAVIS_BRANCH" = "$REACT_WEBSITE_BRANCH" ] && [ "$TRAVIS_PULL_REQUEST" = false ]; then
set -e
GH_PAGES_DIR="$TRAVIS_BUILD_DIR"/../react-gh-pages
echo "machine github.com login reactjs-bot password $GITHUB_TOKEN" >~/.netrc
git config --global user.name "Travis CI"
git config --global user.email "travis@reactjs.org"
git clone --branch gh-pages --depth=50 \
https://reactjs-bot@github.com/facebook/react.git \
$GH_PAGES_DIR
pushd docs
bundle install --jobs=3 --retry=3 --path=vendor/bundle
bundle exec rake release
cd $GH_PAGES_DIR
git status
if ! git diff-index --quiet HEAD --; then
git add -A .
git commit -m "Rebuild website"
git push origin gh-pages
fi
popd
fi
else
grunt $TEST_TYPE
fi
after_script:
- |
if [ "$TEST_TYPE" = test ] && [ "$SERVER" ]; then
grunt build
curl \
-F "react=@build/react.js" \
-F "react.min=@build/react.min.js" \
-F "transformer=@build/JSXTransformer.js" \
-F "react-with-addons=@build/react-with-addons.js" \
-F "react-with-addons.min=@build/react-with-addons.min.js" \
-F "npm-react=@build/react.tgz" \
-F "npm-react-tools=@build/react-tools.tgz" \
-F "commit=$TRAVIS_COMMIT" \
-F "date=`git log --format='%ct' -1`" \
-F "pull_request=$TRAVIS_PULL_REQUEST" \
-F "token=$SECRET_TOKEN" \
-F "branch=$TRAVIS_BRANCH" \
$SERVER
fi
env:
matrix:
- TEST_TYPE=test
- TEST_TYPE=jest
- TEST_TYPE=lint
- TEST_TYPE=build_website
- TEST_TYPE=test:webdriver:saucelabs:modern
global:
# SERVER
- secure: qPvsJ46XzGrdIuPA70b55xQNGF8jcK7N1LN5CCQYYocXLa+fBrl+fTE77QvehOPhqwJXcj6kOxI+sY0KrVwV7gmq2XY2HZGWUSCxTN0SZlNIzqPA80Y7G/yOjA4PUt8LKgP+8tptyhTAY56qf+hgW8BoLiKOdztYF2p+3zXOLuA=
# SECRET_TOKEN
- secure: dkpPW+VnoqC/okhRdV90m36NcyBFhcwEKL3bNFExAwi0dXnFao8RoFlvnwiPlA23h2faROkMIetXlti6Aju08BgUFV+f9aL6vLyU7gUent4Nd3413zf2fwDtXIWIETg6uLnOpSykGKgCAT/hY3Q2oPLqOoY0OxfgnbqwxkxljrE=
# GITHUB_TOKEN
- secure: EHCyCSKMwKlLHNtcj9nmkRzmiiPE3aDGlPcnEyrDJeRI0SeN/iCXHXfFivR0vFq3vr+9naMBczAR2AEidtps5KbJrKqdZnjPFRbmfVtzWr/LlvVCub3u13Pub6TdKIVBTny1PuZ5X8GvdxMNVig89jGjvzhhWuQRaz3VhJnTra4=
matrix:
fast_finish: true
allow_failures:
- env: TEST_TYPE=test:coverage
- env: TEST_TYPE=perf:full
- env: TEST_TYPE=test:webdriver:saucelabs:modern
- env: TEST_TYPE=test:webdriver:saucelabs BROWSER_NAME=ie11
- env: TEST_TYPE=test:webdriver:saucelabs BROWSER_NAME=ie10
- env: TEST_TYPE=test:webdriver:saucelabs BROWSER_NAME=ie9
- env: TEST_TYPE=test:webdriver:saucelabs BROWSER_NAME=ie8
- env: TEST_TYPE=test:webdriver:saucelabs:ios
- env: TEST_TYPE=test:webdriver:saucelabs BROWSER_NAME=safari
notifications:
irc:
use_notice: true
skip_join: true
on_success: change
on_failure: change
channels:
- chat.freenode.net#reactjs

View File

@@ -1 +0,0 @@
{}

798
AUTHORS

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,76 +0,0 @@
# Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to make participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Scope
This Code of Conduct applies within all project spaces, and it also applies when
an individual is representing the project or its community in public spaces.
Examples of representing a project or community include using an official
project e-mail address, posting via an official social media account, or acting
as an appointed representative at an online or offline event. Representation of
a project may be further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at <opensource-conduct@fb.com>. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq

View File

@@ -1,5 +1,70 @@
# Contributing to React
Want to contribute to React? There are a few things you need to know.
React is one of Facebook's first open source projects that is both under very active development and is also being used to ship code to everybody on [facebook.com](https://www.facebook.com). We're still working out the kinks to make contributing to this project as easy and transparent as possible, but we're not quite there yet. Hopefully this document makes the process for contributing clear and preempts some questions you may have.
We wrote a **[contribution guide](https://reactjs.org/contributing/how-to-contribute.html)** to help you get started.
## Our Development Process
Some of the core team will be working directly on GitHub. These changes will be public from the beginning. Other changesets will come via a bridge with Facebook's internal source control. This is a necessity as it allows engineers at Facebook outside of the core team to move fast and contribute from an environment they are comfortable in.
### `master` is unsafe
We will do our best to keep `master` in good shape, with tests passing at all times. But in order to move fast, we will make API changes that your application might not be compatible with. We will do our best to communicate these changes and always version appropriately so you can lock into a specific version if need be.
### Pull Requests
The core team will be monitoring for pull requests. When we get one, we'll run some Facebook-specific integration tests on it first. From here, we'll need to get another person to sign off on the changes and then merge the pull request. For API changes we may need to fix internal uses, which could cause some delay. We'll do our best to provide updates and feedback throughout the process.
*Before* submitting a pull request, please make sure the following is done…
1. Fork the repo and create your branch from `master`.
2. If you've added code that should be tested, add tests!
3. If you've changed APIs, update the documentation.
4. Ensure the test suite passes (`grunt test`).
5. Make sure your code lints (`grunt lint`) - we've done our best to make sure these rules match our internal linting guidelines.
6. If you haven't already, complete the CLA.
### Contributor License Agreement ("CLA")
In order to accept your pull request, we need you to submit a CLA. You only need to do this once, so if you've done this for another Facebook open source project, you're good to go. If you are submitting a pull request for the first time, just let us know that you have completed the CLA and we can cross-check with your GitHub username.
[Complete your CLA here](https://code.facebook.com/cla)
## Bugs
### Where to Find Known Issues
We will be using GitHub Issues for our public bugs. We will keep a close eye on this and try to make it clear when we have an internal fix in progress. Before filing a new task, try to make sure your problem doesn't already exist.
### Reporting New Issues
The best way to get your bug fixed is to provide a reduced test case. jsFiddle, jsBin, and other sites provide a way to give live examples. Those are especially helpful though may not work for `JSX`-based code.
### Security Bugs
Facebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe disclosure of security bugs. With that in mind, please do not file public issues; go through the process outlined on that page.
## How to Get in Touch
* IRC - [#reactjs on freenode](https://webchat.freenode.net/?channels=reactjs)
* Discussion forum - [discuss.reactjs.org](https://discuss.reactjs.org/)
## Style Guide
### Code
* Use semicolons;
* Commas last,
* 2 spaces for indentation (no tabs)
* Prefer `'` over `"`
* `'use strict';`
* 80 character line length
* "Attractive"
* Do not use the optional parameters of `setTimeout` and `setInterval`
### Documentation
* Do not wrap lines at 80 characters
## License
By contributing to React, you agree that your contributions will be licensed under its BSD license.

296
Gruntfile.js Normal file
View File

@@ -0,0 +1,296 @@
'use strict';
var jsxTask = require('./grunt/tasks/jsx');
var browserifyTask = require('./grunt/tasks/browserify');
var populistTask = require('./grunt/tasks/populist');
var webdriverPhantomJSTask = require('./grunt/tasks/webdriver-phantomjs');
var webdriverJasmineTasks = require('./grunt/tasks/webdriver-jasmine');
var sauceTunnelTask = require('./grunt/tasks/sauce-tunnel');
var npmTask = require('./grunt/tasks/npm');
var releaseTasks = require('./grunt/tasks/release');
var npmReactTasks = require('./grunt/tasks/npm-react');
var npmReactToolsTasks = require('./grunt/tasks/npm-react-tools');
var versionCheckTask = require('./grunt/tasks/version-check');
var gemReactSourceTasks = require('./grunt/tasks/gem-react-source');
var eslintTask = require('./grunt/tasks/eslint');
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jsx: require('./grunt/config/jsx'),
browserify: require('./grunt/config/browserify'),
populist: require('./grunt/config/populist')(grunt),
connect: require('./grunt/config/server')(grunt),
'webdriver-jasmine': require('./grunt/config/webdriver-jasmine'),
'webdriver-perf': require('./grunt/config/webdriver-perf'),
npm: require('./grunt/config/npm'),
clean: [
'./build',
'./*.gem',
'./docs/_site',
'./examples/shared/*.js',
'.module-cache'
],
jshint: require('./grunt/config/jshint'),
/*eslint-disable camelcase */
compare_size: require('./grunt/config/compare_size')
/*eslint-enable camelcase */
});
grunt.config.set('compress', require('./grunt/config/compress'));
Object.keys(grunt.file.readJSON('package.json').devDependencies)
.filter(function(npmTaskName) {
return npmTaskName.indexOf('grunt-') === 0;
})
.filter(function(npmTaskName) {
return npmTaskName !== 'grunt-cli';
})
.forEach(function(npmTaskName) {
grunt.loadNpmTasks(npmTaskName);
});
grunt.registerTask('eslint', eslintTask);
grunt.registerTask('lint', ['eslint']);
grunt.registerTask(
'download-previous-version',
require('./grunt/tasks/download-previous-version.js')
);
grunt.registerTask('delete-build-modules', function() {
if (grunt.file.exists('build/modules')) {
grunt.file.delete('build/modules');
}
});
// Register jsx:normal and :release tasks.
grunt.registerMultiTask('jsx', jsxTask);
// Our own browserify-based tasks to build a single JS file build
grunt.registerMultiTask('browserify', browserifyTask);
grunt.registerMultiTask('populist', populistTask);
grunt.registerTask('sauce-tunnel', sauceTunnelTask);
grunt.registerMultiTask('webdriver-jasmine', webdriverJasmineTasks);
grunt.registerMultiTask('webdriver-perf', require('./grunt/tasks/webdriver-perf'));
grunt.registerMultiTask('npm', npmTask);
grunt.registerTask('npm-react:release', npmReactTasks.buildRelease);
grunt.registerTask('npm-react:pack', npmReactTasks.packRelease);
grunt.registerTask('npm-react-tools:release', npmReactToolsTasks.buildRelease);
grunt.registerTask('npm-react-tools:pack', npmReactToolsTasks.packRelease);
grunt.registerTask('gem-react-source:release', gemReactSourceTasks.buildRelease);
grunt.registerTask('gem-react-source:pack', gemReactSourceTasks.packRelease);
grunt.registerTask('version-check', versionCheckTask);
grunt.registerTask('build:basic', [
'jsx:normal',
'version-check',
'browserify:basic'
]);
grunt.registerTask('build:addons', [
'jsx:normal',
'browserify:addons'
]);
grunt.registerTask('build:transformer', [
'jsx:normal',
'browserify:transformer'
]);
grunt.registerTask('build:min', [
'jsx:normal',
'version-check',
'browserify:min'
]);
grunt.registerTask('build:addons-min', [
'jsx:normal',
'browserify:addonsMin'
]);
grunt.registerTask('build:withCodeCoverageLogging', [
'jsx:normal',
'version-check',
'browserify:withCodeCoverageLogging'
]);
grunt.registerTask('build:perf', [
'jsx:normal',
'version-check',
'browserify:transformer',
'browserify:basic',
'browserify:min',
'download-previous-version'
]);
grunt.registerTask('build:test', [
'delete-build-modules',
'jsx:test',
'version-check',
'populist:test'
]);
grunt.registerTask('build:npm-react', [
'version-check',
'jsx:normal',
'npm-react:release'
]);
grunt.registerTask('build:gem-react-source', [
'build',
'gem-react-source:release'
]);
grunt.registerTask('webdriver-phantomjs', webdriverPhantomJSTask);
grunt.registerTask('coverage:parse', require('./grunt/tasks/coverage-parse'));
grunt.registerTask('test:webdriver:phantomjs', [
'connect',
'webdriver-phantomjs',
'webdriver-jasmine:local'
]);
grunt.registerTask('perf:webdriver:phantomjs', [
'connect',
'webdriver-phantomjs',
'webdriver-perf:local'
]);
grunt.registerTask('test:full', [
'build:test',
'build:basic',
'connect',
'webdriver-phantomjs',
'webdriver-jasmine:local',
'sauce-tunnel',
'webdriver-jasmine:saucelabs_android',
'webdriver-jasmine:saucelabs_firefox',
'webdriver-jasmine:saucelabs_chrome'
]);
grunt.registerTask('perf:full', [
'build:perf',
'connect',
'webdriver-phantomjs',
'webdriver-perf:local',
'sauce-tunnel',
'webdriver-perf:saucelabs_firefox',
'webdriver-perf:saucelabs_chrome',
'webdriver-perf:saucelabs_ie11',
'webdriver-perf:saucelabs_ie8'
]);
grunt.registerTask('test:webdriver:saucelabs', [
'build:test',
'build:basic',
'connect',
'sauce-tunnel',
'webdriver-jasmine:saucelabs_' + (process.env.BROWSER_NAME || 'ie8')
]);
grunt.registerTask('test:webdriver:saucelabs:modern', [
'build:test',
'build:basic',
'connect',
'sauce-tunnel',
'webdriver-jasmine:saucelabs_android',
'webdriver-jasmine:saucelabs_firefox',
'webdriver-jasmine:saucelabs_chrome',
'webdriver-jasmine:saucelabs_ie11'
]);
grunt.registerTask('test:webdriver:saucelabs:ie', [
'build:test',
'build:basic',
'connect',
'sauce-tunnel',
'webdriver-jasmine:saucelabs_ie8',
'webdriver-jasmine:saucelabs_ie9',
'webdriver-jasmine:saucelabs_ie10',
'webdriver-jasmine:saucelabs_ie11'
]);
grunt.registerTask('test:webdriver:saucelabs:ios', [
'build:test',
'build:basic',
'connect',
'sauce-tunnel',
'webdriver-jasmine:saucelabs_ios6_1',
'webdriver-jasmine:saucelabs_ios5_1',
'webdriver-jasmine:saucelabs_ios4'
]);
grunt.registerTask('test:coverage', [
'build:test',
'build:withCodeCoverageLogging',
'test:webdriver:phantomjs',
'coverage:parse'
]);
grunt.registerTask('fasttest', function() {
if (grunt.option('debug')) {
grunt.task.run('build:test', 'connect:server:keepalive');
} else {
grunt.task.run('build:test', 'test:webdriver:phantomjs');
}
});
grunt.registerTask('test', function() {
if (grunt.option('debug')) {
grunt.task.run('build:test', 'build:basic', 'connect:server:keepalive');
} else {
grunt.task.run('build:test', 'build:basic', 'test:webdriver:phantomjs');
}
});
grunt.registerTask('perf', ['build:perf', 'perf:webdriver:phantomjs']);
grunt.registerTask('npm:test', ['build', 'npm:pack']);
// Optimized build task that does all of our builds. The subtasks will be run
// in order so we can take advantage of that and only run jsx:normal once.
grunt.registerTask('build', [
'delete-build-modules',
'jsx:normal',
'version-check',
'browserify:basic',
'browserify:transformer',
'browserify:addons',
'browserify:min',
'browserify:addonsMin',
'npm-react:release',
'npm-react:pack',
'npm-react-tools:release',
'npm-react-tools:pack',
'compare_size'
]);
// Automate the release!
grunt.registerTask('release:setup', releaseTasks.setup);
grunt.registerTask('release:bower', releaseTasks.bower);
grunt.registerTask('release:docs', releaseTasks.docs);
grunt.registerTask('release:msg', releaseTasks.msg);
grunt.registerTask('release:starter', releaseTasks.starter);
grunt.registerTask('release', [
'release:setup',
'clean',
'build',
'gem-react-source:release',
'gem-react-source:pack',
'release:bower',
'release:starter',
'compress',
'release:docs',
'release:msg'
]);
// The default task - build - to keep setup easy
grunt.registerTask('default', ['build']);
};

44
LICENSE
View File

@@ -1,21 +1,31 @@
MIT License
BSD License
Copyright (c) Facebook, Inc. and its affiliates.
For React software
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Copyright (c) 2013-2015, Facebook, Inc.
All rights reserved.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name Facebook nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

393
LICENSE-docs Normal file
View File

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

9
LICENSE-examples Normal file
View File

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

33
PATENTS Normal file
View File

@@ -0,0 +1,33 @@
Additional Grant of Patent Rights Version 2
"Software" means the React software distributed by Facebook, Inc.
Facebook, Inc. ("Facebook") hereby grants to each recipient of the Software
("you") a perpetual, worldwide, royalty-free, non-exclusive, irrevocable
(subject to the termination provision below) license under any Necessary
Claims, to make, have made, use, sell, offer to sell, import, and otherwise
transfer the Software. For avoidance of doubt, no license is granted under
Facebook's rights in any patent claims that are infringed by (i) modifications
to the Software made by you or any third party or (ii) the Software in
combination with any software or other technology.
The license granted hereunder will terminate, automatically and without notice,
if you (or any of your subsidiaries, corporate affiliates or agents) initiate
directly or indirectly, or take a direct financial interest in, any Patent
Assertion: (i) against Facebook or any of its subsidiaries or corporate
affiliates, (ii) against any party if such Patent Assertion arises in whole or
in part from any software, technology, product or service of Facebook or any of
its subsidiaries or corporate affiliates, or (iii) against any party relating
to the Software. Notwithstanding the foregoing, if Facebook or any of its
subsidiaries or corporate affiliates files a lawsuit alleging patent
infringement against you in the first instance, and you respond by filing a
patent infringement counterclaim in that lawsuit against that party that is
unrelated to the Software, the license granted hereunder will not terminate
under section (i) of this paragraph due to such counterclaim.
A "Necessary Claim" is a claim of a patent owned by Facebook that is
necessarily infringed by the Software standing alone.
A "Patent Assertion" is any lawsuit or other action alleging direct, indirect,
or contributory infringement or inducement to infringe any patent, including a
cross-claim or counterclaim.

130
README.md
View File

@@ -1,75 +1,107 @@
# [React](https://reactjs.org/) &middot; [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/facebook/react/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/react.svg?style=flat)](https://www.npmjs.com/package/react) [![CircleCI Status](https://circleci.com/gh/facebook/react.svg?style=shield&circle-token=:circle-token)](https://circleci.com/gh/facebook/react) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://reactjs.org/docs/how-to-contribute.html#your-first-pull-request)
# [React](https://facebook.github.io/react/) [![Build Status](https://travis-ci.org/facebook/react.svg?branch=0.13-stable)](https://travis-ci.org/facebook/react)
React is a JavaScript library for building user interfaces.
* **Declarative:** React makes it painless to create interactive UIs. Design simple views for each state in your application, and React will efficiently update and render just the right components when your data changes. Declarative views make your code more predictable, simpler to understand, and easier to debug.
* **Component-Based:** Build encapsulated components that manage their own state, then compose them to make complex UIs. Since component logic is written in JavaScript instead of templates, you can easily pass rich data through your app and keep state out of the DOM.
* **Learn Once, Write Anywhere:** We don't make assumptions about the rest of your technology stack, so you can develop new features in React without rewriting existing code. React can also render on the server using Node and power mobile apps using [React Native](https://reactnative.dev/).
* **Just the UI:** Lots of people use React as the V in MVC. Since React makes no assumptions about the rest of your technology stack, it's easy to try it out on a small feature in an existing project.
* **Virtual DOM:** React abstracts away the DOM from you, giving a simpler programming model and better performance. React can also render on the server using Node, and it can power native apps using [React Native](https://facebook.github.io/react-native/).
* **Data flow:** React implements one-way reactive data flow which reduces boilerplate and is easier to reason about than traditional data binding.
[Learn how to use React in your own project](https://reactjs.org/docs/getting-started.html).
**NEW**! Check out our newest project [React Native](https://github.com/facebook/react-native), which uses React and JavaScript to create native mobile apps.
## Installation
React has been designed for gradual adoption from the start, and **you can use as little or as much React as you need**:
* Use [Online Playgrounds](https://reactjs.org/docs/getting-started.html#online-playgrounds) to get a taste of React.
* [Add React to a Website](https://reactjs.org/docs/add-react-to-a-website.html) as a `<script>` tag in one minute.
* [Create a New React App](https://reactjs.org/docs/create-a-new-react-app.html) if you're looking for a powerful JavaScript toolchain.
You can use React as a `<script>` tag from a [CDN](https://reactjs.org/docs/cdn-links.html), or as a `react` package on [npm](https://www.npmjs.com/package/react).
## Documentation
You can find the React documentation [on the website](https://reactjs.org/docs).
Check out the [Getting Started](https://reactjs.org/docs/getting-started.html) page for a quick overview.
The documentation is divided into several sections:
* [Tutorial](https://reactjs.org/tutorial/tutorial.html)
* [Main Concepts](https://reactjs.org/docs/hello-world.html)
* [Advanced Guides](https://reactjs.org/docs/jsx-in-depth.html)
* [API Reference](https://reactjs.org/docs/react-api.html)
* [Where to Get Support](https://reactjs.org/community/support.html)
* [Contributing Guide](https://reactjs.org/docs/how-to-contribute.html)
You can improve it by sending pull requests to [this repository](https://github.com/reactjs/reactjs.org).
[Learn how to use React in your own project.](https://facebook.github.io/react/docs/getting-started.html).
## Examples
We have several examples [on the website](https://reactjs.org/). Here is the first one to get you started:
We have several examples [on the website](https://facebook.github.io/react/). Here is the first one to get you started:
```jsx
function HelloMessage({ name }) {
return <div>Hello {name}</div>;
}
```js
var HelloMessage = React.createClass({
render: function() {
return <div>Hello {this.props.name}</div>;
}
});
ReactDOM.render(
<HelloMessage name="Taylor" />,
React.render(
<HelloMessage name="John" />,
document.getElementById('container')
);
```
This example will render "Hello Taylor" into a container on the page.
This example will render "Hello John" into a container on the page.
You'll notice that we used an HTML-like syntax; [we call it JSX](https://reactjs.org/docs/introducing-jsx.html). JSX is not required to use React, but it makes code more readable, and writing it feels like writing HTML. If you're using React as a `<script>` tag, read [this section](https://reactjs.org/docs/add-react-to-a-website.html#optional-try-react-with-jsx) on integrating JSX; otherwise, the [recommended JavaScript toolchains](https://reactjs.org/docs/create-a-new-react-app.html) handle it automatically.
You'll notice that we used an HTML-like syntax; [we call it JSX](https://facebook.github.io/react/docs/jsx-in-depth.html). JSX is not required to use React, but it makes code more readable, and writing it feels like writing HTML. A simple transform is included with React that allows converting JSX into native JavaScript for browsers to digest.
## Contributing
## Installation
The main purpose of this repository is to continue to evolve React core, making it faster and easier to use. Development of React happens in the open on GitHub, and we are grateful to the community for contributing bugfixes and improvements. Read below to learn how you can take part in improving React.
The fastest way to get started is to serve JavaScript from the CDN (also available on [cdnjs](https://cdnjs.com/libraries/react) and [jsdelivr](http://www.jsdelivr.com/#!react)):
### [Code of Conduct](https://code.fb.com/codeofconduct)
```html
<!-- The core React library -->
<script src="https://fb.me/react-0.13.3.js"></script>
<!-- In-browser JSX transformer, remove when pre-compiling JSX. -->
<script src="https://fb.me/JSXTransformer-0.13.3.js"></script>
```
Facebook has adopted a Code of Conduct that we expect project participants to adhere to. Please read [the full text](https://code.fb.com/codeofconduct) so that you can understand what actions will and will not be tolerated.
We've also built a [starter kit](https://facebook.github.io/react/downloads/react-0.13.3.zip) which might be useful if this is your first time using React. It includes a webpage with an example of using React with live code.
### [Contributing Guide](https://reactjs.org/contributing/how-to-contribute.html)
If you'd like to use [bower](http://bower.io), it's as easy as:
Read our [contributing guide](https://reactjs.org/contributing/how-to-contribute.html) to learn about our development process, how to propose bugfixes and improvements, and how to build and test your changes to React.
```sh
bower install --save react
```
### Good First Issues
## Contribute
To help you get your feet wet and get you familiar with our contribution process, we have a list of [good first issues](https://github.com/facebook/react/labels/good%20first%20issue) that contain bugs which have a relatively limited scope. This is a great place to get started.
The main purpose of this repository is to continue to evolve React core, making it faster and easier to use. If you're interested in helping with that, then keep reading. If you're not interested in helping right now that's ok too. :) Any feedback you have about using React would be greatly appreciated.
### Building Your Copy of React
The process to build `react.js` is built entirely on top of node.js, using many libraries you may already be familiar with.
#### Prerequisites
* You have `node` installed at v0.10.0+ (it might work at lower versions, we just haven't tested).
* You are familiar with `npm` and know whether or not you need to use `sudo` when installing packages globally.
* You are familiar with `git`.
#### Build
Once you have the repository cloned, building a copy of `react.js` is really easy.
```sh
# grunt-cli is needed by grunt; you might have this installed already
npm install -g grunt-cli
npm install
grunt build
```
At this point, you should now have a `build/` directory populated with everything you need to use React. The examples should all work.
### Grunt
We use grunt to automate many tasks. Run `grunt -h` to see a mostly complete listing. The important ones to know:
```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 ESLint
grunt lint
# Wipe out build directory
grunt clean
```
### License
React is [MIT licensed](./LICENSE).
React is [BSD licensed](./LICENSE). We also provide an additional [patent grant](./PATENTS).
React documentation is [Creative Commons licensed](./LICENSE-docs).
Examples provided in this repository and in the documentation are [separately licensed](./LICENSE-examples).
### More…
There's only so much we can cram in here. To read more about the community and guidelines for submitting pull requests, please read the [Contributing document](CONTRIBUTING.md).

View File

@@ -1,7 +0,0 @@
# Reporting Security Issues
If you believe you have found a security vulnerability in React, we encourage you to let us know right away. We will investigate all legitimate reports and do our best to quickly fix the problem.
Please refer to the following page for our responsible disclosure policy, reward guidelines, and those things that should not be reported:
https://www.facebook.com/whitehat

View File

@@ -1,41 +0,0 @@
image: Visual Studio 2017
# Fix line endings in Windows. (runs before repo cloning)
init:
- git config --global core.autocrlf input
environment:
JAVA_HOME: C:\Program Files\Java\jdk1.8.0
matrix:
- nodejs_version: 10
# Finish on first failed build
matrix:
fast_finish: true
platform:
- x64
branches:
only:
- master
# Disable Visual Studio build and deploy
build: off
deploy: off
install:
- ps: Install-Product node $env:nodejs_version $env:platform
- yarn install --frozen-lockfile
test_script:
- node --version
- yarn lint
# - yarn flow-ci
- yarn build
- yarn test
- yarn prettier
cache:
- node_modules
- "%LOCALAPPDATA%/Yarn"

View File

@@ -1,27 +0,0 @@
'use strict';
module.exports = {
plugins: [
'@babel/plugin-syntax-jsx',
'@babel/plugin-transform-react-jsx',
'@babel/plugin-transform-flow-strip-types',
['@babel/plugin-proposal-class-properties', {loose: true}],
'syntax-trailing-function-commas',
[
'@babel/plugin-proposal-object-rest-spread',
{loose: true, useBuiltIns: true},
],
['@babel/plugin-transform-template-literals', {loose: true}],
'@babel/plugin-transform-literals',
'@babel/plugin-transform-arrow-functions',
'@babel/plugin-transform-block-scoped-functions',
'@babel/plugin-transform-object-super',
'@babel/plugin-transform-shorthand-properties',
'@babel/plugin-transform-computed-properties',
'@babel/plugin-transform-for-of',
['@babel/plugin-transform-spread', {loose: true, useBuiltIns: true}],
'@babel/plugin-transform-parameters',
['@babel/plugin-transform-destructuring', {loose: true, useBuiltIns: true}],
['@babel/plugin-transform-block-scoping', {throwIfClosureRequired: true}],
],
};

51
bin/jsx Executable file
View File

@@ -0,0 +1,51 @@
#!/usr/bin/env node
// -*- mode: js -*-
'use strict';
var transform = require('../main').transform;
require('commoner').version(
require('../package.json').version
).resolve(function(id) {
return this.readModuleP(id);
}).option(
'--harmony',
'Turns on JS transformations such as ES6 Classes etc.'
).option(
'--target [version]',
'Specify your target version of ECMAScript. Valid values are "es3" and ' +
'"es5". The default is "es5". "es3" will avoid uses of defineProperty and ' +
'will quote reserved words. WARNING: "es5" is not properly supported, even ' +
'with the use of es5shim, es5sham. If you need to support IE8, use "es3".',
'es5'
).option(
'--strip-types',
'Strips out type annotations.'
).option(
'--es6module',
'Parses the file as a valid ES6 module. ' +
'(Note that this means implicit strict mode)'
).option(
'--non-strict-es6module',
'Parses the file as an ES6 module, except disables implicit strict-mode. ' +
'(This is useful if you\'re porting non-ES6 modules to ES6, but haven\'t ' +
'yet verified that they are strict-mode safe yet)'
).option(
'--source-map-inline',
'Embed inline sourcemap in transformed source'
).process(function(id, source) {
// This is where JSX, ES6, etc. desugaring happens.
// We don't do any pre-processing of options so that the command line and the
// JS API both expose the same set of options. We do extract the options that
// we care about from commoner though so we aren't passing too many things
// along.
var options = {
harmony: this.options.harmony,
sourceMap: this.options.sourceMapInline,
stripTypes: this.options.stripTypes,
es6module: this.options.es6module,
nonStrictEs6module: this.options.nonStrictEs6module,
target: this.options.target
};
return transform(source, options);
});

57
bin/jsx-internal Executable file
View File

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

View File

@@ -1,295 +0,0 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';
// Hi, if this is your first time editing/reading a Dangerfile, here's a summary:
// It's a JS runtime which helps you provide continuous feedback inside GitHub.
//
// You can see the docs here: http://danger.systems/js/
//
// If you want to test changes Danger, I'd recommend checking out an existing PR
// and then running the `danger pr` command.
//
// You'll need a GitHub token, you can re-use this one:
//
// 0a7d5c3cad9a6dbec2d9 9a5222cf49062a4c1ef7
//
// (Just remove the space)
//
// So, for example:
//
// `DANGER_GITHUB_API_TOKEN=[ENV_ABOVE] yarn danger pr https://github.com/facebook/react/pull/11865
const {markdown, danger, warn} = require('danger');
const fetch = require('node-fetch');
const {generateResultsArray} = require('./scripts/rollup/stats');
const {existsSync, readFileSync} = require('fs');
const {exec} = require('child_process');
// This must match the name of the CI job that creates the build artifacts
const RELEASE_CHANNEL =
process.env.RELEASE_CHANNEL === 'experimental' ? 'experimental' : 'stable';
const artifactsJobName =
process.env.RELEASE_CHANNEL === 'experimental'
? 'process_artifacts_experimental'
: 'process_artifacts';
if (!existsSync('./build/bundle-sizes.json')) {
// This indicates the build failed previously.
// In that case, there's nothing for the Dangerfile to do.
// Exit early to avoid leaving a redundant (and potentially confusing) PR comment.
warn(
'No bundle size information found. This indicates the build ' +
'job failed.'
);
process.exit(0);
}
const currentBuildResults = JSON.parse(
readFileSync('./build/bundle-sizes.json')
);
/**
* Generates a Markdown table
* @param {string[]} headers
* @param {string[][]} body
*/
function generateMDTable(headers, body) {
const tableHeaders = [
headers.join(' | '),
headers.map(() => ' --- ').join(' | '),
];
const tablebody = body.map(r => r.join(' | '));
return tableHeaders.join('\n') + '\n' + tablebody.join('\n');
}
/**
* Generates a user-readable string from a percentage change
* @param {number} change
* @param {boolean} includeEmoji
*/
function addPercent(change, includeEmoji) {
if (!isFinite(change)) {
// When a new package is created
return 'n/a';
}
const formatted = (change * 100).toFixed(1);
if (/^-|^0(?:\.0+)$/.test(formatted)) {
return `${formatted}%`;
} else {
if (includeEmoji) {
return `:small_red_triangle:+${formatted}%`;
} else {
return `+${formatted}%`;
}
}
}
function setBoldness(row, isBold) {
if (isBold) {
return row.map(element => `**${element}**`);
} else {
return row;
}
}
/**
* Gets the commit that represents the merge between the current branch
* and master.
*/
function git(args) {
return new Promise(res => {
exec('git ' + args, (err, stdout, stderr) => {
if (err) {
throw err;
} else {
res(stdout.trim());
}
});
});
}
(async function() {
// Use git locally to grab the commit which represents the place
// where the branches differ
const upstreamRepo = danger.github.pr.base.repo.full_name;
if (upstreamRepo !== 'facebook/react') {
// Exit unless we're running in the main repo
return;
}
markdown(`## Size changes (${RELEASE_CHANNEL})`);
const upstreamRef = danger.github.pr.base.ref;
await git(`remote add upstream https://github.com/facebook/react.git`);
await git('fetch upstream');
const baseCommit = await git(`merge-base HEAD upstream/${upstreamRef}`);
let previousBuildResults = null;
try {
let baseCIBuildId = null;
const statusesResponse = await fetch(
`https://api.github.com/repos/facebook/react/commits/${baseCommit}/status`
);
const {statuses, state} = await statusesResponse.json();
if (state === 'failure') {
warn(`Base commit is broken: ${baseCommit}`);
return;
}
for (let i = 0; i < statuses.length; i++) {
const status = statuses[i];
if (status.context === `ci/circleci: ${artifactsJobName}`) {
if (status.state === 'success') {
baseCIBuildId = /\/facebook\/react\/([0-9]+)/.exec(
status.target_url
)[1];
break;
}
if (status.state === 'pending') {
warn(`Build job for base commit is still pending: ${baseCommit}`);
return;
}
}
}
if (baseCIBuildId === null) {
warn(`Could not find build artifacts for base commit: ${baseCommit}`);
return;
}
const baseArtifactsInfoResponse = await fetch(
`https://circleci.com/api/v1.1/project/github/facebook/react/${baseCIBuildId}/artifacts`
);
const baseArtifactsInfo = await baseArtifactsInfoResponse.json();
for (let i = 0; i < baseArtifactsInfo.length; i++) {
const info = baseArtifactsInfo[i];
if (info.path.endsWith('bundle-sizes.json')) {
const resultsResponse = await fetch(info.url);
previousBuildResults = await resultsResponse.json();
break;
}
}
} catch (error) {
warn(`Failed to fetch build artifacts for base commit: ${baseCommit}`);
return;
}
if (previousBuildResults === null) {
warn(`Could not find build artifacts for base commit: ${baseCommit}`);
return;
}
// Take the JSON of the build response and
// make an array comparing the results for printing
const results = generateResultsArray(
currentBuildResults,
previousBuildResults
);
const packagesToShow = results
.filter(
r =>
Math.abs(r.prevFileSizeAbsoluteChange) >= 300 || // bytes
Math.abs(r.prevGzipSizeAbsoluteChange) >= 100 // bytes
)
.map(r => r.packageName);
if (packagesToShow.length) {
let allTables = [];
// Highlight React and React DOM changes inline
// e.g. react: `react.production.min.js`: -3%, `react.development.js`: +4%
if (packagesToShow.includes('react')) {
const reactProd = results.find(
r => r.bundleType === 'UMD_PROD' && r.packageName === 'react'
);
if (
reactProd.prevFileSizeChange !== 0 ||
reactProd.prevGzipSizeChange !== 0
) {
const changeSize = addPercent(reactProd.prevFileSizeChange, true);
const changeGzip = addPercent(reactProd.prevGzipSizeChange, true);
markdown(`React: size: ${changeSize}, gzip: ${changeGzip}`);
}
}
if (packagesToShow.includes('react-dom')) {
const reactDOMProd = results.find(
r => r.bundleType === 'UMD_PROD' && r.packageName === 'react-dom'
);
if (
reactDOMProd.prevFileSizeChange !== 0 ||
reactDOMProd.prevGzipSizeChange !== 0
) {
const changeSize = addPercent(reactDOMProd.prevFileSizeChange, true);
const changeGzip = addPercent(reactDOMProd.prevGzipSizeChange, true);
markdown(`ReactDOM: size: ${changeSize}, gzip: ${changeGzip}`);
}
}
// Show a hidden summary table for all diffs
// eslint-disable-next-line no-var,no-for-of-loops/no-for-of-loops
for (var name of new Set(packagesToShow)) {
const thisBundleResults = results.filter(r => r.packageName === name);
const changedFiles = thisBundleResults.filter(
r => r.prevFileSizeChange !== 0 || r.prevGzipSizeChange !== 0
);
const mdHeaders = [
'File',
'Filesize Diff',
'Gzip Diff',
'Prev Size',
'Current Size',
'Prev Gzip',
'Current Gzip',
'ENV',
];
const mdRows = changedFiles.map(r => {
const isProd = r.bundleType.includes('PROD');
return setBoldness(
[
r.filename,
addPercent(r.prevFileSizeChange, isProd),
addPercent(r.prevGzipSizeChange, isProd),
r.prevSize,
r.prevFileSize,
r.prevGzip,
r.prevGzipSize,
r.bundleType,
],
isProd
);
});
allTables.push(`\n## ${name}`);
allTables.push(generateMDTable(mdHeaders, mdRows));
}
const summary = `
<details>
<summary>Details of bundled changes.</summary>
<p>Comparing: ${baseCommit}...${danger.github.pr.head.sha}</p>
${allTables.join('\n')}
</details>
`;
markdown(summary);
} else {
markdown('No significant bundle size changes to report.');
}
})();

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.

19
docs/Gemfile Normal file
View File

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

85
docs/Gemfile.lock Normal file
View File

@@ -0,0 +1,85 @@
GEM
remote: https://rubygems.org/
specs:
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)
execjs (2.2.1)
fast-stemmer (1.0.2)
ffi (1.9.3)
jekyll (2.2.0)
classifier (~> 1.3)
colorator (~> 0.1)
jekyll-coffeescript (~> 1.0)
jekyll-gist (~> 1.0)
jekyll-paginate (~> 1.0)
jekyll-sass-converter (~> 1.0)
jekyll-watch (~> 1.0)
kramdown (~> 1.3)
liquid (~> 2.6.1)
mercenary (~> 0.3.3)
pygments.rb (~> 0.6.0)
redcarpet (~> 3.1)
safe_yaml (~> 1.0)
toml (~> 0.1.0)
jekyll-coffeescript (1.0.0)
coffee-script (~> 2.2)
jekyll-gist (1.1.0)
jekyll-paginate (1.0.0)
jekyll-redirect-from (0.5.0)
jekyll (~> 2.0)
jekyll-sass-converter (1.2.0)
sass (~> 3.2)
jekyll-watch (1.1.0)
listen (~> 2.7)
json (1.8.1)
kramdown (1.4.1)
liquid (2.6.1)
listen (2.7.9)
celluloid (>= 0.15.2)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
mercenary (0.3.4)
mini_portile (0.6.0)
nokogiri (1.6.3.1)
mini_portile (= 0.6.0)
parslet (1.5.0)
blankslate (~> 2.0)
posix-spawn (0.3.9)
pygments.rb (0.6.0)
posix-spawn (~> 0.3.6)
yajl-ruby (~> 1.1.0)
rake (10.3.2)
rb-fsevent (0.9.4)
rb-inotify (0.9.5)
ffi (>= 0.5.0)
redcarpet (3.1.2)
safe_yaml (1.0.4)
sanitize (2.0.6)
nokogiri (>= 1.4.4)
sass (3.3.14)
timers (1.1.0)
toml (0.1.1)
parslet (~> 1.5.0)
yajl-ruby (1.1.0)
PLATFORMS
ruby
DEPENDENCIES
jekyll (~> 2.0)
jekyll-redirect-from
json
rake
rb-fsevent
sanitize (~> 2.0)
BUNDLED WITH
1.10.1

67
docs/README.md Normal file
View File

@@ -0,0 +1,67 @@
# React Documentation & Website
We use [Jekyll](http://jekyllrb.com/) to build the site using ([mostly](http://zpao.com/posts/adding-line-highlights-to-markdown-code-fences/)) Markdown, and we host it by pushing HTML to [GitHub Pages](http://pages.github.com/).
## Installation
If you are working on the site, you will want to install and run a local copy of it.
### Dependencies
In order to use Jekyll, you will need to have Ruby installed.
- [Ruby](http://www.ruby-lang.org/) (version >= 1.8.7)
- [RubyGems](http://rubygems.org/) (version >= 1.3.7)
- [Bundler](http://gembundler.com/)
Mac OS X comes pre-installed with Ruby, but you may need to update RubyGems (via `gem update --system`).
Otherwise, [RVM](https://rvm.io/) and [rbenv](https://github.com/sstephenson/rbenv) are popular ways to install Ruby.
Once you have RubyGems and installed Bundler (via `gem install bundler`), use it to install the dependencies:
```sh
$ cd react/docs
$ bundle install # Might need sudo.
$ npm install # Might need sudo.
```
### Instructions
The site requires React, so first make sure you've built the project (via `grunt`).
Use Jekyll to serve the website locally (by default, at `http://localhost:4000`):
```sh
$ cd react/docs
$ bundle exec rake
$ bundle exec jekyll serve -w
$ open http://localhost:4000/react/
```
We use [SASS](http://sass-lang.com/) (with [Bourbon](http://bourbon.io/)) for our CSS, and we use JSX to transform some of our JS.
If you only want to modify the HTML or Markdown, you do not have to do anything because we package pre-compiled copies of the CSS and JS.
If you want to modify the CSS or JS, use [Rake](http://rake.rubyforge.org/) to compile them:
```sh
$ cd react/docs
$ bundle exec rake watch # Automatically compiles as needed.
# bundle exec rake Manually compile CSS and JS.
# bundle exec rake js Manually compile JS, only.
```
## Afterthoughts
### Updating `facebook.github.io/react`
The easiest way to do this is to have a separate clone of this repository, checked out to the `gh-pages` branch. We have a build step that expects this to be in a directory named `react-gh-pages` at the same depth as `react`. Then it's just a matter of running `grunt docs`, which will compile the site and copy it out to this repository. From there, you can check it in.
**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
In an ideal world, we would not be adding a Ruby dependency on part of our project. We would like to move towards a point where we are using React to render the website.

42
docs/Rakefile Normal file
View File

@@ -0,0 +1,42 @@
require('rubygems')
require('json')
require('yaml')
desc "generate js from jsx"
task :js do
system "cp ../node_modules/babel/node_modules/babel-core/browser.min.js ./js/babel-browser.min.js"
system "../node_modules/.bin/babel _js --out-dir=js"
end
desc "watch js"
task :watch do
Process.spawn "../bin/jsx --watch --harmony _js js"
Process.waitall
end
desc "update version to match ../package.json"
task :update_version do
react_version = JSON.parse(File.read('../package.json'))['version']
site_config = YAML.load_file('_config.yml')
if site_config['react_version'] != react_version
site_config['react_version'] = react_version
File.open('_config.yml', 'w+') { |f| f.write(site_config.to_yaml) }
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 => [:js]

39
docs/_config.yml Normal file
View File

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

173
docs/_css/_solarized.scss Normal file
View File

@@ -0,0 +1,173 @@
html * {
color-profile: sRGB;
rendering-intent: auto;
}
.cm-s-solarized-light {
background-color: #f8f5ec;
color: #637c84;
}
.cm-s-solarized-light .emphasis {
font-weight: bold;
}
.cm-s-solarized-light .dotted {
border-bottom: 1px dotted #cb4b16;
}
.cm-s-solarized-light .CodeMirror-gutter {
background-color: #eee8d5;
border-right: 3px solid #eee8d5;
}
.cm-s-solarized-light .CodeMirror-gutter .CodeMirror-gutter-text {
color: #93a1a1;
}
.cm-s-solarized-light .CodeMirror-cursor {
border-left-color: #002b36 !important;
}
.cm-s-solarized-light .CodeMirror-matchingbracket {
color: #002b36;
background-color: #eee8d5;
box-shadow: 0 0 10px #eee8d5;
font-weight: bold;
}
.cm-s-solarized-light .CodeMirror-nonmatchingbracket {
color: #002b36;
background-color: #eee8d5;
box-shadow: 0 0 10px #eee8d5;
font-weight: bold;
color: #dc322f;
border-bottom: 1px dotted #cb4b16;
}
.cm-s-solarized-light span.cm-keyword {
color: #268bd2;
}
.cm-s-solarized-light span.cm-atom {
color: #2aa198;
}
.cm-s-solarized-light span.cm-number {
color: #586e75;
}
.cm-s-solarized-light span.cm-def {
color: #637c84;
}
.cm-s-solarized-light span.cm-variable {
color: #637c84;
}
.cm-s-solarized-light span.cm-variable-2 {
color: #b58900;
}
.cm-s-solarized-light span.cm-variable-3 {
color: #cb4b16;
}
.cm-s-solarized-light span.cm-comment {
color: #93a1a1;
}
.cm-s-solarized-light span.cm-property {
color: #637c84;
}
.cm-s-solarized-light span.cm-operator {
color: #657b83;
}
.cm-s-solarized-light span.cm-string {
color: #36958e;
}
.cm-s-solarized-light span.cm-error {
font-weight: bold;
border-bottom: 1px dotted #cb4b16;
}
.cm-s-solarized-light span.cm-bracket {
color: #cb4b16;
}
.cm-s-solarized-light span.cm-tag {
color: #657b83;
}
.cm-s-solarized-light span.cm-attribute {
color: #586e75;
font-weight: bold;
}
.cm-s-solarized-light span.cm-meta {
color: #268bd2;
}
.cm-s-solarized-dark {
background-color: #002b36;
color: #839496;
}
.cm-s-solarized-dark .emphasis {
font-weight: bold;
}
.cm-s-solarized-dark .dotted {
border-bottom: 1px dotted #cb4b16;
}
.cm-s-solarized-dark .CodeMirror-gutter {
background-color: #073642;
border-right: 3px solid #073642;
}
.cm-s-solarized-dark .CodeMirror-gutter .CodeMirror-gutter-text {
color: #586e75;
}
.cm-s-solarized-dark .CodeMirror-cursor {
border-left-color: #fdf6e3 !important;
}
.cm-s-solarized-dark .CodeMirror-matchingbracket {
color: #fdf6e3;
background-color: #073642;
box-shadow: 0 0 10px #073642;
font-weight: bold;
}
.cm-s-solarized-dark .CodeMirror-nonmatchingbracket {
color: #fdf6e3;
background-color: #073642;
box-shadow: 0 0 10px #073642;
font-weight: bold;
color: #dc322f;
border-bottom: 1px dotted #cb4b16;
}
.cm-s-solarized-dark span.cm-keyword {
color: #839496;
font-weight: bold;
}
.cm-s-solarized-dark span.cm-atom {
color: #2aa198;
}
.cm-s-solarized-dark span.cm-number {
color: #93a1a1;
}
.cm-s-solarized-dark span.cm-def {
color: #268bd2;
}
.cm-s-solarized-dark span.cm-variable {
color: #cb4b16;
}
.cm-s-solarized-dark span.cm-variable-2 {
color: #cb4b16;
}
.cm-s-solarized-dark span.cm-variable-3 {
color: #cb4b16;
}
.cm-s-solarized-dark span.cm-comment {
color: #586e75;
}
.cm-s-solarized-dark span.cm-property {
color: #b58900;
}
.cm-s-solarized-dark span.cm-operator {
color: #839496;
}
.cm-s-solarized-dark span.cm-string {
color: #6c71c4;
}
.cm-s-solarized-dark span.cm-error {
font-weight: bold;
border-bottom: 1px dotted #cb4b16;
}
.cm-s-solarized-dark span.cm-bracket {
color: #cb4b16;
}
.cm-s-solarized-dark span.cm-tag {
color: #839496;
}
.cm-s-solarized-dark span.cm-attribute {
color: #93a1a1;
font-weight: bold;
}
.cm-s-solarized-dark span.cm-meta {
color: #268bd2;
}

133
docs/_css/_typography.scss Normal file
View File

@@ -0,0 +1,133 @@
@import 'variables.scss';
$textColor: $mediumColor;
$textColorLight: lighten($textColor, 20%);
html {
font-family: $helvetica;
font-family: proxima-nova, $helvetica;
color: $textColor;
line-height: 1.28;
}
p {
margin: 0 0 10px;
}
.subHeader {
font-size: 21px;
font-weight: 200;
line-height: 30px;
margin-bottom: 10px;
}
em {
font-style: italic;
}
h1,
h2,
h3,
h4,
h5,
h6 {
margin: 10px 0;
font-family: inherit;
font-weight: bold;
line-height: 20px;
color: inherit;
text-rendering: optimizelegibility;
}
h1 small,
h2 small,
h3 small,
h4 small,
h5 small,
h6 small {
font-weight: normal;
color: $textColorLight
}
h1,
h2,
h3 {
line-height: 40px;
}
h1 {
font-size: 39px;
}
h2 {
font-size: 31px;
}
h3 {
font-size: 23px;
}
h4 {
font-size: 16px;
}
h5 {
font-size: 14px;
}
h6 {
font-size: 11px;
}
h1 small {
font-size: 24px;
}
h2 small {
font-size: 18px;
}
h3 small {
font-size: 16px;
}
h4 small {
font-size: 14px;
}
ul,
ol {
margin: 0 0 10px 25px;
padding: 0;
}
ul ul,
ul ol,
ol ol,
ol ul {
margin-bottom: 0;
}
li {
line-height: 20px;
}
a {
color: $linkColor;
text-decoration: none;
&:hover,
&:focus {
color: $linkInteract;
text-decoration: underline;
}
&:focus {
outline: thin dotted #333;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
}
.center {
text-align: center;
}

22
docs/_css/_variables.scss Normal file
View File

@@ -0,0 +1,22 @@
$primary: #cc7a6f;
$linkColor: darken($primary, 9%);
$linkInteract: darken($linkColor, 9%);
$pageBg: #f9f9f9;
$lightColor: #e9e9e9;
$mediumestColor: #666;
$mediumColor: #484848;
$darkColor: #2d2d2d;
$darkestColor: #222222;
$blueColor: #61dafb;
$orangeColor: complement($blueColor);
$lightTextColor: #fafafa;
$mediumTextColor: #aaa;
$darkTextColor: $mediumColor;
$buttonBlueTop: #77a3d2;
$buttonBlueBottom: #4783c2;
$buttonGreyTop: #9a9a9a;
$buttonGreyBottom: #646464;

View File

@@ -0,0 +1,8 @@
//************************************************************************//
// These mixins/functions are deprecated
// They 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";
}

79
docs/_css/bourbon/_bourbon.scss vendored Normal file
View File

@@ -0,0 +1,79 @@
// Settings
@import "settings/prefixer";
@import "settings/px-to-em";
@import "settings/asset-pipeline";
// Custom Helpers
@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/assign";
@import "functions/color-lightness";
@import "functions/flex-grid";
@import "functions/golden-ratio";
@import "functions/grid-width";
@import "functions/modular-scale";
@import "functions/px-to-em";
@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";
@import "css3/appearance";
@import "css3/backface-visibility";
@import "css3/background";
@import "css3/background-image";
@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/keyframes";
@import "css3/linear-gradient";
@import "css3/perspective";
@import "css3/radial-gradient";
@import "css3/transform";
@import "css3/transition";
@import "css3/user-select";
@import "css3/placeholder";
// 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";
@import "addons/position";
@import "addons/prefixer";
@import "addons/retina-image";
@import "addons/size";
@import "addons/timing-functions";
@import "addons/triangle";
@import "addons/word-wrap";
// Soon to be deprecated Mixins
@import "bourbon-deprecated-upcoming";

374
docs/_css/bourbon/addons/_button.scss vendored Normal file
View File

@@ -0,0 +1,374 @@
@mixin button ($style: simple, $base-color: #4294f0, $text-size: inherit, $padding: 7px 18px) {
@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);
}
@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;
}
@include buttonstyle($style, $base-color, $text-size, $padding);
}
@if type-of($style) == number {
$padding: $base-color;
$text-size: $style;
$base-color: #4294f0;
$style: simple;
@if $padding == #4294f0 {
$padding: 7px 18px;
}
@include buttonstyle($style, $base-color, $text-size, $padding);
}
&:disabled {
opacity: 0.5;
cursor: not-allowed;
}
}
// 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, $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 is-light($base-color) {
$color: hsl(0, 0, 20%);
$text-shadow: adjust-color($base-color, $saturation: 10%, $lightness: 4%);
}
@if $grayscale == true {
$border: grayscale($border);
$inset-shadow: grayscale($inset-shadow);
$stop-gradient: grayscale($stop-gradient);
$text-shadow: grayscale($text-shadow);
}
border: 1px solid $border;
border-radius: 3px;
box-shadow: inset 0 1px 0 0 $inset-shadow;
color: $color;
display: inline-block;
font-size: $textsize;
font-weight: bold;
@include linear-gradient ($base-color, $stop-gradient);
padding: $padding;
text-decoration: none;
text-shadow: 0 1px 0 $text-shadow;
background-clip: padding-box;
&:hover:not(:disabled) {
$base-color-hover: adjust-color($base-color, $saturation: -4%, $lightness: -5%);
$inset-shadow-hover: adjust-color($base-color, $saturation: -7%, $lightness: 5%);
$stop-gradient-hover: adjust-color($base-color, $saturation: 8%, $lightness: -14%);
@if $grayscale == true {
$base-color-hover: grayscale($base-color-hover);
$inset-shadow-hover: grayscale($inset-shadow-hover);
$stop-gradient-hover: grayscale($stop-gradient-hover);
}
box-shadow: inset 0 1px 0 0 $inset-shadow-hover;
cursor: pointer;
@include linear-gradient ($base-color-hover, $stop-gradient-hover);
}
&: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%);
@if $grayscale == true {
$border-active: grayscale($border-active);
$inset-shadow-active: grayscale($inset-shadow-active);
}
border: 1px solid $border-active;
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, $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);
$fourth-stop: adjust-color($base-color, $red: -79, $green: -70, $blue: -46);
$inset-shadow: adjust-color($base-color, $red: 37, $green: 29, $blue: 12);
$second-stop: adjust-color($base-color, $red: -56, $green: -50, $blue: -33);
$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 is-light($base-color) {
$color: hsl(0, 0, 20%);
$text-shadow: adjust-color($base-color, $saturation: 10%, $lightness: 4%);
}
@if $grayscale == true {
$border: grayscale($border);
$border-bottom: grayscale($border-bottom);
$fourth-stop: grayscale($fourth-stop);
$inset-shadow: grayscale($inset-shadow);
$second-stop: grayscale($second-stop);
$text-shadow: grayscale($text-shadow);
$third-stop: grayscale($third-stop);
}
border: 1px solid $border;
border-bottom: 1px solid $border-bottom;
border-radius: 5px;
box-shadow: inset 0 1px 0 0 $inset-shadow;
color: $color;
display: inline-block;
font-size: $textsize;
font-weight: bold;
@include linear-gradient(top, $base-color 0%, $second-stop 50%, $third-stop 50%, $fourth-stop 100%);
padding: $padding;
text-align: center;
text-decoration: none;
text-shadow: 0 -1px 1px $text-shadow;
&:hover:not(:disabled) {
$first-stop-hover: adjust-color($base-color, $red: -13, $green: -15, $blue: -18);
$second-stop-hover: adjust-color($base-color, $red: -66, $green: -62, $blue: -51);
$third-stop-hover: adjust-color($base-color, $red: -93, $green: -85, $blue: -66);
$fourth-stop-hover: adjust-color($base-color, $red: -86, $green: -80, $blue: -63);
@if $grayscale == true {
$first-stop-hover: grayscale($first-stop-hover);
$second-stop-hover: grayscale($second-stop-hover);
$third-stop-hover: grayscale($third-stop-hover);
$fourth-stop-hover: grayscale($fourth-stop-hover);
}
cursor: pointer;
@include linear-gradient(top, $first-stop-hover 0%,
$second-stop-hover 50%,
$third-stop-hover 50%,
$fourth-stop-hover 100%);
}
&: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;
}
}
// Pill Button
//************************************************************************//
@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%);
$border-top: adjust-color($base-color, $hue: -1, $saturation: -30%, $lightness: -15%);
$inset-shadow: adjust-color($base-color, $hue: -1, $saturation: -1%, $lightness: 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 is-light($base-color) {
$color: hsl(0, 0, 20%);
$text-shadow: adjust-color($base-color, $saturation: 10%, $lightness: 4%);
}
@if $grayscale == true {
$border-bottom: grayscale($border-bottom);
$border-sides: grayscale($border-sides);
$border-top: grayscale($border-top);
$inset-shadow: grayscale($inset-shadow);
$stop-gradient: grayscale($stop-gradient);
$text-shadow: grayscale($text-shadow);
}
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;
color: $color;
display: inline-block;
font-size: $textsize;
font-weight: normal;
line-height: 1;
@include linear-gradient ($base-color, $stop-gradient);
padding: $padding;
text-align: center;
text-decoration: none;
text-shadow: 0 -1px 1px $text-shadow;
background-clip: padding-box;
&:hover:not(:disabled) {
$base-color-hover: adjust-color($base-color, $lightness: -4.5%);
$border-bottom: adjust-color($base-color, $hue: 8, $saturation: 13.5%, $lightness: -32%);
$border-sides: adjust-color($base-color, $hue: 4, $saturation: -2%, $lightness: -27%);
$border-top: adjust-color($base-color, $hue: -1, $saturation: -17%, $lightness: -21%);
$inset-shadow-hover: adjust-color($base-color, $saturation: -1%, $lightness: 3%);
$stop-gradient-hover: adjust-color($base-color, $hue: 8, $saturation: -4%, $lightness: -15.5%);
$text-shadow-hover: adjust-color($base-color, $hue: 5, $saturation: -5%, $lightness: -22%);
@if $grayscale == true {
$base-color-hover: grayscale($base-color-hover);
$border-bottom: grayscale($border-bottom);
$border-sides: grayscale($border-sides);
$border-top: grayscale($border-top);
$inset-shadow-hover: grayscale($inset-shadow-hover);
$stop-gradient-hover: grayscale($stop-gradient-hover);
$text-shadow-hover: grayscale($text-shadow-hover);
}
border: 1px solid $border-top;
border-color: $border-top $border-sides $border-bottom;
box-shadow: inset 0 1px 0 0 $inset-shadow-hover;
cursor: pointer;
@include linear-gradient ($base-color-hover, $stop-gradient-hover);
text-shadow: 0 -1px 1px $text-shadow-hover;
background-clip: padding-box;
}
&: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%);
$inset-shadow-active: adjust-color($base-color, $hue: 9, $saturation: 2%, $lightness: -21.5%);
$text-shadow-active: adjust-color($base-color, $hue: 5, $saturation: -12%, $lightness: -21.5%);
@if $grayscale == true {
$active-color: grayscale($active-color);
$border-active: grayscale($border-active);
$border-bottom-active: grayscale($border-bottom-active);
$inset-shadow-active: grayscale($inset-shadow-active);
$text-shadow-active: grayscale($text-shadow-active);
}
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;
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;
}
}

23
docs/_css/bourbon/addons/_clearfix.scss vendored Normal file
View File

@@ -0,0 +1,23 @@
// Modern micro clearfix provides an easy way to contain floats without adding additional markup.
//
// Example usage:
//
// // Contain all floats within .wrapper
// .wrapper {
// @include clearfix;
// .content,
// .sidebar {
// float : left;
// }
// }
@mixin clearfix {
&:after {
content:"";
display:table;
clear:both;
}
}
// Acknowledgements
// 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

@@ -0,0 +1,5 @@
$georgia: Georgia, Cambria, "Times New Roman", Times, 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

@@ -0,0 +1,10 @@
@mixin hide-text {
overflow: hidden;
&:before {
content: "";
display: block;
width: 0;
height: 100%;
}
}

View File

@@ -0,0 +1,86 @@
//************************************************************************//
// Generate a variable ($all-text-inputs) with a list of all html5
// input types that have a text-based input, excluding textarea.
// http://diveintohtml5.org/forms.html
//************************************************************************//
$inputs-list: 'input[type="email"]',
'input[type="number"]',
'input[type="password"]',
'input[type="search"]',
'input[type="tel"]',
'input[type="text"]',
'input[type="url"]',
// Webkit & Gecko may change the display of these in the future
'input[type="color"]',
'input[type="date"]',
'input[type="datetime"]',
'input[type="datetime-local"]',
'input[type="month"]',
'input[type="time"]',
'input[type="week"]';
// Bare inputs
//************************************************************************//
$all-text-inputs: assign-inputs($inputs-list);
// Hover Pseudo-class
//************************************************************************//
$all-text-inputs-hover: assign-inputs($inputs-list, hover);
// Focus Pseudo-class
//************************************************************************//
$all-text-inputs-focus: assign-inputs($inputs-list, focus);
// You must use interpolation on the variable:
// #{$all-text-inputs}
// #{$all-text-inputs-hover}
// #{$all-text-inputs-focus}
// Example
//************************************************************************//
// #{$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;
// }

32
docs/_css/bourbon/addons/_position.scss vendored Normal file
View File

@@ -0,0 +1,32 @@
@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);
$left: nth($coordinates, 4);
position: $position;
@if ($top and $top == auto) or (type-of($top) == number) {
top: $top;
}
@if ($right and $right == auto) or (type-of($right) == number) {
right: $right;
}
@if ($bottom and $bottom == auto) or (type-of($bottom) == number) {
bottom: $bottom;
}
@if ($left and $left == auto) or (type-of($left) == number) {
left: $left;
}
}

45
docs/_css/bourbon/addons/_prefixer.scss vendored Normal file
View File

@@ -0,0 +1,45 @@
//************************************************************************//
// Example: @include prefixer(border-radius, $radii, webkit ms spec);
//************************************************************************//
// Variables located in /settings/_prefixer.scss
@mixin prefixer ($property, $value, $prefixes) {
@each $prefix in $prefixes {
@if $prefix == webkit {
@if $prefix-for-webkit {
-webkit-#{$property}: $value;
}
}
@else if $prefix == moz {
@if $prefix-for-mozilla {
-moz-#{$property}: $value;
}
}
@else if $prefix == ms {
@if $prefix-for-microsoft {
-ms-#{$property}: $value;
}
}
@else if $prefix == o {
@if $prefix-for-opera {
-o-#{$property}: $value;
}
}
@else if $prefix == spec {
@if $prefix-for-spec {
#{$property}: $value;
}
}
@else {
@warn "Unrecognized prefix: #{$prefix}";
}
}
}
@mixin disable-prefix-for-all() {
$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

@@ -0,0 +1,31 @@
@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}");
}
@else {
background-image: url("#{$filename}.#{$extension}");
}
@include hidpi {
@if $asset-pipeline {
@if $retina-filename {
background-image: image-url("#{$retina-filename}.#{$extension}");
}
@else {
background-image: image-url("#{$filename}#{$retina-suffix}.#{$extension}");
}
}
@else {
@if $retina-filename {
background-image: url("#{$retina-filename}.#{$extension}");
}
@else {
background-image: url("#{$filename}#{$retina-suffix}.#{$extension}");
}
}
background-size: $background-size;
}
}

16
docs/_css/bourbon/addons/_size.scss vendored Normal file
View File

@@ -0,0 +1,16 @@
@mixin size($size) {
$height: nth($size, 1);
$width: $height;
@if length($size) > 1 {
$height: nth($size, 2);
}
@if $height == auto or (type-of($height) == number and not unitless($height)) {
height: $height;
}
@if $width == auto or (type-of($width) == number and not unitless($width)) {
width: $width;
}
}

View File

@@ -0,0 +1,32 @@
// 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/resources/demos/effect/easing.html
// EASE IN
$ease-in-quad: cubic-bezier(0.550, 0.085, 0.680, 0.530);
$ease-in-cubic: cubic-bezier(0.550, 0.055, 0.675, 0.190);
$ease-in-quart: cubic-bezier(0.895, 0.030, 0.685, 0.220);
$ease-in-quint: cubic-bezier(0.755, 0.050, 0.855, 0.060);
$ease-in-sine: cubic-bezier(0.470, 0.000, 0.745, 0.715);
$ease-in-expo: cubic-bezier(0.950, 0.050, 0.795, 0.035);
$ease-in-circ: cubic-bezier(0.600, 0.040, 0.980, 0.335);
$ease-in-back: cubic-bezier(0.600, -0.280, 0.735, 0.045);
// EASE OUT
$ease-out-quad: cubic-bezier(0.250, 0.460, 0.450, 0.940);
$ease-out-cubic: cubic-bezier(0.215, 0.610, 0.355, 1.000);
$ease-out-quart: cubic-bezier(0.165, 0.840, 0.440, 1.000);
$ease-out-quint: cubic-bezier(0.230, 1.000, 0.320, 1.000);
$ease-out-sine: cubic-bezier(0.390, 0.575, 0.565, 1.000);
$ease-out-expo: cubic-bezier(0.190, 1.000, 0.220, 1.000);
$ease-out-circ: cubic-bezier(0.075, 0.820, 0.165, 1.000);
$ease-out-back: cubic-bezier(0.175, 0.885, 0.320, 1.275);
// EASE IN OUT
$ease-in-out-quad: cubic-bezier(0.455, 0.030, 0.515, 0.955);
$ease-in-out-cubic: cubic-bezier(0.645, 0.045, 0.355, 1.000);
$ease-in-out-quart: cubic-bezier(0.770, 0.000, 0.175, 1.000);
$ease-in-out-quint: cubic-bezier(0.860, 0.000, 0.070, 1.000);
$ease-in-out-sine: cubic-bezier(0.445, 0.050, 0.550, 0.950);
$ease-in-out-expo: cubic-bezier(1.000, 0.000, 0.000, 1.000);
$ease-in-out-circ: cubic-bezier(0.785, 0.135, 0.150, 0.860);
$ease-in-out-back: cubic-bezier(0.680, -0.550, 0.265, 1.550);

83
docs/_css/bourbon/addons/_triangle.scss vendored Normal file
View File

@@ -0,0 +1,83 @@
@mixin triangle ($size, $color, $direction) {
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) {
$width: $width / 2;
$height: if(length($size) > 1, $height, $height/2);
@if $direction == up {
border-left: $width solid $background-color;
border-right: $width solid $background-color;
border-bottom: $height solid $foreground-color;
} @else if $direction == right {
border-top: $width solid $background-color;
border-bottom: $width solid $background-color;
border-left: $height solid $foreground-color;
} @else if $direction == down {
border-left: $width solid $background-color;
border-right: $width solid $background-color;
border-top: $height solid $foreground-color;
} @else if $direction == left {
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: $height solid $foreground-color;
@if $direction == up-right {
border-left: $width solid $background-color;
} @else if $direction == up-left {
border-right: $width solid $background-color;
}
}
@else if ($direction == down-right) or ($direction == down-left) {
border-bottom: $height solid $foreground-color;
@if $direction == down-right {
border-left: $width solid $background-color;
} @else if $direction == down-left {
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;
}
}

52
docs/_css/bourbon/css3/_animation.scss vendored Normal file
View File

@@ -0,0 +1,52 @@
// http://www.w3.org/TR/css3-animations/#the-animation-name-property-
// Each of these mixins support comma separated lists of values, which allows different transitions for individual properties to be described in a single style rule. Each value in the list corresponds to the value at that same position in the other properties.
// Official animation shorthand property.
@mixin animation ($animations...) {
@include prefixer(animation, $animations, webkit moz spec);
}
// Individual Animation Properties
@mixin animation-name ($names...) {
@include prefixer(animation-name, $names, webkit moz spec);
}
@mixin animation-duration ($times...) {
@include prefixer(animation-duration, $times, webkit moz spec);
}
@mixin animation-timing-function ($motions...) {
// ease | linear | ease-in | ease-out | ease-in-out
@include prefixer(animation-timing-function, $motions, webkit moz spec);
}
@mixin animation-iteration-count ($values...) {
// infinite | <number>
@include prefixer(animation-iteration-count, $values, webkit moz spec);
}
@mixin animation-direction ($directions...) {
// normal | alternate
@include prefixer(animation-direction, $directions, webkit moz spec);
}
@mixin animation-play-state ($states...) {
// running | paused
@include prefixer(animation-play-state, $states, webkit moz spec);
}
@mixin animation-delay ($times...) {
@include prefixer(animation-delay, $times, webkit moz spec);
}
@mixin animation-fill-mode ($modes...) {
// none | forwards | backwards | both
@include prefixer(animation-fill-mode, $modes, webkit moz spec);
}

View File

@@ -0,0 +1,3 @@
@mixin appearance ($value) {
@include prefixer(appearance, $value, webkit moz ms o spec);
}

View File

@@ -0,0 +1,6 @@
//************************************************************************//
// Backface-visibility mixin
//************************************************************************//
@mixin backface-visibility($visibility) {
@include prefixer(backface-visibility, $visibility, webkit spec);
}

View File

@@ -0,0 +1,42 @@
//************************************************************************//
// Background-image property for adding multiple background images with
// gradients, or for stringing multiple gradients together.
//************************************************************************//
@mixin background-image($images...) {
$webkit-images: ();
$spec-images: ();
@each $image in $images {
$webkit-image: ();
$spec-image: ();
@if (type-of($image) == string) {
$url-str: str-slice($image, 0, 3);
$gradient-type: str-slice($image, 0, 6);
@if $url-str == "url" {
$webkit-image: $image;
$spec-image: $image;
}
@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);
}
background-image: $webkit-images;
background-image: $spec-images;
}

55
docs/_css/bourbon/css3/_background.scss vendored Normal file
View File

@@ -0,0 +1,55 @@
//************************************************************************//
// Background property for adding multiple backgrounds using shorthand
// notation.
//************************************************************************//
@mixin background($backgrounds...) {
$webkit-backgrounds: ();
$spec-backgrounds: ();
@each $background in $backgrounds {
$webkit-background: ();
$spec-background: ();
$background-type: type-of($background);
@if $background-type == string or list {
$background-str: if($background-type == list, nth($background, 1), $background);
$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;
}
@else if $gradient-type == "linear" {
$gradients: _linear-gradient-parser("#{$background}");
$webkit-background: map-get($gradients, webkit-image);
$spec-background: map-get($gradients, spec-image);
}
@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 {
$webkit-background: $background;
$spec-background: $background;
}
}
@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

@@ -0,0 +1,59 @@
@mixin border-image($borders...) {
$webkit-borders: ();
$spec-borders: ();
@each $border in $borders {
$webkit-border: ();
$spec-border: ();
$border-type: type-of($border);
@if $border-type == string or list {
$border-str: if($border-type == list, nth($border, 1), $border);
$url-str: str-slice($border-str, 0, 3);
$gradient-type: str-slice($border-str, 0, 6);
@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);
}
-webkit-border-image: $webkit-borders;
border-image: $spec-borders;
border-style: solid;
}
//Examples:
// @include border-image(url("image.png"));
// @include border-image(url("image.png") 20 stretch);
// @include border-image(linear-gradient(45deg, orange, yellow));
// @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));

View File

@@ -0,0 +1,22 @@
//************************************************************************//
// Shorthand Border-radius mixins
//************************************************************************//
@mixin border-top-radius($radii) {
@include prefixer(border-top-left-radius, $radii, spec);
@include prefixer(border-top-right-radius, $radii, spec);
}
@mixin border-bottom-radius($radii) {
@include prefixer(border-bottom-left-radius, $radii, spec);
@include prefixer(border-bottom-right-radius, $radii, spec);
}
@mixin border-left-radius($radii) {
@include prefixer(border-top-left-radius, $radii, spec);
@include prefixer(border-bottom-left-radius, $radii, spec);
}
@mixin border-right-radius($radii) {
@include prefixer(border-top-right-radius, $radii, spec);
@include prefixer(border-bottom-right-radius, $radii, spec);
}

View File

@@ -0,0 +1,4 @@
@mixin box-sizing ($box) {
// content-box | border-box | inherit
@include prefixer(box-sizing, $box, webkit moz spec);
}

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});
}

47
docs/_css/bourbon/css3/_columns.scss vendored Normal file
View File

@@ -0,0 +1,47 @@
@mixin columns($arg: auto) {
// <column-count> || <column-width>
@include prefixer(columns, $arg, webkit moz spec);
}
@mixin column-count($int: auto) {
// auto || integer
@include prefixer(column-count, $int, webkit moz spec);
}
@mixin column-gap($length: normal) {
// normal || length
@include prefixer(column-gap, $length, webkit moz spec);
}
@mixin column-fill($arg: auto) {
// auto || length
@include prefixer(column-fill, $arg, webkit moz spec);
}
@mixin column-rule($arg) {
// <border-width> || <border-style> || <color>
@include prefixer(column-rule, $arg, webkit moz spec);
}
@mixin column-rule-color($color) {
@include prefixer(column-rule-color, $color, webkit moz spec);
}
@mixin column-rule-style($style: none) {
// none | hidden | dashed | dotted | double | groove | inset | inset | outset | ridge | solid
@include prefixer(column-rule-style, $style, webkit moz spec);
}
@mixin column-rule-width ($width: none) {
@include prefixer(column-rule-width, $width, webkit moz spec);
}
@mixin column-span($arg: none) {
// none || all
@include prefixer(column-span, $arg, webkit moz spec);
}
@mixin column-width($length: auto) {
// auto || length
@include prefixer(column-width, $length, webkit moz spec);
}

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);
}

321
docs/_css/bourbon/css3/_flex-box.scss vendored Normal file
View File

@@ -0,0 +1,321 @@
// CSS3 Flexible Box Model and property defaults
// Custom shorthand notation for flexbox
@mixin box($orient: inline-axis, $pack: start, $align: stretch) {
@include display-box;
@include box-orient($orient);
@include box-pack($pack);
@include box-align($align);
}
@mixin display-box {
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox; // IE 10
display: box;
}
@mixin box-orient($orient: inline-axis) {
// horizontal|vertical|inline-axis|block-axis|inherit
@include prefixer(box-orient, $orient, webkit moz spec);
}
@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) {
// single|multiple
@include prefixer(box-lines, $lines, webkit moz spec);
}
@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;
}

23
docs/_css/bourbon/css3/_font-face.scss vendored Normal file
View File

@@ -0,0 +1,23 @@
// 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: $asset-pipeline) {
@font-face {
font-family: $font-family;
font-weight: $weight;
font-style: $style;
@if $asset-pipeline == true {
src: font-url('#{$file-path}.eot');
src: font-url('#{$file-path}.eot?#iefix') format('embedded-opentype'),
font-url('#{$file-path}.woff') format('woff'),
font-url('#{$file-path}.ttf') format('truetype'),
font-url('#{$file-path}.svg##{$font-family}') format('svg');
} @else {
src: url('#{$file-path}.eot');
src: url('#{$file-path}.eot?#iefix') format('embedded-opentype'),
url('#{$file-path}.woff') format('woff'),
url('#{$file-path}.ttf') format('truetype'),
url('#{$file-path}.svg##{$font-family}') format('svg');
}
}
}

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);
}

View File

@@ -0,0 +1,10 @@
// HiDPI mixin. Default value set to 1.3 to target Google Nexus 7 (http://bjango.com/articles/min-device-pixel-ratio/)
@mixin hidpi($ratio: 1.3) {
@media only screen and (-webkit-min-device-pixel-ratio: $ratio),
only screen and (min--moz-device-pixel-ratio: $ratio),
only screen and (-o-min-device-pixel-ratio: #{$ratio}/1),
only screen and (min-resolution: #{round($ratio*96)}dpi),
only screen and (min-resolution: #{$ratio}dppx) {
@content;
}
}

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

@@ -0,0 +1,14 @@
@mixin image-rendering ($mode:auto) {
@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: crisp-edges;
}
@else {
image-rendering: $mode;
}
}

35
docs/_css/bourbon/css3/_keyframes.scss vendored Normal file
View File

@@ -0,0 +1,35 @@
// Adds keyframes blocks for supported prefixes, removing redundant prefixes in the block's content
@mixin keyframes($name) {
$original-prefix-for-webkit: $prefix-for-webkit;
$original-prefix-for-mozilla: $prefix-for-mozilla;
$original-prefix-for-microsoft: $prefix-for-microsoft;
$original-prefix-for-opera: $prefix-for-opera;
$original-prefix-for-spec: $prefix-for-spec;
@if $original-prefix-for-webkit {
@include disable-prefix-for-all();
$prefix-for-webkit: true !global;
@-webkit-keyframes #{$name} {
@content;
}
}
@if $original-prefix-for-mozilla {
@include disable-prefix-for-all();
$prefix-for-mozilla: true !global;
@-moz-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 {
@keyframes #{$name} {
@content;
}
}
}

View File

@@ -0,0 +1,38 @@
@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;
$pos-degree: null;
// If $pos is missing from mixin, reassign vars and add default position
@if ($pos-type == color) or (nth($pos, 1) == "transparent") {
$G10: $G9; $G9: $G8; $G8: $G7; $G7: $G6; $G6: $G5;
$G5: $G4; $G4: $G3; $G3: $G2; $G2: $G1; $G1: $pos;
$pos: null;
}
@if $pos {
$positions: _linear-positions-parser($pos);
$pos-degree: nth($positions, 1);
$pos-spec: nth($positions, 2);
}
$full: $G1, $G2, $G3, $G4, $G5, $G6, $G7, $G8, $G9, $G10;
// Set $G1 as the default fallback color
$fallback-color: nth($G1, 1);
// If $fallback is a color use that color as the fallback color
@if (type-of($fallback) == color) or ($fallback == "transparent") {
$fallback-color: $fallback;
}
background-color: $fallback-color;
background-image: -webkit-linear-gradient($pos-degree $full); // Safari 5.1+, Chrome
background-image: unquote("linear-gradient(#{$pos-spec}#{$full})");
}

View File

@@ -0,0 +1,8 @@
@mixin perspective($depth: none) {
// none | <length>
@include prefixer(perspective, $depth, webkit moz spec);
}
@mixin perspective-origin($value: 50% 50%) {
@include prefixer(perspective-origin, $value, webkit moz spec);
}

View File

@@ -0,0 +1,8 @@
@mixin placeholder {
$placeholders: ":-webkit-input" ":-moz" "-moz" "-ms-input";
@each $placeholder in $placeholders {
&:#{$placeholder}-placeholder {
@content;
}
}
}

View File

@@ -0,0 +1,39 @@
// Requires Sass 3.1+
@mixin radial-gradient($G1, $G2,
$G3: null, $G4: null,
$G5: null, $G6: null,
$G7: null, $G8: null,
$G9: null, $G10: null,
$pos: null,
$shape-size: null,
$fallback: 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);
$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);
// Set $G1 as the default fallback color
$first-color: nth($full, 1);
$fallback-color: nth($first-color, 1);
@if (type-of($fallback) == color) or ($fallback == "transparent") {
$fallback-color: $fallback;
}
// Add Commas and spaces
$shape-size: if($shape-size, '#{$shape-size}, ', null);
$pos: if($pos, '#{$pos}, ', null);
$pos-spec: if($pos, 'at #{$pos}', null);
$shape-size-spec: if(($shape-size-spec != ' ') and ($pos == null), '#{$shape-size-spec}, ', '#{$shape-size-spec} ');
background-color: $fallback-color;
background-image: -webkit-radial-gradient(unquote(#{$pos}#{$shape-size}#{$full}));
background-image: unquote("radial-gradient(#{$shape-size-spec}#{$pos-spec}#{$full})");
}

15
docs/_css/bourbon/css3/_transform.scss vendored Normal file
View File

@@ -0,0 +1,15 @@
@mixin transform($property: none) {
// none | <transform-function>
@include prefixer(transform, $property, webkit moz ms o spec);
}
@mixin transform-origin($axes: 50%) {
// x-axis - left | center | right | length | %
// y-axis - top | center | bottom | length | %
// z-axis - length
@include prefixer(transform-origin, $axes, webkit moz ms o spec);
}
@mixin transform-style ($style: flat) {
@include prefixer(transform-style, $style, webkit moz ms o spec);
}

77
docs/_css/bourbon/css3/_transition.scss vendored Normal file
View File

@@ -0,0 +1,77 @@
// Shorthand mixin. Supports multiple parentheses-deliminated values for each variable.
// 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...) {
// 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 {
@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);
}
}
}
@mixin transition-property ($properties...) {
-webkit-transition-property: transition-property-names($properties, 'webkit');
-moz-transition-property: transition-property-names($properties, 'moz');
transition-property: transition-property-names($properties, false);
}
@mixin transition-duration ($times...) {
@include prefixer(transition-duration, $times, webkit moz spec);
}
@mixin transition-timing-function ($motions...) {
// ease | linear | ease-in | ease-out | ease-in-out | cubic-bezier()
@include prefixer(transition-timing-function, $motions, webkit moz spec);
}
@mixin transition-delay ($times...) {
@include prefixer(transition-delay, $times, webkit moz spec);
}

View File

@@ -0,0 +1,3 @@
@mixin user-select($arg: none) {
@include prefixer(user-select, $arg, webkit moz ms 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

@@ -0,0 +1,39 @@
// Flexible grid
@function flex-grid($columns, $container-columns: $fg-max-columns) {
$width: $columns * $fg-column + ($columns - 1) * $fg-gutter;
$container-width: $container-columns * $fg-column + ($container-columns - 1) * $fg-gutter;
@return percentage($width / $container-width);
}
// Flexible gutter
@function flex-gutter($container-columns: $fg-max-columns, $gutter: $fg-gutter) {
$container-width: $container-columns * $fg-column + ($container-columns - 1) * $fg-gutter;
@return percentage($gutter / $container-width);
}
// The $fg-column, $fg-gutter and $fg-max-columns variables must be defined in your base stylesheet to properly use the flex-grid function.
// This function takes the fluid grid equation (target / context = result) and uses columns to help define each.
//
// The calculation presumes that your column structure will be missing the last gutter:
//
// -- column -- gutter -- column -- gutter -- column
//
// $fg-column: 60px; // Column Width
// $fg-gutter: 25px; // Gutter Width
// $fg-max-columns: 12; // Total Columns For Main Container
//
// div {
// width: flex-grid(4); // returns (315px / 995px) = 31.65829%;
// margin-left: flex-gutter(); // returns (25px / 995px) = 2.51256%;
//
// p {
// width: flex-grid(2, 4); // returns (145px / 315px) = 46.031746%;
// float: left;
// margin: flex-gutter(4); // returns (25px / 315px) = 7.936508%;
// }
//
// blockquote {
// float: left;
// width: flex-grid(2, 4); // returns (145px / 315px) = 46.031746%;
// }
// }

View File

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

View File

@@ -0,0 +1,13 @@
@function grid-width($n) {
@return $n * $gw-column + ($n - 1) * $gw-gutter;
}
// The $gw-column and $gw-gutter variables must be defined in your base stylesheet to properly use the grid-width function.
//
// $gw-column: 100px; // Column Width
// $gw-gutter: 40px; // Gutter Width
//
// div {
// width: grid-width(4); // returns 520px;
// margin-left: $gw-gutter; // returns 40px;
// }

View File

@@ -0,0 +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 {
@if $double-stranded and ($v1 * $ratio) > $v2 {
$value: $v2;
$v2: ($v2 * $ratio);
} @else {
$v1: ($v1 * $ratio);
$value: $v1;
}
}
}
@if $increment < 0 {
// 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;
}

View File

@@ -0,0 +1,13 @@
// Convert pixels to ems
// 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: $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

@@ -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,9 @@
// Add percentage of white to a color
@function tint($color, $percent){
@return mix(white, $color, $percent);
}
// Add percentage of black to a color
@function shade($color, $percent){
@return mix(black, $color, $percent);
}

View File

@@ -0,0 +1,22 @@
// Return vendor-prefixed property names if appropriate
// Example: transition-property-names((transform, color, background), moz) -> -moz-transform, color, background
//************************************************************************//
@function transition-property-names($props, $vendor: false) {
$new-props: ();
@each $prop in $props {
$new-props: append($new-props, transition-property-name($prop, $vendor), comma);
}
@return $new-props;
}
@function transition-property-name($prop, $vendor: false) {
// put other properties that need to be prefixed here aswell
@if $vendor and $prop == transform {
@return unquote('-'+$vendor+'-'+$prop);
}
@else {
@return $prop;
}
}

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

@@ -0,0 +1,13 @@
@function _gradient-positions-parser($gradient-type, $gradient-positions) {
@if $gradient-positions
and ($gradient-type == linear)
and (type-of($gradient-positions) != color) {
$gradient-positions: _linear-positions-parser($gradient-positions);
}
@else if $gradient-positions
and ($gradient-type == radial)
and (type-of($gradient-positions) != color) {
$gradient-positions: _radial-positions-parser($gradient-positions);
}
@return $gradient-positions;
}

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;
}

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