File tree Expand file tree Collapse file tree 3 files changed +33
-1
lines changed Expand file tree Collapse file tree 3 files changed +33
-1
lines changed Original file line number Diff line number Diff line change 30
30
"deadcode" : " ts-prune | grep -v \" .stories\\ |.config\\ |e2e\\ |__mocks__\\ |used in module\\ |testHelpers\\ |typesGenerated\" || echo \" No deadcode found.\" "
31
31
},
32
32
"dependencies" : {
33
+ "@alwaysmeticulous/recorder-loader" : " 2.137.0" ,
33
34
"@emoji-mart/data" : " 1.2.1" ,
34
35
"@emoji-mart/react" : " 1.1.1" ,
35
36
"@emotion/css" : " 11.11.2" ,
Original file line number Diff line number Diff line change 1
1
import { createRoot } from "react-dom/client" ;
2
+ import { tryLoadAndStartRecorder } from "@alwaysmeticulous/recorder-loader" ;
2
3
import { App } from "./App" ;
3
4
4
5
console . info ( ` ▄█▀ ▀█▄
@@ -12,5 +13,28 @@ const element = document.getElementById("root");
12
13
if ( element === null ) {
13
14
throw new Error ( "root element is null" ) ;
14
15
}
16
+
15
17
const root = createRoot ( element ) ;
16
- root . render ( < App /> ) ;
18
+ async function startApp ( ) {
19
+ // Record all sessions on localhost, staging stacks and preview URLs
20
+ if ( isInternal ( ) ) {
21
+ // Start the Meticulous recorder before you initialise your app.
22
+ // Note: all errors are caught and logged, so no need to surround with try/catch
23
+ await tryLoadAndStartRecorder ( {
24
+ projectId : "Y4uHy1qs0B660xxUdrkLPkazUMPr6OuTqYEnShaR" ,
25
+ isProduction : false ,
26
+ } ) ;
27
+ }
28
+
29
+ root . render ( < App /> ) ;
30
+ }
31
+
32
+ function isInternal ( ) {
33
+ return (
34
+ window . location . hostname . indexOf ( "dev.coder.com" ) > - 1 ||
35
+ window . location . hostname . indexOf ( "localhost" ) > - 1 ||
36
+ window . location . hostname . indexOf ( "127.0.0.1" ) > - 1
37
+ ) ;
38
+ }
39
+
40
+ startApp ( ) ;
You can’t perform that action at this time.
0 commit comments