Commit Graph

41 Commits

Author SHA1 Message Date
Flarnie Marchan
f1b329a041 Add 'Test Utils' docs back to main navigation (#9676)
* Add 'Test Utils' docs back to main navigation

**why make this change?:**
We accidentally removed this - still supporting the use of Test Utilities, so we should have them in the docs.

**test plan:**
Manually tested the website - will insert a screenshot.

**issue:**
https://github.com/facebook/react/issues/9651

* Move test-utils docs to reference section

**what is the change?:**
Moved from 'advanced guides' to 'reference'

**why make this change?:**
It makes more sense as a reference

**test plan:**
Visual inspection (flarnie may add a screenshot)

**issue:**

* Add back the shallow renderer docs and remove outdated docs

**what is the change?:**
- Remove outdated 'shallow renderer' docs on 'test utils' page, and point to the updated 'shallow renderer' docs.
- Re-add a link to the updated 'shallow renderer' docs on the main navigation.

**why make this change?:**
This was already approved in https://github.com/facebook/react/pull/9331 which was then cherry-picked to https://github.com/facebook/react/pull/9359/commits and landed on master.

I'm not sure why some of these changes didn't persist. For now just adding back the changes we need.

**test plan:**
Manually inspected website - will insert screenshots.

**issue:**

* Further improvements to 'shallow rendering' and 'test utils' docs

Thanks @gaearon for the improvements!

**what is the change?:**
- Remove <hr/> from end of 'shallow rendering' docs
- 'documents' -> 'documentation'
- Move 'shallow rendering' redirection section to top of 'test utils' docs
- Add intro sentence about testing to 'shallow rendering' docs

**why make this change?:**
Documentation helps people learn.

**test plan:**
Visual inspection
2017-05-26 07:47:18 -07:00
wacii
54a3e23c3b Add guide on integrating with non-react code (#9316)
* Add guide on integrating with non-react code

* Capitalize guide title

* Make links to other docs relative

* Rephrase 'What it does do'

* Remove experimental syntax

* Capitalize Backbone

* Remove empty lifecycle method in generic jQuery example

* Use shouldComponentUpdate() not componentWillUpdate()

* Prefer single quotes

* Add cleanup to generic jQuery example

* Capitalize React

* Generalize the section on Backbone Views

* Generalize the section on Backbone Models, a little

* Add introduction

* Adjust wording

* Simplify ref callbacks

* Fix typo in generic jQuery example

* Fix typos in Backbone models in React components

* Fix more typos in Backbone models in React components

* Add generic section on integrating with other view libraries

* Stress the benefits of an unchanging React element

* Small changes to introduction

* Add missing semicolon

* Revise generic jQuery wrapper section

Moved the section on using empty elements to prevent conflicts above the
code example and added brief introduction to that example.

* Add usage example for Chosen wrapper

* Prevent Chosen wrapper from updating

* Note that sharing the DOM with plugins is not recommended

* Mention how React is used at Facebook

* Mention React event system in template rendering section

* Remove destructuring from function parameters

* Do not name React components Component

* Elaborate on unmountComponentAtNode()

* Mention preference for unidirectional data flow

* Rename backboneModelAdapter

* Replace rest syntax

* Respond to updated model in connectToBackboneModel

* Rewrite connectToBackboneModel example

* Rework connectToBackboneModel example

* Misc changes

* Misc changes

* Change wording

* Tweak some parts
2017-04-26 17:24:22 +01:00
Flarnie Marchan
94b06a62b0 Add link to 'Typechecking with PropTypes' under 'Advanced Guides' (#9472)
This should have been retained in our docs, since PropTypes are only
moved and not deprecated.

Partially handles #9467, and I'll make a separate PR to
https://github.com/reactjs/prop-types to add more docs to the README
there.
2017-04-22 10:41:39 -07:00
Flarnie Marchan
803e5da950 All doc updates forv15.5 (#9359)
* `react-addons-test-utils` -> `react-dom/test-utils`

Updating all references and docs on the `React.addons.TestUtils` and the
shallow renderer to refer to the correct targets.

Instead of:
```
const React = require('react');

// ...
React.addons.Testutils
// or

const ReactTestUtils = require('react-addons-test-utils');
```
we now show:
```
const ReactTestUtils = require('react-dom/test-utils');
```

And for shallow renderer, instead of:
```
const shallowRenderer = TestUtils.createRenderer();
```

we now show:
```
const shallowRenderer = require('react-test-renderer/shallow');
```

* Update the 'prev' and 'next' attributes of 'add-ons' docs

These flags are used to set arrow links to easily navigate through the
documents. They were wrong or missing in some of the 'add-ons' pages and
this bothered me when manually testing the updates from the previous
commit.

* Update syntax for instantiating shallow renderer

Missed this when updating the docs for the changes to shallow-renderer
in React 15.5.

* Fix pointers in addons docs

Thanks @bvaughn for catching this

* Make example of shallow renderer more consistent

We should show using the same variable names between code samples.

* Make names in example even more consistent

We should use the same variable name for the same thing across examples.
`renderer` -> `shallowRenderer`.

* Update docs to deprecate React<CSS>TransitionGroup

 - removes link to the docs about `ReactCSSTransitionGroup` and
   `ReactTransitionGroup` from the main navigation
 - updates 'prev' and 'next' pointers to skip this page
 - adds deprecation warning to the top of the page
 - remove references to these modules from the packages README
 - updates 'add-ons' main page to list this as a deprecated add-on

* Update `React.createClass` to `createReactClass` in the docs

The `React.createClass` method is being deprecated in favor of
`createReactClass`.

* Remove 'React.createClass' from top level API docs

It no longer makes sense to have a section for the 'createClass' method
in this page, since it won't be available as a top level method on
'React'.

I initially was going to pull the section about 'createClass' into a
separate page to add under 'addons' but it was short and duplicative of
the 'react-without-es6' docs. So I just linked to those.

* Remove *most* `React.PropTypes` from the docs

I am doing the docs for `context` in a separate commit because that case
was a bit less clear-cut.

We will no longer support `React.PropTypes` as a built-in feature of
React, and instead should direct folks to use the `PropTypes` project
that stands alone.

Rather than retaining the `React.PropTypes` examples and just revamping
them to show the use of the stand-alone `PropTypes` library with React,
it makes more sense to direct people to that project and reduce the
perceived API area and complexity of React core. The proper place to
document `PropTypes` is in the README or docs of that project, not in
React docs.

* Update `context` docs to not use `React.PropTypes`

We use `React.PropTypes` to define the `contextType` for the `context`
feature of React. It's unclear how this will work once `React.PropTypes`
is replaced by the external `PropTypes` library. Some options;

a) Deprecate `context`, either in v16 or shortly after. Seems reasonable
based on the intense warnings against using context that we have in the
docs -
https://facebook.github.io/react/docs/context.html#why-not-to-use-context
**Except** that probably some widely used libraries depend on it, like
`React-Router`.

b) Expect users will use external `PropTypes` library when defining
`contextTypes` and just don't do our `checkReactTypeSpec` against them
any more in v16.

c) Stop masking context and pass the whole context
unmasked everywhere. Worst option, do not recommend.

I went with `b` and assume that, for now, we will get users to use the
external `PropTypes` when defining context. I will update this PR if we
want a different approach.

* Remove 'addons' items from left nav, and deprecate 'addons' doc page

The plan:
[X] Remove links to 'addons' items from main navigation
[X] Add deprecation notices where appropriate, and update syntax to show
using the separate modules.
[ ] Update other references to 'React.addons' in docs. Coming in next
commit.
--- blocked but coming in future PRs
[ ] Link to a blog post describing the new locations of add-ons in the
deprecation notice on the '/docs/addons.html' page. Blocked until we
actually publish that blog post.
[ ] Move the docs for each add-on to the actual github repo where it now
lives.
[ ] Redirect the old add-ons doc permalinks to the docs in the separate
github repos for those modules.
[ ] Remove the old add-ons doc markdown files from React core docs.

* Remove references to `React.addons` from docs

Just misc. places where we referenced the 'addons' feature. All gone!
2017-04-06 17:20:54 -07:00
Andrew Clark
e3d37fdb90 Add a document on higher-order components (#7869) 2016-11-29 10:47:54 -08:00
Kevin Lacker
809e28223e forms breakup 2016-11-08 21:38:03 +00:00
Kevin Lacker
aa9544bfac New Documentation 2016-10-21 20:59:08 +01:00
Ben Alpert
649e295296 Remove Flux from docs nav (#6945)
Most people don't use the official Flux implementation or docs so I think this is likely to be more confusing than helpful. Maybe later we can add a better comparison of data management solutions.
2016-06-01 11:41:35 -07:00
Jim
eb56cc7a4a Added docs for environment integration. 2016-04-14 12:25:17 -07:00
Jim
40380fbafd Create section on using React with package managers. 2016-04-12 12:39:49 -07:00
Joe Critchley
f67a478cd3 Added icon for external links in Docs nav and unlinked Complementary Tools and Examples in favor of this icon 2016-02-23 02:18:20 +00:00
Zach Ramaekers
6f8388f703 adding documentation pages for shallowCompare addon 2015-12-04 08:53:33 -06:00
Jim
029b4ad70e Added info (example+doc) about react with webcomponents 2015-11-13 20:22:24 -08:00
Ben Alpert
4dec050f5d Document context
Fixes #580.
2015-10-09 14:44:24 -07:00
Jim
c426902fca Added documentation for stateless components, condensed the two pages about refs into a single page. 2015-09-30 18:54:19 -07:00
mheiber
b801d5856c 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.
2015-04-22 17:05:59 -07:00
Reed Loden
dd010b34e2 SSL/TLSize all the things! (convert http:// to https:// where appropriate)
Update links to use https:// where it is supported. There's probably a lot
more that could be fixed, but these are the core ones I found (especially
the download links in order to prevent MITM attacks). Note that there are
some fb.me links that will redirect to http:// even while accessed over
https://, but this seemed like the best way to fix those for now.

NOTE: Only non-third-party files were modified. There are references to
http:// URLs in vendored/third-party files, but seems appropriate to fix
upstream for those rather than editing the files.

Also, copy one image locally to the blog, as it was hotlinking to a site
that did not support https://.

Last, use youtube-nocookie.com instead of youtube.com for video embeds,
as the former doesn't try to set a cookie on load (privacy enhancement).
2015-04-18 16:49:32 -07:00
Cheng Lou
db33842478 Remove mention from docs 2015-03-23 20:13:24 -04:00
Ben Alpert
3d6af36002 Add docs for createFragment 2015-03-10 09:17:34 -07:00
Christopher Chedeau
97e8607897 Advanced Performance Doc 2015-02-11 10:53:57 -08:00
Rick Beerendonk
2e4f81f4ab Add Conferences section to the Community Resources on the website 2015-01-31 22:46:03 +01:00
Sebastian Markbage
fcaa90c5cf Update Docs Navigation 2014-10-28 11:06:31 -07:00
Paul O’Shannessy
a0a4b58af4 [docs] Glossary
Pulled in https://gist.github.com/sebmarkbage/fcb1b6ab493b0c77d589
mostly verbatim
2014-10-23 20:51:11 -07:00
Paul O’Shannessy
3a0babddc9 Point to Flux site for Flux docs
This doesn't actually remove the pages, just the main content. Sidebar
items now link offsite. The pages doesn't automatically redirect, but we
could do that if we really wanted.

Fixes #2229
2014-09-25 12:34:22 -07:00
Jed Watson
dcb1b1de11 Updating "Tutorial" label as per suggestion 2014-07-29 12:20:15 +10:00
Jed Watson
854133c240 Adding "Tutorial" label to Flux Todo List nav item 2014-07-29 10:54:22 +10:00
Cheng Lou
5e161764ca [Docs] Perf tools
Fixes #1814.
@petehunt @joshduck
The images look blurry (taken on retina then shrank down to 50%...)
2014-07-15 11:17:21 -07:00
Cheng Lou
581877e346 [Docs] Document PureRenderMixin addon
Fixes #1816
2014-07-12 14:56:43 -07:00
Vjeux
35db119584 Flux blog post and tutorial 2014-05-09 01:22:47 +02:00
petehunt
d9efc5aa57 Add thinking in react to the official docs 2014-03-03 10:37:33 -08:00
Cheng Lou
36e14d6b4c [Docs] Consolidate the two examples sections
Also made the formatting more consistent between complementary-tools and
examples.
2014-02-23 18:58:28 -08:00
petehunt
9ffe030d52 Add update() docs 2014-02-21 13:07:51 -08:00
petehunt
6de90dcebb clone docs 2014-02-18 23:26:51 -08:00
petehunt
e095116cd8 Add ReactTestUtils to addons 2014-02-18 22:54:24 -08:00
Ben Alpert
ff78c2d732 [docs] Capitalize all nav titles for consistency 2014-02-13 21:41:09 -08:00
petehunt
c07c43b202 add example apps page 2014-02-01 18:11:00 -08:00
petehunt
22d23865a4 Add a complementary tools page 2014-02-01 17:43:56 -08:00
Vjeux
8d938e4a32 Add a talks section to the docs 2013-12-24 07:20:42 +01:00
Vjeux
0f3a5793e5 Document the Diff algorithm
We often refer to it but never did actually explain it.
2013-12-22 20:09:02 +01:00
Cheng Lou
f6df878b37 docs section for non-dom attributes
Also added documentation for `dangerouslySetInnerHTML`.
2013-12-18 00:31:17 -05:00
Paul O’Shannessy
1910d7fc0b Put nav data in "_data"
New in Jekyll 1.3 - http://jekyllrb.com/docs/datafiles/
2013-11-19 15:52:42 -08:00