From 72de203c8148674667b06aeeb5b3f710f9f17574 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Thu, 19 Dec 2024 01:01:07 +0000 Subject: [PATCH] Temporarily remove Bitdrift --- package.json | 1 - src/lib/bitdrift.ts | 42 +++++++++++++++++++++---------------- src/lib/statsig/statsig.tsx | 6 ++++-- 3 files changed, 28 insertions(+), 21 deletions(-) diff --git a/package.json b/package.json index ff2223b489..b7fdf1177e 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,6 @@ }, "dependencies": { "@atproto/api": "^0.13.21", - "@bitdrift/react-native": "0.4.0", "@braintree/sanitize-url": "^6.0.2", "@discord/bottom-sheet": "bluesky-social/react-native-bottom-sheet", "@emoji-mart/react": "^1.1.1", diff --git a/src/lib/bitdrift.ts b/src/lib/bitdrift.ts index 3f892f6b8c..f11da6f3b2 100644 --- a/src/lib/bitdrift.ts +++ b/src/lib/bitdrift.ts @@ -1,21 +1,27 @@ -import {init} from '@bitdrift/react-native' -import {Statsig} from 'statsig-react-native-expo' -export {debug, error, info, warn} from '@bitdrift/react-native' +// import {init} from '@bitdrift/react-native' +// import {Statsig} from 'statsig-react-native-expo' +// export {debug, error, info, warn} from '@bitdrift/react-native' -import {initPromise} from './statsig/statsig' +// import {initPromise} from './statsig/statsig' -const BITDRIFT_API_KEY = process.env.BITDRIFT_API_KEY +// const BITDRIFT_API_KEY = process.env.BITDRIFT_API_KEY -initPromise.then(() => { - let isEnabled = false - try { - if (Statsig.checkGate('enable_bitdrift')) { - isEnabled = true - } - } catch (e) { - // Statsig may complain about it being called too early. - } - if (isEnabled && BITDRIFT_API_KEY) { - init(BITDRIFT_API_KEY, {url: 'https://api-bsky.bitdrift.io'}) - } -}) +// initPromise.then(() => { +// let isEnabled = false +// try { +// if (Statsig.checkGate('enable_bitdrift')) { +// isEnabled = true +// } +// } catch (e) { +// // Statsig may complain about it being called too early. +// } +// if (isEnabled && BITDRIFT_API_KEY) { +// init(BITDRIFT_API_KEY, {url: 'https://api-bsky.bitdrift.io'}) +// } +// }) + +// TODO: Reenable when the build issue is fixed. +export function debug(_message: string) {} +export function error(_message: string) {} +export function info(_message: string) {} +export function warn(_message: string) {} diff --git a/src/lib/statsig/statsig.tsx b/src/lib/statsig/statsig.tsx index e0882806d5..e59196f669 100644 --- a/src/lib/statsig/statsig.tsx +++ b/src/lib/statsig/statsig.tsx @@ -5,7 +5,8 @@ import {sha256} from 'js-sha256' import {Statsig, StatsigProvider} from 'statsig-react-native-expo' import {BUNDLE_DATE, BUNDLE_IDENTIFIER, IS_TESTFLIGHT} from '#/lib/app-info' -import * as bitdrift from '#/lib/bitdrift' +// TODO: Reenable when the build issue is fixed. +// import * as bitdrift from '#/lib/bitdrift' import {logger} from '#/logger' import {isWeb} from '#/platform/detection' import * as persisted from '#/state/persisted' @@ -107,7 +108,8 @@ export function logEvent( console.groupCollapsed(eventName) console.log(fullMetadata) console.groupEnd() - bitdrift.info(eventName, fullMetadata) + // TODO: Reenable when the build issue is fixed. + // bitdrift.info(eventName, fullMetadata) } catch (e) { // A log should never interrupt the calling code, whatever happens. logger.error('Failed to log an event', {message: e})