From 109e3d79ccbef786a779a1fbf4a40adfcaf4ce30 Mon Sep 17 00:00:00 2001 From: Joel Marcey Date: Wed, 22 Jun 2016 09:18:44 -0700 Subject: [PATCH] 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 --- docs/Accessibility.md | 2 +- docs/Basics-Component-ListView.md | 2 +- docs/{Network.md => Basics-Network.md} | 8 ++++---- docs/Colors.md | 3 ++- docs/Style.md | 2 +- docs/Timers.md | 4 ++-- website/server/extractDocs.js | 20 ++++++-------------- 7 files changed, 17 insertions(+), 24 deletions(-) rename docs/{Network.md => Basics-Network.md} (97%) diff --git a/docs/Accessibility.md b/docs/Accessibility.md index 0c5f11068..a1807b108 100644 --- a/docs/Accessibility.md +++ b/docs/Accessibility.md @@ -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) diff --git a/docs/Basics-Component-ListView.md b/docs/Basics-Component-ListView.md index 15c556a4e..f3eb1f08b 100644 --- a/docs/Basics-Component-ListView.md +++ b/docs/Basics-Component-ListView.md @@ -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. diff --git a/docs/Network.md b/docs/Basics-Network.md similarity index 97% rename from docs/Network.md rename to docs/Basics-Network.md index 1d1d99f8a..17668045f 100644 --- a/docs/Network.md +++ b/docs/Basics-Network.md @@ -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(); diff --git a/docs/Colors.md b/docs/Colors.md index aba269085..9d863adfa 100644 --- a/docs/Colors.md +++ b/docs/Colors.md @@ -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: diff --git a/docs/Style.md b/docs/Style.md index fb6cb7a6d..53fcb6eea 100644 --- a/docs/Style.md +++ b/docs/Style.md @@ -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. diff --git a/docs/Timers.md b/docs/Timers.md index 282946814..ad0fe0e06 100644 --- a/docs/Timers.md +++ b/docs/Timers.md @@ -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). diff --git a/website/server/extractDocs.js b/website/server/extractDocs.js index e9cdc2055..b199ef4ca 100644 --- a/website/server/extractDocs.js +++ b/website/server/extractDocs.js @@ -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) ); };