Fix deleted page redirects
Summary: The redirects we added inline in the deleted pages don't work when there's a baseUrl. This is because it's the standard react-router Redirect component, which knows nothing about docusaurus sites. We could get around that by adding `useBaseUrl()` calls around all of them, but that's not great. So changing to using declarative redirects instead, where they are all put in config. This automatically takes care of base urls, and reduces copy-pasted code. Reviewed By: passy Differential Revision: D25780599 fbshipit-source-id: c67d3643ab28f0fcd440904baf54c67687781686
This commit is contained in:
committed by
Facebook GitHub Bot
parent
8a8b979f66
commit
c460cb767f
@@ -1,8 +0,0 @@
|
||||
---
|
||||
id: index
|
||||
title: Clients and Plugins
|
||||
---
|
||||
|
||||
import {Redirect} from '@docusaurus/router';
|
||||
|
||||
<Redirect to="/docs/tutorial/intro" />
|
||||
@@ -13,7 +13,7 @@ This page describes the JavaScript API that is used to implement plugins inside
|
||||
|
||||
</div>
|
||||
|
||||
Provided a plugin is setup as defined in [Desktop Plugin Development](js-setup), the basic requirement of a Flipper plugin is that `index.tsx` exports a default class that extends `FlipperPlugin`.
|
||||
Provided a plugin is setup as defined in [Desktop Plugin Development](desktop-plugin-structure.mdx), the basic requirement of a Flipper plugin is that `index.tsx` exports a default class that extends `FlipperPlugin`.
|
||||
|
||||
`FlipperPlugin` is an extension of `React.Component` with extra Flipper-related functionality. This means to define the UI of your plugin, you just need to implement this React component.
|
||||
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
---
|
||||
id: js-setup
|
||||
title: Desktop Plugin Development
|
||||
---
|
||||
|
||||
import {Redirect} from '@docusaurus/router';
|
||||
|
||||
<Redirect to="/docs/extending/desktop-plugin-structure" />
|
||||
@@ -1,8 +0,0 @@
|
||||
---
|
||||
id: send-data
|
||||
title: Providing Data to Plugins
|
||||
---
|
||||
|
||||
import {Redirect} from '@docusaurus/router';
|
||||
|
||||
<Redirect to="/docs/extending/create-plugin#using-a-plugin-instance-to-send-data" />
|
||||
@@ -12,4 +12,4 @@ Flipper itself only provides the architectural platform. What makes it useful ar
|
||||
|
||||
The Flipper desktop app and the mobile native SDK establish a connection which is used to send data to and from the device. Flipper does not make any restrictions on what kind of data is being sent. This enables a lot of different use-cases where you want to better understand what is going inside your app. For example you can visualize the state of local caches, events happening or trigger actions on your app from the desktop.
|
||||
|
||||
If there is no plugin that does exactly what you want, you can build your own plugin, tailored to your needs. A plugin always consists of the native implementation sending and receiving data and the desktop plugin visualizing data. Learn more on how to [extend Flipper](../extending/index.mdx) and build your own plugin. The native implementations are written in Java, Objective-C, or C++, the desktop UI is written in React.
|
||||
If there is no plugin that does exactly what you want, you can build your own plugin, tailored to your needs. A plugin always consists of the native implementation sending and receiving data and the desktop plugin visualizing data. Learn more on how to [extend Flipper](../tutorial/intro.mdx) and build your own plugin. The native implementations are written in Java, Objective-C, or C++, the desktop UI is written in React.
|
||||
|
||||
@@ -6,6 +6,6 @@ sidebar_label: Stetho Guidance
|
||||
|
||||
In 2015, we introduced [Stetho](http://facebook.github.io/stetho/), an Android debugging bridge built on top of [Chrome DevTools](https://developers.google.com/web/tools/chrome-devtools/). While it was a valuable tool to us and many members of the community, we felt that it limited us in what we could do with it. Stetho is Android-only and while Chrome DevTools gave us a nice foundation to build upon, they also limited us in what we could build. Stetho is an Android tool and Chrome DevTools is built for web developers. This means we can only provide a good experience for the intersection of those two development environments, which was very limiting. With Flipper being built as a standalone app, we can do more things, like handling adb connections and supporting iOS, which wasn't easily achievable with Stetho.
|
||||
|
||||
This is why we built Flipper. We wanted to create a platform that gives us all the flexibility we need to build more advanced features and support for iOS. One of Flipper's core concepts is its extensibility using [plugins](extending/index). Plugins are written in React and we provide a set of ready-to-use UI components that allow developers to build great plugin UIs with a few lines of code.
|
||||
This is why we built Flipper. We wanted to create a platform that gives us all the flexibility we need to build more advanced features and support for iOS. One of Flipper's core concepts is its extensibility using [plugins](tutorial/intro.mdx). Plugins are written in React and we provide a set of ready-to-use UI components that allow developers to build great plugin UIs with a few lines of code.
|
||||
|
||||
While offering many new features, Flipper also already covers most of the features provided by Stetho. This includes network and layout inspection and an advanced log viewer. We are committed to continuously improving Flipper with new features and plugins, however, we are aware that not all Stetho features are currently supported by Flipper. If you are using a particular feature of Stetho which isn't supported by Flipper, we are more than happy to hear about your use-case. Stetho will continue to work and we are not abandoning it so you can choose the tool that fits your needs best. We are confident that Flipper will work well for most use-cases and are more than happy to accept contributions from the open-source community adding new features.
|
||||
|
||||
@@ -171,6 +171,64 @@ const siteConfig = {
|
||||
],
|
||||
],
|
||||
// end_config_example
|
||||
plugins: [
|
||||
[
|
||||
'@docusaurus/plugin-client-redirects',
|
||||
{
|
||||
redirects: [
|
||||
{
|
||||
to: '/docs/troubleshooting',
|
||||
from: ['/docs/fb/troubleshooting'],
|
||||
},
|
||||
{
|
||||
to: '/docs/tutorial/intro',
|
||||
from: ['/docs/extending'],
|
||||
},
|
||||
{
|
||||
to: '/docs/extending/desktop-plugin-structure',
|
||||
from: ['/docs/extending/js-setup'],
|
||||
},
|
||||
{
|
||||
to: '/docs/extending/create-plugin',
|
||||
from: [
|
||||
'/docs/extending/send-data',
|
||||
'/docs/fb/android-plugin-development-Android-interacting-0',
|
||||
],
|
||||
},
|
||||
{
|
||||
to: '/docs/tutorial/intro',
|
||||
from: ['/docs/fb/create-new-plugin'],
|
||||
},
|
||||
{
|
||||
to: '/docs/extending/dev-setup',
|
||||
from: ['/docs/fb/developmentworkflow'],
|
||||
},
|
||||
{
|
||||
to: '/docs/getting-started/index',
|
||||
from: ['/docs/fb/Help-Updating-Flipper'],
|
||||
},
|
||||
{
|
||||
to: '/docs/extending/create-plugin',
|
||||
from: [
|
||||
'/docs/fb/ios-plugin-development-sending-data-to-an-ios-plugin-0',
|
||||
],
|
||||
},
|
||||
{
|
||||
to: '/docs/extending/dev-setup',
|
||||
from: ['/docs/fb/TypeScript'],
|
||||
},
|
||||
{
|
||||
to: '/docs/extending/flipper-plugin',
|
||||
from: ['/docs/fb/using-gatekeepers'],
|
||||
},
|
||||
{
|
||||
to: '/docs/getting-started/index',
|
||||
from: ['/docs/fb/using-flipper-at-facebook'],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
],
|
||||
};
|
||||
|
||||
module.exports = siteConfig;
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
"devDependencies": {
|
||||
"@babel/parser": "^7.8.3",
|
||||
"@docusaurus/core": "^2.0.0-alpha.66",
|
||||
"@docusaurus/plugin-client-redirects": "2.0.0-alpha.68",
|
||||
"@docusaurus/preset-classic": "^2.0.0-alpha.66",
|
||||
"classnames": "^2.2.6",
|
||||
"docblock-parser": "^1.0.0",
|
||||
|
||||
@@ -2275,6 +2275,22 @@
|
||||
url-loader "^4.1.1"
|
||||
webpack "^4.44.1"
|
||||
|
||||
"@docusaurus/plugin-client-redirects@2.0.0-alpha.68":
|
||||
version "2.0.0-alpha.68"
|
||||
resolved "https://registry.yarnpkg.com/@docusaurus/plugin-client-redirects/-/plugin-client-redirects-2.0.0-alpha.68.tgz#037ee7a31c7e7c56427a003309f712e625c51be0"
|
||||
integrity sha512-HY0bk1vLw5/cwr7UoyCSAzRsIncUNTUZqCmKNc0w3mFWJ1eLmcJ8M7Z5cG6lhGZXz4jYx362fwrRvBSNF9CFcA==
|
||||
dependencies:
|
||||
"@docusaurus/core" "2.0.0-alpha.68"
|
||||
"@docusaurus/types" "2.0.0-alpha.68"
|
||||
"@docusaurus/utils" "2.0.0-alpha.68"
|
||||
"@docusaurus/utils-validation" "2.0.0-alpha.68"
|
||||
chalk "^3.0.0"
|
||||
eta "^1.11.0"
|
||||
fs-extra "^8.1.0"
|
||||
globby "^10.0.1"
|
||||
joi "^17.2.1"
|
||||
lodash "^4.17.20"
|
||||
|
||||
"@docusaurus/plugin-content-blog@2.0.0-alpha.68":
|
||||
version "2.0.0-alpha.68"
|
||||
resolved "https://registry.yarnpkg.com/@docusaurus/plugin-content-blog/-/plugin-content-blog-2.0.0-alpha.68.tgz#50216523d5f751c34d2448529af51d8f59d89c4a"
|
||||
|
||||
Reference in New Issue
Block a user