From 6e3753ed4ec5edb90544ae1f4fc21f74cc58029f Mon Sep 17 00:00:00 2001 From: Evan Kaloudis Date: Tue, 14 Nov 2023 13:28:20 -0500 Subject: [PATCH] deps: remove react-native-skia --- components/BlurGradient.tsx | 86 ------------------------------ components/Glassmorphism.tsx | 43 --------------- components/Splash.tsx | 70 ------------------------ ios/Podfile.lock | 8 --- ios/zeus.xcodeproj/project.pbxproj | 2 + package.json | 1 - views/IntroSplash.tsx | 14 +++-- yarn.lock | 28 ---------- 8 files changed, 12 insertions(+), 240 deletions(-) delete mode 100644 components/BlurGradient.tsx delete mode 100644 components/Glassmorphism.tsx delete mode 100644 components/Splash.tsx diff --git a/components/BlurGradient.tsx b/components/BlurGradient.tsx deleted file mode 100644 index 454511d0b..000000000 --- a/components/BlurGradient.tsx +++ /dev/null @@ -1,86 +0,0 @@ -import type { ReactNode } from 'react'; -import React from 'react'; -import { Dimensions } from 'react-native'; -import { Fill, Shader, Skia } from '@shopify/react-native-skia'; - -type Value = string | number; -type Values = Value[]; - -const glsl = (source: TemplateStringsArray, ...values: Values) => { - const processed = source.flatMap((s, i) => [s, values[i]]).filter(Boolean); - return processed.join(''); -}; - -const frag = (source: TemplateStringsArray, ...values: Values) => { - const code = glsl(source, ...values); - const rt = Skia.RuntimeEffect.Make(code); - if (rt === null) { - throw new Error("Couln't Compile Shader"); - } - return rt; -}; - -// https://shaders.skia.org/?id=60604463f3a8a2eb0449541c10cac16d30772b34bb76ce7058374bb02226f9c8 -// https://www.shadertoy.com/view/4lXXWn -const source = frag` -uniform shader iImage1; -uniform shader mask; -uniform float2 iResolution; - -vec3 draw(vec2 uv) { - return iImage1.eval(uv * iResolution).rgb; -} - -float grid(float var, float size) { - return floor(var*size)/size; -} - -float rand(vec2 co){ - return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453); -} - -const float repeats = 60; -vec4 main(vec2 fragCoord) -{ - vec2 uv = (fragCoord / iResolution); - float bluramount = mix(0, 0.1, mask.eval(fragCoord).a); - vec3 blurred_image = vec3(0.); - for (float i = 0.; i < repeats; i++) { - vec2 q = vec2( - cos(degrees((i / repeats) * 360.)), - sin(degrees((i / repeats) * 360.))) * (rand(vec2(i, uv.x + uv.y)) + bluramount); - vec2 uv2 = uv + (q * bluramount); - blurred_image += draw(uv2) / 2.; - //One more to hide the noise. - q = vec2(cos(degrees((i / repeats) * 360.)), sin(degrees((i / repeats) * 360.))) * - (rand(vec2(i + 2., uv.x + uv.y + 24.)) + bluramount); - uv2 = uv + (q * bluramount); - blurred_image += draw(uv2) / 2.; - } - blurred_image /= repeats; - return vec4(blurred_image, 1.0); -} -`; - -interface BlurGradientProps { - children: ReactNode | ReactNode[]; - mask: ReactNode; -} - -const { width, height } = Dimensions.get('window'); - -export const BlurGradient = ({ children, mask }: BlurGradientProps) => { - return ( - - - {children} - {mask} - - - ); -}; diff --git a/components/Glassmorphism.tsx b/components/Glassmorphism.tsx deleted file mode 100644 index f95de7c46..000000000 --- a/components/Glassmorphism.tsx +++ /dev/null @@ -1,43 +0,0 @@ -import { Dimensions } from 'react-native'; - -import { - BackdropBlur, - Canvas, - Circle, - Group, - rect, - Rect, - ImageSVG, - useSVG -} from '@shopify/react-native-skia'; -import React from 'react'; - -const { height, width } = Dimensions.get('window'); - -const clipRect = rect(0, 0, width, height); - -const r = 15; - -export const Glassmorphism = () => { - const image = useSVG( - 'https://upload.wikimedia.org/wikipedia/commons/f/fd/Ghostscript_Tiger.svg' - ); - return ( - - - - - - - - - - - ); -}; diff --git a/components/Splash.tsx b/components/Splash.tsx deleted file mode 100644 index 0f2e5f657..000000000 --- a/components/Splash.tsx +++ /dev/null @@ -1,70 +0,0 @@ -import { - Canvas, - useImage, - ImageShader, - vec, - LinearGradient, - RadialGradient -} from '@shopify/react-native-skia'; -import React from 'react'; -import { Dimensions, StyleSheet, View } from 'react-native'; -import Animated, { - useAnimatedScrollHandler, - useSharedValue -} from 'react-native-reanimated'; - -import { BlurGradient } from '../components/BlurGradient'; - -const { width, height } = Dimensions.get('window'); - -export default function BlurGradientDemo(props: any) { - const image = useImage(require('../assets/images/hyper.jpg')); - const scrollY = useSharedValue(0); - - const onScroll = useAnimatedScrollHandler({ - onScroll: ({ contentOffset: { y } }) => { - scrollY.value = -y; - } - }); - - return ( - - - - {false && ( - - )} - - - } - > - - - - - - {props.children} - - - ); -} diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 8d5b4419b..b15ad40d6 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -348,10 +348,6 @@ PODS: - React-Core - react-native-safe-area-context (0.6.4): - React - - react-native-skia (0.1.213): - - React - - React-callinvoker - - React-Core - react-native-tor (0.1.8): - React - react-native-udp (4.1.7): @@ -568,7 +564,6 @@ DEPENDENCIES: - react-native-randombytes (from `../node_modules/react-native-randombytes`) - react-native-restart (from `../node_modules/react-native-restart`) - react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`) - - "react-native-skia (from `../node_modules/@shopify/react-native-skia`)" - react-native-tor (from `../node_modules/react-native-tor`) - react-native-udp (from `../node_modules/react-native-udp`) - React-NativeModulesApple (from `../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios`) @@ -689,8 +684,6 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native-restart" react-native-safe-area-context: :path: "../node_modules/react-native-safe-area-context" - react-native-skia: - :path: "../node_modules/@shopify/react-native-skia" react-native-tor: :path: "../node_modules/react-native-tor" react-native-udp: @@ -803,7 +796,6 @@ SPEC CHECKSUMS: react-native-randombytes: 3638d24759d67c68f6ccba60c52a7a8a8faa6a23 react-native-restart: 7595693413fe3ca15893702f2c8306c62a708162 react-native-safe-area-context: 52342d2d80ea8faadd0ffa76d83b6051f20c5329 - react-native-skia: 4327dd69d3272313b91ea753a2d6dd5d9bebba42 react-native-tor: 3b14e9160b2eb7fa3f310921b2dee71a5171e5b7 react-native-udp: df79c3cb72c4e71240cd3ce4687bfb8a137140d5 React-NativeModulesApple: 797bc6078d566eef3fb3f74127e6e1d2e945a15f diff --git a/ios/zeus.xcodeproj/project.pbxproj b/ios/zeus.xcodeproj/project.pbxproj index a8026d54c..6a02bd152 100644 --- a/ios/zeus.xcodeproj/project.pbxproj +++ b/ios/zeus.xcodeproj/project.pbxproj @@ -2128,6 +2128,7 @@ "-ld_classic", "-Wl", "-ld_classic", + "-Wl -ld_classic ", ); REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; @@ -2201,6 +2202,7 @@ "-ld_classic", "-Wl", "-ld_classic", + "-Wl -ld_classic ", ); REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; diff --git a/package.json b/package.json index 281ee86e9..80d308049 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,6 @@ "@react-navigation/bottom-tabs": "5.11.11", "@react-navigation/native": "6.0.16", "@remobile/react-native-qrcode-local-image": "github:BlueWallet/react-native-qrcode-local-image#31b0113", - "@shopify/react-native-skia": "^0.1.213", "@tradle/react-native-http": "2.0.1", "@types/dateformat": "5.0.0", "@types/react-native-snap-carousel": "3.8.5", diff --git a/views/IntroSplash.tsx b/views/IntroSplash.tsx index e8617abae..236e1468f 100644 --- a/views/IntroSplash.tsx +++ b/views/IntroSplash.tsx @@ -2,6 +2,7 @@ import * as React from 'react'; import { BackHandler, Dimensions, + ImageBackground, NativeEventSubscription, View, SafeAreaView, @@ -23,8 +24,6 @@ import { createLndWallet } from '../utils/LndMobileUtils'; import { localeString } from '../utils/LocaleUtils'; import { themeColor } from '../utils/ThemeUtils'; -import SplashView from '../components/Splash'; - import TresArrows from '../assets/images/SVG/TresArrows.svg'; interface IntroSplashProps { @@ -143,7 +142,14 @@ export default class IntroSplash extends React.Component< flex: 1 }} > - + - + ); diff --git a/yarn.lock b/yarn.lock index 18ea4f044..848a6aaa6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2112,14 +2112,6 @@ "@noble/hashes" "~1.3.0" "@scure/base" "~1.1.0" -"@shopify/react-native-skia@^0.1.213": - version "0.1.213" - resolved "https://registry.yarnpkg.com/@shopify/react-native-skia/-/react-native-skia-0.1.213.tgz#ed308e1e949f827c0b92df8d7eddfc561bf9a528" - integrity sha512-JaJfVccTYHeVPrhW+GrLHrwwi49m+nsrfNlJs+jauKD1qgBjGD7gWaJlTHdj/yDpse/5nDj4FiceVe8RccHYVQ== - dependencies: - canvaskit-wasm "0.38.2" - react-reconciler "^0.27.0" - "@sideway/address@^4.1.3": version "4.1.4" resolved "https://registry.yarnpkg.com/@sideway/address/-/address-4.1.4.tgz#03dccebc6ea47fdc226f7d3d1ad512955d4783f0" @@ -3628,11 +3620,6 @@ caniuse-lite@^1.0.30001539: resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001541.tgz#b1aef0fadd87fb72db4dcb55d220eae17b81cdb1" integrity sha512-bLOsqxDgTqUBkzxbNlSBt8annkDpQB9NdzdTbO2ooJ+eC/IQcvDspDc058g84ejCelF7vHUx57KIOjEecOHXaw== -canvaskit-wasm@0.38.2: - version "0.38.2" - resolved "https://registry.yarnpkg.com/canvaskit-wasm/-/canvaskit-wasm-0.38.2.tgz#b6c2be236670fd0f18977b9026652b2c0e201fee" - integrity sha512-ieRb6DO4yL91qUfyRgmyhp2Hi1KmQ9lIMfKacxHVlfp/CpKCkzgAxRGUbCsJFzwLKjs9fufGrIyvnzEYRwm1XQ== - catharsis@^0.9.0: version "0.9.0" resolved "https://registry.yarnpkg.com/catharsis/-/catharsis-0.9.0.tgz#40382a168be0e6da308c277d3a2b3eb40c7d2121" @@ -8393,14 +8380,6 @@ react-navigation@4.4.4: "@react-navigation/core" "^3.7.9" "@react-navigation/native" "^3.8.4" -react-reconciler@^0.27.0: - version "0.27.0" - resolved "https://registry.yarnpkg.com/react-reconciler/-/react-reconciler-0.27.0.tgz#360124fdf2d76447c7491ee5f0e04503ed9acf5b" - integrity sha512-HmMDKciQjYmBRGuuhIaKA1ba/7a+UsM5FzOZsMO2JYHt9Jh8reCb7j1eDC95NOyUlKM9KRyvdx0flBuDvYSBoA== - dependencies: - loose-envify "^1.1.0" - scheduler "^0.21.0" - react-refresh@^0.4.0: version "0.4.3" resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.4.3.tgz#966f1750c191672e76e16c2efa569150cc73ab53" @@ -8743,13 +8722,6 @@ scheduler@0.24.0-canary-efb381bbf-20230505: dependencies: loose-envify "^1.1.0" -scheduler@^0.21.0: - version "0.21.0" - resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.21.0.tgz#6fd2532ff5a6d877b6edb12f00d8ab7e8f308820" - integrity sha512-1r87x5fz9MXqswA2ERLo0EbOAU74DpIUO090gIasYTqlVoJeMcl+Z1Rg7WHz+qtPujhS/hGIt9kxZOYBV3faRQ== - dependencies: - loose-envify "^1.1.0" - scheduler@^0.23.0: version "0.23.0" resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.23.0.tgz#ba8041afc3d30eb206a487b6b384002e4e61fdfe"