From a0ec773a03bc500fe9fb308044209290e462aba6 Mon Sep 17 00:00:00 2001 From: Alex Kaminskii Date: Mon, 23 Jan 2023 13:12:26 +0100 Subject: [PATCH] feat(frontend): remove links to Fetch/Axios Plugin docs; add link to network options --- .../Client/Integrations/AxiosDoc/AxiosDoc.js | 69 ------------------ .../Client/Integrations/AxiosDoc/index.js | 1 - .../Client/Integrations/FetchDoc/FetchDoc.js | 73 ------------------- .../Client/Integrations/FetchDoc/index.js | 1 - .../Client/Integrations/Integrations.tsx | 4 - .../Session_/Network/NetworkContent.js | 9 ++- .../FetchDetailsModal/FetchDetailsModal.tsx | 2 - .../FetchPluginMessage/FetchPluginMessage.tsx | 31 -------- .../components/FetchPluginMessage/index.ts | 1 - .../components/FetchTabs/FetchTabs.tsx | 10 ++- 10 files changed, 14 insertions(+), 187 deletions(-) delete mode 100644 frontend/app/components/Client/Integrations/AxiosDoc/AxiosDoc.js delete mode 100644 frontend/app/components/Client/Integrations/AxiosDoc/index.js delete mode 100644 frontend/app/components/Client/Integrations/FetchDoc/FetchDoc.js delete mode 100644 frontend/app/components/Client/Integrations/FetchDoc/index.js delete mode 100644 frontend/app/components/shared/FetchDetailsModal/components/FetchPluginMessage/FetchPluginMessage.tsx delete mode 100644 frontend/app/components/shared/FetchDetailsModal/components/FetchPluginMessage/index.ts diff --git a/frontend/app/components/Client/Integrations/AxiosDoc/AxiosDoc.js b/frontend/app/components/Client/Integrations/AxiosDoc/AxiosDoc.js deleted file mode 100644 index 80ae5e0a7..000000000 --- a/frontend/app/components/Client/Integrations/AxiosDoc/AxiosDoc.js +++ /dev/null @@ -1,69 +0,0 @@ -import React from 'react'; -import Highlight from 'react-highlight'; -import ToggleContent from 'Shared/ToggleContent'; -import DocLink from 'Shared/DocLink/DocLink'; -import { connect } from 'react-redux'; - -const AxiosDoc = (props) => { - const { projectKey } = props; - return ( -
-

Axios

-
-
- This plugin allows you to capture axios requests and inspect them later on while replaying session recordings. This is very useful - for understanding and fixing issues. -
- -
Installation
- {`npm i @openreplay/tracker-axios`} - -
Usage
-

- Initialize the @openreplay/tracker package as usual then load the axios plugin. Note that OpenReplay axios plugin requires - axios@^0.21.2 as a peer dependency. -

-
- -
Usage
- - {`import OpenReplay from '@openreplay/tracker'; -import trackerAxios from '@openreplay/tracker-axios'; -const tracker = new OpenReplay({ - projectKey: '${projectKey}' -}); -tracker.use(trackerAxios(options)); // check list of available options below -tracker.start();`} - - } - second={ - - {`import OpenReplay from '@openreplay/tracker/cjs'; -import trackerAxios from '@openreplay/tracker-axios/cjs'; -const tracker = new OpenReplay({ - projectKey: '${projectKey}' -}); -tracker.use(trackerAxios(options)); // check list of available options below -//... -function MyApp() { - useEffect(() => { // use componentDidMount in case of React Class Component - tracker.start(); - }, []) -//... -}`} - - } - /> - - -
-
- ); -}; - -AxiosDoc.displayName = 'AxiosDoc'; - -export default connect((state) => ({ projectKey: state.getIn(['site', 'instance', 'projectKey'])}) )(AxiosDoc) diff --git a/frontend/app/components/Client/Integrations/AxiosDoc/index.js b/frontend/app/components/Client/Integrations/AxiosDoc/index.js deleted file mode 100644 index a5a8a1873..000000000 --- a/frontend/app/components/Client/Integrations/AxiosDoc/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from './AxiosDoc' \ No newline at end of file diff --git a/frontend/app/components/Client/Integrations/FetchDoc/FetchDoc.js b/frontend/app/components/Client/Integrations/FetchDoc/FetchDoc.js deleted file mode 100644 index 761d4160b..000000000 --- a/frontend/app/components/Client/Integrations/FetchDoc/FetchDoc.js +++ /dev/null @@ -1,73 +0,0 @@ -import React from 'react'; -import Highlight from 'react-highlight'; -import ToggleContent from 'Shared/ToggleContent'; -import DocLink from 'Shared/DocLink/DocLink'; -import { connect } from 'react-redux'; - -const FetchDoc = (props) => { - const { projectKey } = props; - return ( -
-

Fetch

-
-
- This plugin allows you to capture fetch payloads and inspect them later on while replaying session recordings. This is very useful - for understanding and fixing issues. -
- -
Installation
- {`npm i @openreplay/tracker-fetch --save`} - -
Usage
-

Use the provided fetch method from the plugin instead of the one built-in.

-
- -
Usage
- - {`import OpenReplay from '@openreplay/tracker'; -import trackerFetch from '@openreplay/tracker-fetch'; -//... -const tracker = new OpenReplay({ - projectKey: '${projectKey}' -}); -tracker.start(); -//... -export const fetch = tracker.use(trackerFetch()); // check list of available options below -//... -fetch('https://api.openreplay.com/').then(response => console.log(response.json()));`} - - } - second={ - - {`import OpenReplay from '@openreplay/tracker/cjs'; -import trackerFetch from '@openreplay/tracker-fetch/cjs'; -//... -const tracker = new OpenReplay({ - projectKey: '${projectKey}' -}); -//... -function SomeFunctionalComponent() { - useEffect(() => { // or componentDidMount in case of Class approach - tracker.start(); - }, []) -//... -export const fetch = tracker.use(trackerFetch()); // check list of available options below -//... -fetch('https://api.openreplay.com/').then(response => console.log(response.json())); -}`} - - } - /> - - -
-
- ); -}; - -FetchDoc.displayName = 'FetchDoc'; - -export default connect((state) => ({ projectKey: state.getIn(['site', 'instance', 'projectKey'])}) )(FetchDoc) diff --git a/frontend/app/components/Client/Integrations/FetchDoc/index.js b/frontend/app/components/Client/Integrations/FetchDoc/index.js deleted file mode 100644 index 9bb21e9b9..000000000 --- a/frontend/app/components/Client/Integrations/FetchDoc/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from './FetchDoc' \ No newline at end of file diff --git a/frontend/app/components/Client/Integrations/Integrations.tsx b/frontend/app/components/Client/Integrations/Integrations.tsx index fe281235b..6afb5f172 100644 --- a/frontend/app/components/Client/Integrations/Integrations.tsx +++ b/frontend/app/components/Client/Integrations/Integrations.tsx @@ -22,9 +22,7 @@ import VueDoc from './VueDoc'; import GraphQLDoc from './GraphQLDoc'; import NgRxDoc from './NgRxDoc'; import MobxDoc from './MobxDoc'; -import FetchDoc from './FetchDoc'; import ProfilerDoc from './ProfilerDoc'; -import AxiosDoc from './AxiosDoc'; import AssistDoc from './AssistDoc'; import { PageTitle } from 'UI'; import AnimatedSVG, { ICONS } from 'Shared/AnimatedSVG/AnimatedSVG'; @@ -170,9 +168,7 @@ const integrations = [ { title: 'GraphQL', slug: '', icon: 'integrations/graphql', component: }, { title: 'NgRx', slug: '', icon: 'integrations/ngrx', component: }, { title: 'MobX', slug: '', icon: 'integrations/mobx', component: }, - { title: 'Fetch', slug: '', icon: 'integrations/openreplay', component: }, { title: 'Profiler', slug: '', icon: 'integrations/openreplay', component: }, - { title: 'Axios', slug: '', icon: 'integrations/openreplay', component: }, { title: 'Assist', slug: '', icon: 'integrations/openreplay', component: }, { title: 'Zustand', slug: '', icon: '', header: '🐻', component: } ], diff --git a/frontend/app/components/Session_/Network/NetworkContent.js b/frontend/app/components/Session_/Network/NetworkContent.js index 8174162c0..5718fb55e 100644 --- a/frontend/app/components/Session_/Network/NetworkContent.js +++ b/frontend/app/components/Session_/Network/NetworkContent.js @@ -76,15 +76,16 @@ const renderXHRText = () => ( - Use our{' '} + Configure{' '} - Fetch plugin + Configure - {' to capture HTTP requests and responses, including status codes and bodies.'}
+ network capturing + {' to see fetch/XHR requests and response payloads.'}
We also provide{' '} Network Request - {isXHR && !fetchPresented && } {isXHR && } {rows && rows.length > 0 && ( diff --git a/frontend/app/components/shared/FetchDetailsModal/components/FetchPluginMessage/FetchPluginMessage.tsx b/frontend/app/components/shared/FetchDetailsModal/components/FetchPluginMessage/FetchPluginMessage.tsx deleted file mode 100644 index 8699b8cb6..000000000 --- a/frontend/app/components/shared/FetchDetailsModal/components/FetchPluginMessage/FetchPluginMessage.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import React from 'react'; -import { Icon } from 'UI'; - -function FetchPluginMessage() { - return ( -
-
- - Get more out of network requests -
-
-
- ); -} - -export default FetchPluginMessage; diff --git a/frontend/app/components/shared/FetchDetailsModal/components/FetchPluginMessage/index.ts b/frontend/app/components/shared/FetchDetailsModal/components/FetchPluginMessage/index.ts deleted file mode 100644 index df224dbbf..000000000 --- a/frontend/app/components/shared/FetchDetailsModal/components/FetchPluginMessage/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { default } from './FetchPluginMessage'; diff --git a/frontend/app/components/shared/FetchDetailsModal/components/FetchTabs/FetchTabs.tsx b/frontend/app/components/shared/FetchDetailsModal/components/FetchTabs/FetchTabs.tsx index f9ed3a745..62b72a473 100644 --- a/frontend/app/components/shared/FetchDetailsModal/components/FetchTabs/FetchTabs.tsx +++ b/frontend/app/components/shared/FetchDetailsModal/components/FetchTabs/FetchTabs.tsx @@ -101,7 +101,15 @@ function FetchTabs({ resource }: Props) { title={
-
Body is Empty.
+
+ Body is Empty. + {' '} + + Configure + + {' '} + network capturing to get more out of fetch/XHR requests. +
} size="small"