From 411c02dcc85ed26808198eb35979d8b5c648085e Mon Sep 17 00:00:00 2001 From: James Burnside <2684369+JamesBurnside@users.noreply.github.com> Date: Tue, 3 Sep 2024 13:49:07 -0700 Subject: [PATCH] Fix react render tracker (#5087) --- samples/CallWithChat/public/index.html | 15 ++++++++++++++- samples/CallWithChat/src/app/utils/AppUtils.ts | 15 --------------- samples/CallWithChat/src/index.tsx | 3 --- samples/Calling/public/index.html | 15 ++++++++++++++- samples/Calling/src/app/utils/AppUtils.ts | 15 --------------- samples/Calling/src/app/views/HomeScreen.tsx | 2 +- samples/Calling/src/index.tsx | 3 --- samples/Chat/public/index.html | 15 ++++++++++++++- samples/Chat/src/app/utils/utils.ts | 15 --------------- samples/Chat/src/index.tsx | 3 --- 10 files changed, 43 insertions(+), 58 deletions(-) diff --git a/samples/CallWithChat/public/index.html b/samples/CallWithChat/public/index.html index 91fcd182108..787fa393d56 100644 --- a/samples/CallWithChat/public/index.html +++ b/samples/CallWithChat/public/index.html @@ -1,13 +1,26 @@  - + UI Library Call With Chat Sample + + + diff --git a/samples/CallWithChat/src/app/utils/AppUtils.ts b/samples/CallWithChat/src/app/utils/AppUtils.ts index c1f93092d85..b520f7cb8ad 100644 --- a/samples/CallWithChat/src/app/utils/AppUtils.ts +++ b/samples/CallWithChat/src/app/utils/AppUtils.ts @@ -23,21 +23,6 @@ export const fetchTokenResponse = async (): Promise => { throw 'Invalid token response'; }; -/** - * Init React Render Tracker whenever it detects the query param 'rrt' is set to true. - */ -export const initReactRenderTracker = (): void => { - const urlParams = new URLSearchParams(window.location.search); - const isEnabled = urlParams.get('rrt'); - if (isEnabled !== 'true') { - return; - } - - const script = document.createElement('script'); - script.src = 'https://cdn.jsdelivr.net/npm/react-render-tracker'; - document.head.appendChild(script); -}; - /** * Get group id from the url's query params. */ diff --git a/samples/CallWithChat/src/index.tsx b/samples/CallWithChat/src/index.tsx index b42ea94789a..73dfed81a5c 100644 --- a/samples/CallWithChat/src/index.tsx +++ b/samples/CallWithChat/src/index.tsx @@ -7,15 +7,12 @@ import './index.css'; import App from './app/App'; import { SwitchableFluentThemeProvider } from './app/theming/SwitchableFluentThemeProvider'; import { ShakeToSendLogs } from './app/utils/ShakeToSendLogs'; -import { initReactRenderTracker } from './app/utils/AppUtils'; const domNode = document.getElementById('root'); if (!domNode) { throw new Error('Failed to find the root element'); } -initReactRenderTracker(); - createRoot(domNode).render( diff --git a/samples/Calling/public/index.html b/samples/Calling/public/index.html index f5476cfde0b..8829e47f48f 100644 --- a/samples/Calling/public/index.html +++ b/samples/Calling/public/index.html @@ -1,13 +1,26 @@  - + UI Library Calling Sample + + + diff --git a/samples/Calling/src/app/utils/AppUtils.ts b/samples/Calling/src/app/utils/AppUtils.ts index 56728b0abc5..0f9d03fb497 100644 --- a/samples/Calling/src/app/utils/AppUtils.ts +++ b/samples/Calling/src/app/utils/AppUtils.ts @@ -39,21 +39,6 @@ export const getGroupIdFromUrl = (): GroupLocator | undefined => { return gid ? { groupId: gid } : undefined; }; -/** - * Init React Render Tracker whenever it detects the query param 'rrt' is set to true. - */ -export const initReactRenderTracker = (): void => { - const urlParams = new URLSearchParams(window.location.search); - const isEnabled = urlParams.get('rrt'); - if (isEnabled !== 'true') { - return; - } - - const script = document.createElement('script'); - script.src = 'https://cdn.jsdelivr.net/npm/react-render-tracker'; - document.head.appendChild(script); -}; - export const createGroupId = (): GroupLocator => ({ groupId: generateGUID() }); /** diff --git a/samples/Calling/src/app/views/HomeScreen.tsx b/samples/Calling/src/app/views/HomeScreen.tsx index 230c9142266..890ca23781f 100644 --- a/samples/Calling/src/app/views/HomeScreen.tsx +++ b/samples/Calling/src/app/views/HomeScreen.tsx @@ -79,7 +79,7 @@ type ICallChoiceGroupOption = IChoiceGroupOption & { key: CallOption }; export const HomeScreen = (props: HomeScreenProps): JSX.Element => { const imageProps = { src: heroSVG.toString() }; - const headerTitle = props.joiningExistingCall ? 'Join Call' : 'Start or join a call'; + const headerTitle = props.joiningExistingCall ? 'Join Call' : 'Start or join a call!'; const callOptionsGroupLabel = 'Select a call option'; const buttonText = 'Next'; const callOptions: ICallChoiceGroupOption[] = [ diff --git a/samples/Calling/src/index.tsx b/samples/Calling/src/index.tsx index 7264f86a0e6..9e7662bd463 100644 --- a/samples/Calling/src/index.tsx +++ b/samples/Calling/src/index.tsx @@ -7,15 +7,12 @@ import './index.css'; import App from './app/App'; import { SwitchableFluentThemeProvider } from './app/theming/SwitchableFluentThemeProvider'; import { ShakeToSendLogs } from './app/utils/ShakeToSendLogs'; -import { initReactRenderTracker } from './app/utils/AppUtils'; const domNode = document.getElementById('root'); if (!domNode) { throw new Error('Failed to find the root element'); } -initReactRenderTracker(); - createRoot(domNode).render( diff --git a/samples/Chat/public/index.html b/samples/Chat/public/index.html index be9fe143123..b58f8f11685 100644 --- a/samples/Chat/public/index.html +++ b/samples/Chat/public/index.html @@ -1,7 +1,7 @@ - + @@ -9,6 +9,19 @@ ACS Chat Sample App + + +
diff --git a/samples/Chat/src/app/utils/utils.ts b/samples/Chat/src/app/utils/utils.ts index 1135671b5bf..73c770c14d2 100644 --- a/samples/Chat/src/app/utils/utils.ts +++ b/samples/Chat/src/app/utils/utils.ts @@ -49,18 +49,3 @@ export const getBackgroundColor = (avatar: string): { backgroundColor: string } }; } }; - -/** - * Init React Render Tracker whenever it detects the query param 'rrt' is set to true. - */ -export const initReactRenderTracker = (): void => { - const urlParams = new URLSearchParams(window.location.search); - const isEnabled = urlParams.get('rrt'); - if (isEnabled !== 'true') { - return; - } - - const script = document.createElement('script'); - script.src = 'https://cdn.jsdelivr.net/npm/react-render-tracker'; - document.head.appendChild(script); -}; diff --git a/samples/Chat/src/index.tsx b/samples/Chat/src/index.tsx index 076e9f54099..2457be6dfe7 100644 --- a/samples/Chat/src/index.tsx +++ b/samples/Chat/src/index.tsx @@ -7,15 +7,12 @@ import './index.css'; import App from './app/App'; import { SwitchableFluentThemeProvider } from './app/theming/SwitchableFluentThemeProvider'; import { ShakeToSendLogs } from './app/utils/ShakeToSendLogs'; -import { initReactRenderTracker } from './app/utils/utils'; const domNode = document.getElementById('root'); if (!domNode) { throw new Error('Failed to find the root element'); } -initReactRenderTracker(); - createRoot(domNode).render(