File tree Expand file tree Collapse file tree 4 files changed +2
-55
lines changed Expand file tree Collapse file tree 4 files changed +2
-55
lines changed Original file line number Diff line number Diff line change 15
15
"@emotion/react" : " ^11.9.0" ,
16
16
"@mdx-js/loader" : " ^2.1.2" ,
17
17
"@next/mdx" : " ^12.2.0" ,
18
- "@segment/snippet" : " ^4.15.3" ,
19
18
"next" : " 12.2.4" ,
20
19
"react" : " 18.1.0" ,
21
20
"react-dom" : " 18.0.0" ,
Original file line number Diff line number Diff line change 1
1
import { AppProps } from 'next/app'
2
- import Router , { NextRouter , useRouter } from 'next/router'
2
+ import { NextRouter , useRouter } from 'next/router'
3
3
import { ReactChild } from 'react'
4
4
import { ThemeProvider } from 'theme-ui'
5
5
import {
@@ -14,11 +14,6 @@ import { Layout as PlaygroundLayout } from '../components/playground/Layout'
14
14
import { Head } from '../components/Head'
15
15
import '../public/code-styles.css'
16
16
17
- Router . events . on ( 'routeChangeComplete' , ( url ) => {
18
- // @ts -ignore
19
- window ?. analytics ?. page ( url )
20
- } )
21
-
22
17
const NO_NAV_PAGES : Record < string , boolean > = {
23
18
'/playground' : true ,
24
19
'/html-editor' : true ,
Original file line number Diff line number Diff line change @@ -5,38 +5,17 @@ import Document, {
5
5
NextScript ,
6
6
DocumentContext ,
7
7
} from 'next/document'
8
- import * as snippet from '@segment/snippet'
9
-
10
- const ANALYTICS_WRITE_KEY =
11
- process . env . NODE_ENV === 'development'
12
- ? 'l2esDJDa92SQGAtVN9yZY5ByGKYbXhf5'
13
- : 'RMUHme5teZLiDPnqWE6z27snMAHmpFei'
14
8
15
9
export default class CustomDocument extends Document {
16
10
static async getInitialProps ( ctx : DocumentContext ) {
17
11
const initialProps = await Document . getInitialProps ( ctx )
18
12
return { ...initialProps }
19
13
}
20
14
21
- renderSnippet ( ) {
22
- const opts = {
23
- apiKey : ANALYTICS_WRITE_KEY ,
24
- page : true ,
25
- }
26
-
27
- if ( process . env . NODE_ENV === 'development' ) {
28
- return snippet . max ( opts )
29
- }
30
-
31
- return snippet . min ( opts )
32
- }
33
-
34
15
render ( ) {
35
16
return (
36
17
< Html >
37
- < Head >
38
- < script dangerouslySetInnerHTML = { { __html : this . renderSnippet ( ) } } />
39
- </ Head >
18
+ < Head />
40
19
< body >
41
20
< Main />
42
21
< NextScript />
Original file line number Diff line number Diff line change 1011
1011
call-me-maybe "^1.0.1"
1012
1012
glob-to-regexp "^0.3.0"
1013
1013
1014
- " @ndhoule/each@^2.0.1 " :
1015
- version "2.0.1"
1016
- resolved "https://registry.yarnpkg.com/@ndhoule/each/-/each-2.0.1.tgz#bbed372a603e0713a3193c706a73ddebc5b426a9"
1017
- integrity sha1-u+03KmA+BxOjGTxwanPd68W0Jqk=
1018
- dependencies :
1019
- " @ndhoule/keys" " ^2.0.0"
1020
-
1021
- " @ndhoule/keys@^2.0.0 " :
1022
- version "2.0.0"
1023
- resolved "https://registry.yarnpkg.com/@ndhoule/keys/-/keys-2.0.0.tgz#3d64ae677c65a261747bf3a457c62eb292a4e0ce"
1024
- integrity sha1-PWSuZ3xlomF0e/OkV8YuspKk4M4=
1025
-
1026
- " @ndhoule/map@^2.0.1 " :
1027
- version "2.0.1"
1028
- resolved "https://registry.yarnpkg.com/@ndhoule/map/-/map-2.0.1.tgz#f5ca0a47424ea67f46e2a6d499b9e9bc886aefa8"
1029
- integrity sha1-9coKR0JOpn9G4qbUmbnpvIhq76g=
1030
- dependencies :
1031
- " @ndhoule/each" " ^2.0.1"
1032
-
1033
1014
1034
1015
version "12.2.4"
1035
1016
resolved "https://registry.yarnpkg.com/@next/env/-/env-12.2.4.tgz#5ba9bed9970be4113773233148b4539691bfc4fe"
1799
1780
resolved "https://registry.yarnpkg.com/@rushstack/eslint-patch/-/eslint-patch-1.1.3.tgz#6801033be7ff87a6b7cadaf5b337c9f366a3c4b0"
1800
1781
integrity sha512-WiBSI6JBIhC6LRIsB2Kwh8DsGTlbBU+mLRxJmAe3LjHTdkDpwIbEOZgoXBbZilk/vlfjK8i6nKRAvIRn1XaIMw==
1801
1782
1802
- " @segment/snippet@^4.15.3 " :
1803
- version "4.15.3"
1804
- resolved "https://registry.yarnpkg.com/@segment/snippet/-/snippet-4.15.3.tgz#ac829ec4570b249f559756293f4736e434885de7"
1805
- integrity sha512-75kVTYaQGYMkwVjJvCLLOlzxV8jCDxvKG68U88joo/rBx95SIXETcjUmIXF6A7SFRCgz83B+zrZbo+JYsmHkig==
1806
- dependencies :
1807
- " @ndhoule/map" " ^2.0.1"
1808
-
1809
1783
" @sinclair/typebox@^0.23.3 " :
1810
1784
version "0.23.5"
1811
1785
resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.23.5.tgz#93f7b9f4e3285a7a9ade7557d9a8d36809cbc47d"
You can’t perform that action at this time.
0 commit comments