mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-25 00:07:47 +01:00
chore: remove node-fetch, don't do Unleash server-side
This commit is contained in:
parent
f49fde0923
commit
6b624081fa
@ -25,7 +25,6 @@
|
|||||||
"@svgr/webpack": "6.2.1",
|
"@svgr/webpack": "6.2.1",
|
||||||
"clsx": "1.1.1",
|
"clsx": "1.1.1",
|
||||||
"file-loader": "6.2.0",
|
"file-loader": "6.2.0",
|
||||||
"node-fetch": "^2.6.7",
|
|
||||||
"react": "17.0.2",
|
"react": "17.0.2",
|
||||||
"react-dom": "17.0.2",
|
"react-dom": "17.0.2",
|
||||||
"unleash-proxy-client": "^1.11.0",
|
"unleash-proxy-client": "^1.11.0",
|
||||||
|
@ -2,7 +2,6 @@ import React from 'react';
|
|||||||
import UserFeedback from '@site/src/components/UserFeedback';
|
import UserFeedback from '@site/src/components/UserFeedback';
|
||||||
import { UnleashClient } from 'unleash-proxy-client';
|
import { UnleashClient } from 'unleash-proxy-client';
|
||||||
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
||||||
import nodeFetch from 'node-fetch'
|
|
||||||
|
|
||||||
// Default implementation, that you can customize
|
// Default implementation, that you can customize
|
||||||
function Root({ children }) {
|
function Root({ children }) {
|
||||||
@ -10,18 +9,11 @@ function Root({ children }) {
|
|||||||
siteConfig: { customFields },
|
siteConfig: { customFields },
|
||||||
} = useDocusaurusContext();
|
} = useDocusaurusContext();
|
||||||
|
|
||||||
|
|
||||||
const unleashSsrOptions = {
|
|
||||||
disableMetrics: true,
|
|
||||||
fetch: nodeFetch
|
|
||||||
}
|
|
||||||
|
|
||||||
const unleashConfig = {
|
const unleashConfig = {
|
||||||
clientKey: customFields.unleashProxyClientKey as string,
|
clientKey: customFields.unleashProxyClientKey as string,
|
||||||
url: customFields.unleashProxyUrl as string,
|
url: customFields.unleashProxyUrl as string,
|
||||||
disableRefresh: true,
|
disableRefresh: true,
|
||||||
appName: `docs.getunleash.io-${customFields.environment}`,
|
appName: `docs.getunleash.io-${customFields.environment}`,
|
||||||
...(typeof fetch === "undefined" ? unleashSsrOptions : {})
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const [showFeedback, setShowFeedback] = React.useState(false);
|
const [showFeedback, setShowFeedback] = React.useState(false);
|
||||||
|
Loading…
Reference in New Issue
Block a user