Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Reenable bitdrift (#7405)

authored by

Snow Pettersen and committed by
GitHub
5f9f81f8 8e00f044

+133 -30
+6 -2
app.config.js
··· 226 226 }, 227 227 ], 228 228 'react-native-compressor', 229 - // TODO: Reenable when the build issue is fixed. 230 - // '@bitdrift/react-native', 229 + [ 230 + '@bitdrift/react-native', 231 + { 232 + networkInstrumentation: true, 233 + }, 234 + ], 231 235 './plugins/starterPackAppClipExtension/withStarterPackAppClip.js', 232 236 './plugins/withAndroidManifestPlugin.js', 233 237 './plugins/withAndroidManifestFCMIconPlugin.js',
+1
package.json
··· 55 55 }, 56 56 "dependencies": { 57 57 "@atproto/api": "^0.13.28", 58 + "@bitdrift/react-native": "^0.6.2", 58 59 "@braintree/sanitize-url": "^6.0.2", 59 60 "@discord/bottom-sheet": "bluesky-social/react-native-bottom-sheet", 60 61 "@emoji-mart/react": "^1.1.1",
+20 -24
src/lib/bitdrift.ts
··· 1 - // import {init} from '@bitdrift/react-native' 2 - // import {Statsig} from 'statsig-react-native-expo' 3 - // export {debug, error, info, warn} from '@bitdrift/react-native' 1 + import {init, SessionStrategy} from '@bitdrift/react-native' 2 + import {Statsig} from 'statsig-react-native-expo' 3 + export {debug, error, info, warn} from '@bitdrift/react-native' 4 4 5 - // import {initPromise} from './statsig/statsig' 5 + import {initPromise} from './statsig/statsig' 6 6 7 - // const BITDRIFT_API_KEY = process.env.BITDRIFT_API_KEY 8 - 9 - // initPromise.then(() => { 10 - // let isEnabled = false 11 - // try { 12 - // if (Statsig.checkGate('enable_bitdrift')) { 13 - // isEnabled = true 14 - // } 15 - // } catch (e) { 16 - // // Statsig may complain about it being called too early. 17 - // } 18 - // if (isEnabled && BITDRIFT_API_KEY) { 19 - // init(BITDRIFT_API_KEY, {url: 'https://api-bsky.bitdrift.io'}) 20 - // } 21 - // }) 7 + const BITDRIFT_API_KEY = process.env.BITDRIFT_API_KEY 22 8 23 - // TODO: Reenable when the build issue is fixed. 24 - export function debug(_message: string) {} 25 - export function error(_message: string) {} 26 - export function info(_message: string) {} 27 - export function warn(_message: string) {} 9 + initPromise.then(() => { 10 + let isEnabled = false 11 + try { 12 + if (Statsig.checkGate('enable_bitdrift')) { 13 + isEnabled = true 14 + } 15 + } catch (e) { 16 + // Statsig may complain about it being called too early. 17 + } 18 + if (isEnabled && BITDRIFT_API_KEY) { 19 + init(BITDRIFT_API_KEY, SessionStrategy.Activity, { 20 + url: 'https://api-bsky.bitdrift.io', 21 + }) 22 + } 23 + })
+2 -4
src/lib/statsig/statsig.tsx
··· 5 5 import {Statsig, StatsigProvider} from 'statsig-react-native-expo' 6 6 7 7 import {BUNDLE_DATE, BUNDLE_IDENTIFIER, IS_TESTFLIGHT} from '#/lib/app-info' 8 - // TODO: Reenable when the build issue is fixed. 9 - // import * as bitdrift from '#/lib/bitdrift' 8 + import * as bitdrift from '#/lib/bitdrift' 10 9 import {logger} from '#/logger' 11 10 import {isWeb} from '#/platform/detection' 12 11 import * as persisted from '#/state/persisted' ··· 108 107 console.groupCollapsed(eventName) 109 108 console.log(fullMetadata) 110 109 console.groupEnd() 111 - // TODO: Reenable when the build issue is fixed. 112 - // bitdrift.info(eventName, fullMetadata) 110 + bitdrift.info(eventName, fullMetadata) 113 111 } catch (e) { 114 112 // A log should never interrupt the calling code, whatever happens. 115 113 logger.error('Failed to log an event', {message: e})
+104
yarn.lock
··· 3422 3422 resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" 3423 3423 integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== 3424 3424 3425 + "@bitdrift/react-native@^0.6.2": 3426 + version "0.6.2" 3427 + resolved "https://registry.yarnpkg.com/@bitdrift/react-native/-/react-native-0.6.2.tgz#8e75d45a63fccad38b310fdea8069fa929cb97c3" 3428 + integrity sha512-4DIsZwAr9/Q1RI7lsnUphRoMuOuLWWESNXI759niSmU8XHTJISwwOQzUm7qWn7waBJGhxaq+jn+vlTV5Fai6zw== 3429 + dependencies: 3430 + "@expo/config-plugins" "^9.0.14" 3431 + fast-json-stringify "^6.0.0" 3432 + 3425 3433 "@braintree/sanitize-url@^6.0.2": 3426 3434 version "6.0.4" 3427 3435 resolved "https://registry.yarnpkg.com/@braintree/sanitize-url/-/sanitize-url-6.0.4.tgz#923ca57e173c6b232bbbb07347b1be982f03e783" ··· 3838 3846 xcode "^3.0.1" 3839 3847 xml2js "0.6.0" 3840 3848 3849 + "@expo/config-plugins@^9.0.14": 3850 + version "9.0.14" 3851 + resolved "https://registry.yarnpkg.com/@expo/config-plugins/-/config-plugins-9.0.14.tgz#c57cc86c238b276823ff66d96e4722366d57b12c" 3852 + integrity sha512-Lx1ebV95rTFKKQmbu4wMPLz65rKn7mqSpfANdCx+KwRxuLY2JQls8V4h3lQjG6dW8NWf9qV5QaEFAgNB6VMyOQ== 3853 + dependencies: 3854 + "@expo/config-types" "^52.0.3" 3855 + "@expo/json-file" "~9.0.1" 3856 + "@expo/plist" "^0.2.1" 3857 + "@expo/sdk-runtime-versions" "^1.0.0" 3858 + chalk "^4.1.2" 3859 + debug "^4.3.5" 3860 + getenv "^1.0.0" 3861 + glob "^10.4.2" 3862 + resolve-from "^5.0.0" 3863 + semver "^7.5.4" 3864 + slash "^3.0.0" 3865 + slugify "^1.6.6" 3866 + xcode "^3.0.1" 3867 + xml2js "0.6.0" 3868 + 3841 3869 "@expo/config-plugins@~9.0.12": 3842 3870 version "9.0.12" 3843 3871 resolved "https://registry.yarnpkg.com/@expo/config-plugins/-/config-plugins-9.0.12.tgz#f122b2dca22e135eadf6e73442da3ced0ce8aa0a" ··· 3863 3891 resolved "https://registry.yarnpkg.com/@expo/config-types/-/config-types-52.0.1.tgz#327af1b72a3a9d4556f41e083e0e284dd8198b96" 3864 3892 integrity sha512-vD8ZetyKV7U29lR6+NJohYeoLYTH+eNYXJeNiSOrWCz0witJYY11meMmEnpEaVbN89EfC6uauSUOa6wihtbyPQ== 3865 3893 3894 + "@expo/config-types@^52.0.3": 3895 + version "52.0.3" 3896 + resolved "https://registry.yarnpkg.com/@expo/config-types/-/config-types-52.0.3.tgz#511f2f868172c93abeac7183beeb921dc72d6e1e" 3897 + integrity sha512-muxvuARmbysH5OGaiBRlh1Y6vfdmL56JtpXxB+y2Hfhu0ezG1U4FjZYBIacthckZPvnDCcP3xIu1R+eTo7/QFA== 3898 + 3866 3899 "@expo/config@~10.0.4": 3867 3900 version "10.0.5" 3868 3901 resolved "https://registry.yarnpkg.com/@expo/config/-/config-10.0.5.tgz#2de75e3f5d46a55f9f5140b73e0913265e6a41c6" ··· 3986 4019 json5 "^2.2.3" 3987 4020 write-file-atomic "^2.3.0" 3988 4021 4022 + "@expo/json-file@~9.0.1": 4023 + version "9.0.1" 4024 + resolved "https://registry.yarnpkg.com/@expo/json-file/-/json-file-9.0.1.tgz#ff60654caf1fa3c33f9b17dcd1e9691eb854a318" 4025 + integrity sha512-ZVPhbbEBEwafPCJ0+kI25O2Iivt3XKHEKAADCml1q2cmOIbQnKgLyn8DpOJXqWEyRQr/VWS+hflBh8DU2YFSqg== 4026 + dependencies: 4027 + "@babel/code-frame" "~7.10.4" 4028 + json5 "^2.2.3" 4029 + write-file-atomic "^2.3.0" 4030 + 3989 4031 "@expo/metro-config@0.19.8", "@expo/metro-config@~0.19.8": 3990 4032 version "0.19.8" 3991 4033 resolved "https://registry.yarnpkg.com/@expo/metro-config/-/metro-config-0.19.8.tgz#f1ea552b6fa5217093fe364ff5ca78a7e261a28b" ··· 4040 4082 version "0.2.0" 4041 4083 resolved "https://registry.yarnpkg.com/@expo/plist/-/plist-0.2.0.tgz#beb014c0bfd56a993086c0972ec1ca3ef3f9d36c" 4042 4084 integrity sha512-F/IZJQaf8OIVnVA6XWUeMPC3OH6MV00Wxf0WC0JhTQht2QgjyHUa3U5Gs3vRtDq8tXNsZneOQRDVwpaOnd4zTQ== 4085 + dependencies: 4086 + "@xmldom/xmldom" "~0.7.7" 4087 + base64-js "^1.2.3" 4088 + xmlbuilder "^14.0.0" 4089 + 4090 + "@expo/plist@^0.2.1": 4091 + version "0.2.1" 4092 + resolved "https://registry.yarnpkg.com/@expo/plist/-/plist-0.2.1.tgz#a315e1964ee9eece5c56040d460db5de7af85889" 4093 + integrity sha512-9TaXGuNxa0LQwHQn4rYiU6YaERv6dPnQgsdKWq2rKKTr6LWOtGNQCi/yOk/HBLeZSxBm59APT5/6x60uRvr0Mg== 4043 4094 dependencies: 4044 4095 "@xmldom/xmldom" "~0.7.7" 4045 4096 base64-js "^1.2.3" ··· 4140 4191 resolved "https://registry.yarnpkg.com/@fastify/deepmerge/-/deepmerge-1.3.0.tgz#8116858108f0c7d9fd460d05a7d637a13fe3239a" 4141 4192 integrity sha512-J8TOSBq3SoZbDhM9+R/u77hP93gz/rajSA+K2kGyijPpORPWUXHUpTaleoj+92As0S9uPRP7Oi8IqMf0u+ro6A== 4142 4193 4194 + "@fastify/merge-json-schemas@^0.2.0": 4195 + version "0.2.1" 4196 + resolved "https://registry.yarnpkg.com/@fastify/merge-json-schemas/-/merge-json-schemas-0.2.1.tgz#3aa30d2f0c81a8ac5995b6d94ed4eaa2c3055824" 4197 + integrity sha512-OA3KGBCy6KtIvLf8DINC5880o5iBlDX4SxzLQS8HorJAbqluzLRn80UXU0bxZn7UOFhFgpRJDasfwn9nG4FG4A== 4198 + dependencies: 4199 + dequal "^2.0.3" 4200 + 4143 4201 "@floating-ui/core@^0.7.3": 4144 4202 version "0.7.3" 4145 4203 resolved "https://registry.yarnpkg.com/@floating-ui/core/-/core-0.7.3.tgz#d274116678ffae87f6b60e90f88cc4083eefab86" ··· 7542 7600 dependencies: 7543 7601 ajv "^8.0.0" 7544 7602 7603 + ajv-formats@^3.0.1: 7604 + version "3.0.1" 7605 + resolved "https://registry.yarnpkg.com/ajv-formats/-/ajv-formats-3.0.1.tgz#3d5dc762bca17679c3c2ea7e90ad6b7532309578" 7606 + integrity sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ== 7607 + dependencies: 7608 + ajv "^8.0.0" 7609 + 7545 7610 ajv-keywords@^3.5.2: 7546 7611 version "3.5.2" 7547 7612 resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.5.2.tgz#31f29da5ab6e00d1c2d329acf7b5929614d5014d" ··· 7583 7648 json-schema-traverse "^1.0.0" 7584 7649 require-from-string "^2.0.2" 7585 7650 uri-js "^4.2.2" 7651 + 7652 + ajv@^8.12.0: 7653 + version "8.17.1" 7654 + resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.17.1.tgz#37d9a5c776af6bc92d7f4f9510eba4c0a60d11a6" 7655 + integrity sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g== 7656 + dependencies: 7657 + fast-deep-equal "^3.1.3" 7658 + fast-uri "^3.0.1" 7659 + json-schema-traverse "^1.0.0" 7660 + require-from-string "^2.0.2" 7586 7661 7587 7662 anser@^1.4.9: 7588 7663 version "1.4.10" ··· 9542 9617 invariant "^2.2.4" 9543 9618 prop-types "^15.8.1" 9544 9619 9620 + dequal@^2.0.3: 9621 + version "2.0.3" 9622 + resolved "https://registry.yarnpkg.com/dequal/-/dequal-2.0.3.tgz#2644214f1997d39ed0ee0ece72335490a7ac67be" 9623 + integrity sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA== 9624 + 9545 9625 destroy@1.2.0: 9546 9626 version "1.2.0" 9547 9627 resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.2.0.tgz#4803735509ad8be552934c67df614f94e66fa015" ··· 10856 10936 fast-uri "^2.1.0" 10857 10937 rfdc "^1.2.0" 10858 10938 10939 + fast-json-stringify@^6.0.0: 10940 + version "6.0.1" 10941 + resolved "https://registry.yarnpkg.com/fast-json-stringify/-/fast-json-stringify-6.0.1.tgz#82f1cb45fa96d0ca24b601f1738066976d6e2430" 10942 + integrity sha512-s7SJE83QKBZwg54dIbD5rCtzOBVD43V1ReWXXYqBgwCwHLYAAT0RQc/FmrQglXqWPpz6omtryJQOau5jI4Nrvg== 10943 + dependencies: 10944 + "@fastify/merge-json-schemas" "^0.2.0" 10945 + ajv "^8.12.0" 10946 + ajv-formats "^3.0.1" 10947 + fast-uri "^3.0.0" 10948 + json-schema-ref-resolver "^2.0.0" 10949 + rfdc "^1.2.0" 10950 + 10859 10951 fast-levenshtein@^2.0.6: 10860 10952 version "2.0.6" 10861 10953 resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" ··· 10887 10979 version "2.2.0" 10888 10980 resolved "https://registry.yarnpkg.com/fast-uri/-/fast-uri-2.2.0.tgz#519a0f849bef714aad10e9753d69d8f758f7445a" 10889 10981 integrity sha512-cIusKBIt/R/oI6z/1nyfe2FvGKVTohVRfvkOhvx0nCEW+xf5NoCXjAHcWp93uOUBchzYcsvPlrapAdX1uW+YGg== 10982 + 10983 + fast-uri@^3.0.0, fast-uri@^3.0.1: 10984 + version "3.0.6" 10985 + resolved "https://registry.yarnpkg.com/fast-uri/-/fast-uri-3.0.6.tgz#88f130b77cfaea2378d56bf970dea21257a68748" 10986 + integrity sha512-Atfo14OibSv5wAp4VWNsFYE1AchQRTv9cBGWET4pZWHzYshFSS9NQI6I57rdKn9croWVMbYFbLhJ+yJvmZIIHw== 10890 10987 10891 10988 fast-xml-parser@4.2.5: 10892 10989 version "4.2.5" ··· 13188 13285 version "2.3.1" 13189 13286 resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" 13190 13287 integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== 13288 + 13289 + json-schema-ref-resolver@^2.0.0: 13290 + version "2.0.1" 13291 + resolved "https://registry.yarnpkg.com/json-schema-ref-resolver/-/json-schema-ref-resolver-2.0.1.tgz#c92f16b452df069daac53e1984159e0f9af0598d" 13292 + integrity sha512-HG0SIB9X4J8bwbxCbnd5FfPEbcXAJYTi1pBJeP/QPON+w8ovSME8iRG+ElHNxZNX2Qh6eYn1GdzJFS4cDFfx0Q== 13293 + dependencies: 13294 + dequal "^2.0.3" 13191 13295 13192 13296 json-schema-traverse@^0.4.1: 13193 13297 version "0.4.1"