From 3536b9da362ec8ebdb1debce3ad4435c4bc0560f Mon Sep 17 00:00:00 2001 From: Brian Lovin Date: Tue, 31 Dec 2019 10:28:17 -0700 Subject: [PATCH] Update fathom --- package.json | 2 +- pages/_app.js | 16 ++++++++-------- yarn.lock | 8 ++++---- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index 11aac38..7e9051a 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "lint:staged": "lint-staged" }, "dependencies": { - "fathom-client": "^1.0.0", + "fathom-client": "^2.0.2", "next": "^9.1.6", "next-seo": "^3.2.0", "react": "^16.12.0", diff --git a/pages/_app.js b/pages/_app.js index fa98c92..9df89a1 100644 --- a/pages/_app.js +++ b/pages/_app.js @@ -1,19 +1,19 @@ import * as React from 'react' import App from 'next/app'; -import Fathom from 'fathom-client' +import { trackPageview, load, setSiteId } from 'fathom-client' import Router from 'next/router' import Providers from '../components/Providers'; Router.events.on('routeChangeComplete', () => { - Fathom.trackPageview() + trackPageview() }) -function FathomWrapper(props) { +function FathomProvider(props) { React.useEffect(() => { if (process.env.NODE_ENV === 'production') { - Fathom.load(); - Fathom.setSiteId('ESMHTGZE'); - Fathom.trackPageview(); + load(); + setSiteId('ESMHTGZE'); + trackPageview(); } }, []) return
@@ -23,11 +23,11 @@ class MyApp extends App { render() { const { Component, pageProps } = this.props; return ( - + - + ); } } diff --git a/yarn.lock b/yarn.lock index 7c68cdf..aacf1b1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3822,10 +3822,10 @@ fastq@^1.6.0: dependencies: reusify "^1.0.0" -fathom-client@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fathom-client/-/fathom-client-1.0.0.tgz#de3127a9555081983654375789e665cc2e938c74" - integrity sha512-YUJJHGOm9KOIjoZDnQeCCPOKu28t6k+hPD49rGAV1/HTknAIDb8J2u5foPg2JgsWcB4ORvJjN/7xSTUPvRK4/Q== +fathom-client@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/fathom-client/-/fathom-client-2.0.2.tgz#83c66b9c0111478ff75004563ea58f8dcf692c2d" + integrity sha512-2OvYKIuuSKwx658rSPwTMDXmRLUdNh4N2KzQCUHJUTVaCdK1Tv49zeJd3ovgIeont/r+1wk/7Ri/sMzoHY5MXw== fd-slicer@~1.0.1: version "1.0.1"