From 8deb37e8b0cdf678b32cb2cb87c21e2252e4c85c Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Mon, 4 Nov 2024 13:56:52 +0100 Subject: [PATCH] change(ui): removed tracker docs promise --- .../Client/Integrations/ProfilerDoc/ProfilerDoc.js | 6 ++---- .../Integrations/Tracker/AssistDoc/AssistNpm.tsx | 6 ++---- .../Integrations/Tracker/GraphQLDoc/GraphQLDoc.js | 6 ++---- .../Client/Integrations/Tracker/MobxDoc/MobxDoc.js | 6 ++---- .../Client/Integrations/Tracker/NgRxDoc/NgRxDoc.js | 6 ++---- .../Integrations/Tracker/PiniaDoc/PiniaDoc.tsx | 6 ++---- .../Client/Integrations/Tracker/ReduxDoc/ReduxDoc.js | 6 ++---- .../Client/Integrations/Tracker/VueDoc/VueDoc.js | 6 ++---- .../OnboardingTabs/InstallDocs/InstallDocs.js | 8 +++----- .../TrackingCodeModal/InstallDocs/InstallDocs.js | 12 +++++------- 10 files changed, 24 insertions(+), 44 deletions(-) diff --git a/frontend/app/components/Client/Integrations/ProfilerDoc/ProfilerDoc.js b/frontend/app/components/Client/Integrations/ProfilerDoc/ProfilerDoc.js index 35abc1eb0..171224871 100644 --- a/frontend/app/components/Client/Integrations/ProfilerDoc/ProfilerDoc.js +++ b/frontend/app/components/Client/Integrations/ProfilerDoc/ProfilerDoc.js @@ -18,8 +18,7 @@ import trackerProfiler from '@openreplay/tracker-profiler'; const tracker = new OpenReplay({ projectKey: '${projectKey}' }); -// .start() returns a promise -tracker.start().then(sessionData => ... ).catch(e => ... ) +tracker.start() //... export const profiler = tracker.use(trackerProfiler()); //... @@ -35,8 +34,7 @@ const tracker = new OpenReplay({ //... function SomeFunctionalComponent() { useEffect(() => { // or componentDidMount in case of Class approach - // .start() returns a promise - tracker.start().then(sessionData => ... ).catch(e => ... ) + tracker.start() }, []) //... export const profiler = tracker.use(trackerProfiler()); diff --git a/frontend/app/components/Client/Integrations/Tracker/AssistDoc/AssistNpm.tsx b/frontend/app/components/Client/Integrations/Tracker/AssistDoc/AssistNpm.tsx index 706a1831c..00fe1cb26 100644 --- a/frontend/app/components/Client/Integrations/Tracker/AssistDoc/AssistNpm.tsx +++ b/frontend/app/components/Client/Integrations/Tracker/AssistDoc/AssistNpm.tsx @@ -10,8 +10,7 @@ import trackerAssist from '@openreplay/tracker-assist'; const tracker = new OpenReplay({ projectKey: '${props.projectKey}', }); -// .start() returns a promise -tracker.start().then(sessionData => ... ).catch(e => ... ) +tracker.start() tracker.use(trackerAssist(options)); // check the list of available options below`; const usageCjs = `import OpenReplay from '@openreplay/tracker/cjs'; @@ -23,8 +22,7 @@ const trackerAssist = tracker.use(trackerAssist(options)); // check the list of //... function MyApp() { useEffect(async () => { // use componentDidMount in case of React Class Component - // .start() returns a promise - tracker.start().then(sessionData => ... ).catch(e => ... ) + tracker.start() }, []) //... }`; diff --git a/frontend/app/components/Client/Integrations/Tracker/GraphQLDoc/GraphQLDoc.js b/frontend/app/components/Client/Integrations/Tracker/GraphQLDoc/GraphQLDoc.js index 2b7bb916a..889ecfd1f 100644 --- a/frontend/app/components/Client/Integrations/Tracker/GraphQLDoc/GraphQLDoc.js +++ b/frontend/app/components/Client/Integrations/Tracker/GraphQLDoc/GraphQLDoc.js @@ -16,8 +16,7 @@ import trackerGraphQL from '@openreplay/tracker-graphql'; const tracker = new OpenReplay({ projectKey: '${projectKey}' }); -// .start() returns a promise -tracker.start().then(sessionData => ... ).catch(e => ... ) +tracker.start() //... export const recordGraphQL = tracker.use(trackerGraphQL());` const usageCjs = `import OpenReplay from '@openreplay/tracker/cjs'; @@ -29,8 +28,7 @@ const tracker = new OpenReplay({ //... function SomeFunctionalComponent() { useEffect(() => { // or componentDidMount in case of Class approach - // .start() returns a promise - tracker.start().then(sessionData => ... ).catch(e => ... ) + tracker.start() }, []) } //... diff --git a/frontend/app/components/Client/Integrations/Tracker/MobxDoc/MobxDoc.js b/frontend/app/components/Client/Integrations/Tracker/MobxDoc/MobxDoc.js index 9c917f876..2541aae2b 100644 --- a/frontend/app/components/Client/Integrations/Tracker/MobxDoc/MobxDoc.js +++ b/frontend/app/components/Client/Integrations/Tracker/MobxDoc/MobxDoc.js @@ -18,8 +18,7 @@ const tracker = new OpenReplay({ projectKey: '${projectKey}' }); tracker.use(trackerMobX()); // check list of available options below -// .start() returns a promise -tracker.start().then(sessionData => ... ).catch(e => ... ); +tracker.start(); ` const mobxUsageCjs = `import OpenReplay from '@openreplay/tracker/cjs'; @@ -32,8 +31,7 @@ tracker.use(trackerMobX()); // check list of available options below //... function SomeFunctionalComponent() { useEffect(() => { // or componentDidMount in case of Class approach - // .start() returns a promise - tracker.start().then(sessionData => ... ).catch(e => ... ) + tracker.start() }, []) }` diff --git a/frontend/app/components/Client/Integrations/Tracker/NgRxDoc/NgRxDoc.js b/frontend/app/components/Client/Integrations/Tracker/NgRxDoc/NgRxDoc.js index e4d199f5b..f960918b6 100644 --- a/frontend/app/components/Client/Integrations/Tracker/NgRxDoc/NgRxDoc.js +++ b/frontend/app/components/Client/Integrations/Tracker/NgRxDoc/NgRxDoc.js @@ -18,8 +18,7 @@ import trackerNgRx from '@openreplay/tracker-ngrx'; const tracker = new OpenReplay({ projectKey: '${projectKey}' }); -// .start() returns a promise -tracker.start().then(sessionData => ... ).catch(e => ... ) +tracker.start() //... const metaReducers = [tracker.use(trackerNgRx())]; // check list of available options below //... @@ -38,8 +37,7 @@ const tracker = new OpenReplay({ //... function SomeFunctionalComponent() { useEffect(() => { // or componentDidMount in case of Class approach - // .start() returns a promise - tracker.start().then(sessionData => ... ).catch(e => ... ) + tracker.start() }, []) //... const metaReducers = [tracker.use(trackerNgRx())]; // check list of available options below diff --git a/frontend/app/components/Client/Integrations/Tracker/PiniaDoc/PiniaDoc.tsx b/frontend/app/components/Client/Integrations/Tracker/PiniaDoc/PiniaDoc.tsx index 71a9cbccb..b63b50fba 100644 --- a/frontend/app/components/Client/Integrations/Tracker/PiniaDoc/PiniaDoc.tsx +++ b/frontend/app/components/Client/Integrations/Tracker/PiniaDoc/PiniaDoc.tsx @@ -21,8 +21,7 @@ import trackerVuex from '@openreplay/tracker-vuex'; const tracker = new OpenReplay({ projectKey: '${projectKey}' }); -// .start() returns a promise -tracker.start().then(sessionData => ... ).catch(e => ... ) +tracker.start() //... const examplePiniaStore = useExamplePiniaStore() // check list of available options below @@ -47,8 +46,7 @@ const tracker = new OpenReplay({ //... // start tracker when the app is mounted -// .start() returns a promise -tracker.start().then(sessionData => ... ).catch(e => ... ) +tracker.start() //... const examplePiniaStore = useExamplePiniaStore() diff --git a/frontend/app/components/Client/Integrations/Tracker/ReduxDoc/ReduxDoc.js b/frontend/app/components/Client/Integrations/Tracker/ReduxDoc/ReduxDoc.js index e782a2298..5c69bec47 100644 --- a/frontend/app/components/Client/Integrations/Tracker/ReduxDoc/ReduxDoc.js +++ b/frontend/app/components/Client/Integrations/Tracker/ReduxDoc/ReduxDoc.js @@ -18,8 +18,7 @@ import trackerRedux from '@openreplay/tracker-redux'; const tracker = new OpenReplay({ projectKey: '${projectKey}' }); -// .start() returns a promise -tracker.start().then(sessionData => ... ).catch(e => ... ) +tracker.start() //... const store = createStore( reducer, @@ -35,8 +34,7 @@ const tracker = new OpenReplay({ //... function SomeFunctionalComponent() { useEffect(() => { // or componentDidMount in case of Class approach - // .start() returns a promise - tracker.start().then(sessionData => ... ).catch(e => ... ) + tracker.start() }, []) //... const store = createStore( diff --git a/frontend/app/components/Client/Integrations/Tracker/VueDoc/VueDoc.js b/frontend/app/components/Client/Integrations/Tracker/VueDoc/VueDoc.js index 1c2ff19c6..f9e23c67a 100644 --- a/frontend/app/components/Client/Integrations/Tracker/VueDoc/VueDoc.js +++ b/frontend/app/components/Client/Integrations/Tracker/VueDoc/VueDoc.js @@ -18,8 +18,7 @@ import trackerVuex from '@openreplay/tracker-vuex'; const tracker = new OpenReplay({ projectKey: '${projectKey}' }); -// .start() returns a promise -tracker.start().then(sessionData => ... ).catch(e => ... ) +tracker.start() //... const store = new Vuex.Store({ //... @@ -35,8 +34,7 @@ const tracker = new OpenReplay({ //... function SomeFunctionalComponent() { useEffect(() => { // or componentDidMount in case of Class approach - // .start() returns a promise - tracker.start().then(sessionData => ... ).catch(e => ... ) + tracker.start() }, []) //... const store = new Vuex.Store({ diff --git a/frontend/app/components/Onboarding/components/OnboardingTabs/InstallDocs/InstallDocs.js b/frontend/app/components/Onboarding/components/OnboardingTabs/InstallDocs/InstallDocs.js index d6114e96d..b30498a82 100644 --- a/frontend/app/components/Onboarding/components/OnboardingTabs/InstallDocs/InstallDocs.js +++ b/frontend/app/components/Onboarding/components/OnboardingTabs/InstallDocs/InstallDocs.js @@ -12,8 +12,7 @@ const tracker = new Tracker({ projectKey: "PROJECT_KEY", ingestPoint: "https://${window.location.hostname}/ingest", }); -// .start() returns a promise -tracker.start().then(sessionData => ... ).catch(e => ... )`; +tracker.start()`; const usageCodeSST = `import Tracker from '@openreplay/tracker/cjs'; const tracker = new Tracker({ @@ -23,8 +22,7 @@ const tracker = new Tracker({ function MyApp() { useEffect(() => { // use componentDidMount in case of React Class Component - // .start() returns a promise - tracker.start().then(sessionData => ... ).catch(e => ... ) + tracker.start() }, []); //... @@ -143,4 +141,4 @@ function InstallDocs({ site }) { ); } -export default InstallDocs; \ No newline at end of file +export default InstallDocs; diff --git a/frontend/app/components/shared/TrackingCodeModal/InstallDocs/InstallDocs.js b/frontend/app/components/shared/TrackingCodeModal/InstallDocs/InstallDocs.js index 972219a16..6187d3fe4 100644 --- a/frontend/app/components/shared/TrackingCodeModal/InstallDocs/InstallDocs.js +++ b/frontend/app/components/shared/TrackingCodeModal/InstallDocs/InstallDocs.js @@ -11,8 +11,7 @@ const tracker = new Tracker({ ingestPoint: "https://${window.location.hostname}/ingest", }); -// .start() returns a promise -tracker.start().then(sessionData => ... ).catch(e => ... )` +tracker.start()` const usageCodeSST = `import Tracker from '@openreplay/tracker/cjs'; const tracker = new Tracker({ @@ -22,8 +21,7 @@ const tracker = new Tracker({ function MyApp() { useEffect(() => { // use componentDidMount in case of React Class Component - // .start() returns a promise - tracker.start().then(sessionData => ... ).catch(e => ... ) + tracker.start() }, []); //... @@ -40,7 +38,7 @@ function InstallDocs({ site }) {
-
+
@@ -49,7 +47,7 @@ function InstallDocs({ site }) {
-
+
See Documentation for the list of available options.
@@ -57,4 +55,4 @@ function InstallDocs({ site }) { ) } -export default InstallDocs \ No newline at end of file +export default InstallDocs