From 9c36052c2aae2f5ea44fb83d8e03717b86832a66 Mon Sep 17 00:00:00 2001 From: Zhiyuan Zheng Date: Thu, 28 Jan 2021 01:31:19 +0100 Subject: [PATCH] Removed expo blurhash --- ios/Podfile.lock | 21 +- package.json | 7 +- src/components/GracefullyImage.tsx | 11 +- .../Timeline/Shared/Attachment/Audio.tsx | 14 +- .../Shared/Attachment/Unsupported.tsx | 10 +- .../Timeline/Shared/Attachment/Video.tsx | 10 +- yarn.lock | 253 +----------------- 7 files changed, 36 insertions(+), 290 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index a18712e5..1e7db969 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -31,13 +31,6 @@ PODS: - EXFont (8.4.0): - UMCore - UMFontInterface - - EXGL (9.2.0): - - EXGL_CPP - - UMCameraInterface - - UMCore - - UMFileSystemInterface - - EXGL_CPP (9.2.0): - - React-jsi - EXHaptics (8.4.0): - UMCore - EXImageLoader (1.3.0): @@ -339,6 +332,8 @@ PODS: - React-cxxreact (= 0.63.4) - React-jsi (= 0.63.4) - React-jsinspector (0.63.4) + - react-native-blurhash (1.0.29): + - React - react-native-netinfo (5.9.10): - React-Core - react-native-safe-area-context (3.1.9): @@ -494,8 +489,6 @@ DEPENDENCIES: - EXFirebaseAnalytics (from `../node_modules/expo-firebase-analytics/ios`) - EXFirebaseCore (from `../node_modules/expo-firebase-core/ios`) - EXFont (from `../node_modules/expo-font/ios`) - - EXGL (from `../node_modules/expo-gl/ios`) - - EXGL_CPP (from `../node_modules/expo-gl-cpp/cpp`) - EXHaptics (from `../node_modules/expo-haptics/ios`) - EXImageLoader (from `../node_modules/expo-image-loader/ios`) - EXImagePicker (from `../node_modules/expo-image-picker/ios`) @@ -528,6 +521,7 @@ DEPENDENCIES: - React-jsi (from `../node_modules/react-native/ReactCommon/jsi`) - React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`) - React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`) + - react-native-blurhash (from `../node_modules/react-native-blurhash`) - "react-native-netinfo (from `../node_modules/@react-native-community/netinfo`)" - react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`) - "react-native-segmented-control (from `../node_modules/@react-native-community/segmented-control`)" @@ -610,10 +604,6 @@ EXTERNAL SOURCES: :path: "../node_modules/expo-firebase-core/ios" EXFont: :path: "../node_modules/expo-font/ios" - EXGL: - :path: "../node_modules/expo-gl/ios" - EXGL_CPP: - :path: "../node_modules/expo-gl-cpp/cpp" EXHaptics: :path: "../node_modules/expo-haptics/ios" EXImageLoader: @@ -674,6 +664,8 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native/ReactCommon/jsiexecutor" React-jsinspector: :path: "../node_modules/react-native/ReactCommon/jsinspector" + react-native-blurhash: + :path: "../node_modules/react-native-blurhash" react-native-netinfo: :path: "../node_modules/@react-native-community/netinfo" react-native-safe-area-context: @@ -761,8 +753,6 @@ SPEC CHECKSUMS: EXFirebaseAnalytics: d72f553dc0c0a8ee451714499fac21883c3f7369 EXFirebaseCore: f986c71bdd1cb5941c9cfa686b2395fe588a53d0 EXFont: 30c64ed8735a180e3f20046e4fdac4ea074d71d3 - EXGL: aee7cdf7dab9e94d46a3701ac557163f4e82e049 - EXGL_CPP: 0e622b8251cb739f8fcdfa9abb9944bea0452119 EXHaptics: 6d2e09387f0eb4d3c8dc97ae905cbea8afe33651 EXImageLoader: f96ec9992733a4224418bbd9382e5485c8948944 EXImagePicker: 82fb929fb57b38de8d0a2d7fc3ca49726b9b8f78 @@ -806,6 +796,7 @@ SPEC CHECKSUMS: React-jsi: a0418934cf48f25b485631deb27c64dc40fb4c31 React-jsiexecutor: 93bd528844ad21dc07aab1c67cb10abae6df6949 React-jsinspector: 58aef7155bc9a9683f5b60b35eccea8722a4f53a + react-native-blurhash: 90886ae897cafbbdf2773cb3654656bcb34e8f43 react-native-netinfo: 30fb89fa913c342be82a887b56e96be6d71201dd react-native-safe-area-context: b6e0e284002381d2ff29fa4fff42b4d8282e3c94 react-native-segmented-control: eb9e25fbfbce226ecf66d643428fbe97601e691a diff --git a/package.json b/package.json index 6e3aacf7..5c0cd633 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,6 @@ "@sentry/react-native": "^2.1.1", "@sharcoux/slider": "^5.0.1", "axios": "^0.21.1", - "buffer": "^6.0.3", "expo": "^40.0.0", "expo-auth-session": "~3.0.0", "expo-av": "~8.7.0", @@ -31,7 +30,6 @@ "expo-crypto": "~8.4.0", "expo-firebase-analytics": "~2.6.0", "expo-firebase-core": "~1.3.0", - "expo-gl": "~9.2.0", "expo-haptics": "~8.4.0", "expo-image-picker": "~9.2.0", "expo-linear-gradient": "~8.4.0", @@ -45,9 +43,6 @@ "expo-updates": "~0.4.0", "expo-video-thumbnails": "~4.4.0", "expo-web-browser": "~8.6.0", - "gl-react": "^4.0.1", - "gl-react-blurhash": "^1.0.0", - "gl-react-expo": "^4.0.1", "i18next": "^19.8.4", "lodash": "^4.17.20", "react": "16.13.1", @@ -55,6 +50,7 @@ "react-i18next": "^11.8.5", "react-native": "~0.63.4", "react-native-animated-spinkit": "^1.4.2", + "react-native-blurhash": "^1.0.29", "react-native-fast-image": "^8.3.4", "react-native-feather": "^1.0.2", "react-native-gesture-handler": "~1.8.0", @@ -89,7 +85,6 @@ "@testing-library/react-hooks": "^3.7.0", "@testing-library/react-native": "^7.1.0", "@types/crypto-js": "^4.0.1", - "@types/gl-react-expo": "^3.16.2", "@types/jest": "^26.0.19", "@types/lodash": "^4.14.164", "@types/react": "~16.9.35", diff --git a/src/components/GracefullyImage.tsx b/src/components/GracefullyImage.tsx index dca51fd7..a87b0bcf 100644 --- a/src/components/GracefullyImage.tsx +++ b/src/components/GracefullyImage.tsx @@ -1,6 +1,4 @@ import { StyleConstants } from '@utils/styles/constants' -import { Surface } from 'gl-react-expo' -import { Blurhash } from 'gl-react-blurhash' import React, { useCallback, useState } from 'react' import { ImageStyle, @@ -9,6 +7,7 @@ import { StyleSheet, ViewStyle } from 'react-native' +import { Blurhash } from 'react-native-blurhash' import FastImage from 'react-native-fast-image' import { useTheme } from '@utils/styles/ThemeManager' @@ -43,7 +42,9 @@ const GracefullyImage: React.FC = ({ onLoad={() => setImageLoaded(true)} /> {blurhash && (hidden || !imageLoaded) ? ( - = ({ top: StyleConstants.Spacing.XS / 2, left: StyleConstants.Spacing.XS / 2 }} - > - - + /> ) : null} ) diff --git a/src/components/Timelines/Timeline/Shared/Attachment/Audio.tsx b/src/components/Timelines/Timeline/Shared/Attachment/Audio.tsx index 08e645c8..9feb5e1b 100644 --- a/src/components/Timelines/Timeline/Shared/Attachment/Audio.tsx +++ b/src/components/Timelines/Timeline/Shared/Attachment/Audio.tsx @@ -4,10 +4,9 @@ import { Slider } from '@sharcoux/slider' import { StyleConstants } from '@utils/styles/constants' import { useTheme } from '@utils/styles/ThemeManager' import { Audio } from 'expo-av' -import { Surface } from 'gl-react-expo' -import { Blurhash } from 'gl-react-blurhash' import React, { useCallback, useState } from 'react' import { StyleSheet, View } from 'react-native' +import { Blurhash } from 'react-native-blurhash' import attachmentAspectRatio from './aspectRatio' import analytics from '@components/analytics' @@ -63,16 +62,15 @@ const AttachmentAudio: React.FC = ({ > {sensitiveShown ? ( - audio.blurhash && ( - - - - ) + /> + ) : null ) : ( <> {audio.preview_url && ( diff --git a/src/components/Timelines/Timeline/Shared/Attachment/Unsupported.tsx b/src/components/Timelines/Timeline/Shared/Attachment/Unsupported.tsx index 7e5f150b..8c47a1ba 100644 --- a/src/components/Timelines/Timeline/Shared/Attachment/Unsupported.tsx +++ b/src/components/Timelines/Timeline/Shared/Attachment/Unsupported.tsx @@ -3,11 +3,10 @@ import Button from '@components/Button' import openLink from '@components/openLink' import { StyleConstants } from '@utils/styles/constants' import { useTheme } from '@utils/styles/ThemeManager' -import { Blurhash } from 'gl-react-blurhash' -import { Surface } from 'gl-react-expo' import React from 'react' import { useTranslation } from 'react-i18next' import { StyleSheet, Text, View } from 'react-native' +import { Blurhash } from 'react-native-blurhash' import attachmentAspectRatio from './aspectRatio' export interface Props { @@ -34,15 +33,14 @@ const AttachmentUnsupported: React.FC = ({ ]} > {attachment.blurhash ? ( - - - + /> ) : null} {!sensitiveShown ? ( <> diff --git a/src/components/Timelines/Timeline/Shared/Attachment/Video.tsx b/src/components/Timelines/Timeline/Shared/Attachment/Video.tsx index 63538ebb..df0f218f 100644 --- a/src/components/Timelines/Timeline/Shared/Attachment/Video.tsx +++ b/src/components/Timelines/Timeline/Shared/Attachment/Video.tsx @@ -1,10 +1,9 @@ import Button from '@components/Button' import { StyleConstants } from '@utils/styles/constants' import { Video } from 'expo-av' -import { Surface } from 'gl-react-expo' -import { Blurhash } from 'gl-react-blurhash' import React, { useCallback, useRef, useState } from 'react' import { Pressable, StyleSheet, View } from 'react-native' +import { Blurhash } from 'react-native-blurhash' import attachmentAspectRatio from './aspectRatio' import analytics from '@components/analytics' @@ -85,14 +84,13 @@ const AttachmentVideo: React.FC = ({ {sensitiveShown ? ( video.blurhash ? ( - - - + /> ) : null ) : (