mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-03-29 22:41:56 +08:00
Remove Polyfills section from sidebar
Summary: Some of these will be in basics, guides and apis instead. One less layer of confusion. > Note: APIs are not totally alphabetical any longer -- but neither were Polyfills. We can fix that in `extractDocs.js` maybe. But not worth doing in this pull request, imho. Closes https://github.com/facebook/react-native/pull/8293 Differential Revision: D3469684 Pulled By: JoelMarcey fbshipit-source-id: 4f7830ca10b8e4406df9cec8bf13ff150e355250
This commit is contained in:
committed by
Facebook Github Bot 2
parent
deb6106c16
commit
109e3d79cc
@@ -4,7 +4,7 @@ title: Accessibility
|
||||
layout: docs
|
||||
category: Guides
|
||||
permalink: docs/accessibility.html
|
||||
next: direct-manipulation
|
||||
next: timers
|
||||
---
|
||||
|
||||
## Native App Accessibility (iOS and Android)
|
||||
|
||||
@@ -4,7 +4,7 @@ title: ListView
|
||||
layout: docs
|
||||
category: Basics
|
||||
permalink: docs/basics-component-listview.html
|
||||
next: basics-integration-with-existing-apps
|
||||
next: basics-network
|
||||
---
|
||||
|
||||
On mobile devices, lists are a core element in many applications. The [`ListView`](/react-native/docs/listview.html#content) component is a special type of [`View`](/react-native/docs/basics-component-view.html) that displays a *vertically* scrolling list of changing, but similarly structured, data.
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
---
|
||||
id: network
|
||||
id: basics-network
|
||||
title: Network
|
||||
layout: docs
|
||||
category: Polyfills
|
||||
category: Basics
|
||||
permalink: docs/network.html
|
||||
next: timers
|
||||
next: basics-integration-with-existing-apps
|
||||
---
|
||||
|
||||
One of React Native's goals is to be a playground where we can experiment with different architectures and crazy ideas. Since browsers are not flexible enough, we had no choice but to reimplement the entire stack. In the places that we did not intend to change anything, we tried to be as faithful as possible to the browser APIs. The networking stack is a great example.
|
||||
@@ -122,7 +122,7 @@ request.open('GET', 'https://mywebsite.com/endpoint.php');
|
||||
request.send();
|
||||
```
|
||||
|
||||
You can also use -
|
||||
You can also use -
|
||||
|
||||
```js
|
||||
var request = new XMLHttpRequest();
|
||||
@@ -2,8 +2,9 @@
|
||||
id: colors
|
||||
title: Colors
|
||||
layout: docs
|
||||
category: Polyfills
|
||||
category: Guides
|
||||
permalink: docs/colors.html
|
||||
next: images
|
||||
---
|
||||
|
||||
The following formats are supported:
|
||||
|
||||
@@ -4,7 +4,7 @@ title: Style
|
||||
layout: docs
|
||||
category: Guides
|
||||
permalink: docs/style.html
|
||||
next: images
|
||||
next: colors
|
||||
---
|
||||
|
||||
React Native doesn't implement CSS but instead relies on JavaScript to let you style your application. This has been a controversial decision and you can read through those slides for the rationale behind it.
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
id: timers
|
||||
title: Timers
|
||||
layout: docs
|
||||
category: Polyfills
|
||||
category: Guides
|
||||
permalink: docs/timers.html
|
||||
next: colors
|
||||
next: direct-manipulation
|
||||
---
|
||||
|
||||
Timers are an important part of an application and React Native implements the [browser timers](https://developer.mozilla.org/en-US/Add-ons/Code_snippets/Timers).
|
||||
|
||||
@@ -159,9 +159,8 @@ function getNextComponent(idx) {
|
||||
} else {
|
||||
return getNextComponent(idx + 1);
|
||||
}
|
||||
} else {
|
||||
return 'network';
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function componentsToMarkdown(type, json, filepath, idx, styles) {
|
||||
@@ -185,8 +184,8 @@ function componentsToMarkdown(type, json, filepath, idx, styles) {
|
||||
json.methods = json.methods.filter(filterMethods);
|
||||
}
|
||||
|
||||
// Put Flexbox into the Polyfills category
|
||||
const category = (type === 'style' ? 'Polyfills' : type + 's');
|
||||
// Put styles (e.g. Flexbox) into the API category
|
||||
const category = (type === 'style' ? 'apis' : type + 's');
|
||||
const next = getNextComponent(idx);
|
||||
|
||||
const res = [
|
||||
@@ -499,6 +498,7 @@ const apis = [
|
||||
'../Libraries/Components/Clipboard/Clipboard.js',
|
||||
'../Libraries/Components/DatePickerAndroid/DatePickerAndroid.android.js',
|
||||
'../Libraries/Utilities/Dimensions.js',
|
||||
'../Libraries/Geolocation/Geolocation.js',
|
||||
'../Libraries/Components/Intent/IntentAndroid.android.js',
|
||||
'../Libraries/Interaction/InteractionManager.js',
|
||||
'../Libraries/LayoutAnimation/LayoutAnimation.js',
|
||||
@@ -529,14 +529,9 @@ const stylesForEmbed = [
|
||||
'../Libraries/Image/ImageStylePropTypes.js',
|
||||
];
|
||||
|
||||
const polyfills = [
|
||||
'../Libraries/Geolocation/Geolocation.js',
|
||||
];
|
||||
|
||||
const all = components
|
||||
.concat(apis)
|
||||
.concat(stylesWithPermalink)
|
||||
.concat(polyfills);
|
||||
.concat(stylesWithPermalink);
|
||||
|
||||
const styleDocs = stylesForEmbed.reduce(function(docs, filepath) {
|
||||
docs[path.basename(filepath).replace(path.extname(filepath), '')] =
|
||||
@@ -560,9 +555,6 @@ module.exports = function() {
|
||||
apis.map((filepath) => {
|
||||
return renderAPI(filepath, 'api');
|
||||
}),
|
||||
stylesWithPermalink.map(renderStyle),
|
||||
polyfills.map((filepath) => {
|
||||
return renderAPI(filepath, 'Polyfill');
|
||||
})
|
||||
stylesWithPermalink.map(renderStyle)
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user