Cache Reanimated worklets (#7068)
* Undo perf hackfix * Bump Reanimated to include https://github.com/software-mansion/react-native-reanimated/pull/6758 * Bump to 3.17.0-nightly-20241211-17e89ca24
This commit is contained in:
+1
-1
@@ -181,7 +181,7 @@
|
|||||||
"react-native-picker-select": "^9.3.1",
|
"react-native-picker-select": "^9.3.1",
|
||||||
"react-native-progress": "bluesky-social/react-native-progress",
|
"react-native-progress": "bluesky-social/react-native-progress",
|
||||||
"react-native-qrcode-styled": "^0.3.3",
|
"react-native-qrcode-styled": "^0.3.3",
|
||||||
"react-native-reanimated": "^3.16.3",
|
"react-native-reanimated": "3.17.0-nightly-20241211-17e89ca24",
|
||||||
"react-native-root-siblings": "^4.1.1",
|
"react-native-root-siblings": "^4.1.1",
|
||||||
"react-native-safe-area-context": "4.14.0",
|
"react-native-safe-area-context": "4.14.0",
|
||||||
"react-native-screens": "~4.3.0",
|
"react-native-screens": "~4.3.0",
|
||||||
|
|||||||
@@ -1,11 +1,6 @@
|
|||||||
import React, {useCallback, useEffect} from 'react'
|
import React, {useCallback, useEffect} from 'react'
|
||||||
import {NativeScrollEvent} from 'react-native'
|
import {NativeScrollEvent} from 'react-native'
|
||||||
import {
|
import {interpolate, useSharedValue, withSpring} from 'react-native-reanimated'
|
||||||
interpolate,
|
|
||||||
makeMutable,
|
|
||||||
useSharedValue,
|
|
||||||
withSpring,
|
|
||||||
} from 'react-native-reanimated'
|
|
||||||
import EventEmitter from 'eventemitter3'
|
import EventEmitter from 'eventemitter3'
|
||||||
|
|
||||||
import {ScrollProvider} from '#/lib/ScrollContext'
|
import {ScrollProvider} from '#/lib/ScrollContext'
|
||||||
@@ -20,18 +15,6 @@ function clamp(num: number, min: number, max: number) {
|
|||||||
return Math.min(Math.max(num, min), max)
|
return Math.min(Math.max(num, min), max)
|
||||||
}
|
}
|
||||||
|
|
||||||
const V0 = makeMutable(
|
|
||||||
withSpring(0, {
|
|
||||||
overshootClamping: true,
|
|
||||||
}),
|
|
||||||
)
|
|
||||||
|
|
||||||
const V1 = makeMutable(
|
|
||||||
withSpring(1, {
|
|
||||||
overshootClamping: true,
|
|
||||||
}),
|
|
||||||
)
|
|
||||||
|
|
||||||
export function MainScrollProvider({children}: {children: React.ReactNode}) {
|
export function MainScrollProvider({children}: {children: React.ReactNode}) {
|
||||||
const {headerHeight} = useShellLayout()
|
const {headerHeight} = useShellLayout()
|
||||||
const {headerMode} = useMinimalShellMode()
|
const {headerMode} = useMinimalShellMode()
|
||||||
@@ -42,7 +25,11 @@ export function MainScrollProvider({children}: {children: React.ReactNode}) {
|
|||||||
const setMode = React.useCallback(
|
const setMode = React.useCallback(
|
||||||
(v: boolean) => {
|
(v: boolean) => {
|
||||||
'worklet'
|
'worklet'
|
||||||
headerMode.set(v ? V1.get() : V0.get())
|
headerMode.set(() =>
|
||||||
|
withSpring(v ? 1 : 0, {
|
||||||
|
overshootClamping: true,
|
||||||
|
}),
|
||||||
|
)
|
||||||
},
|
},
|
||||||
[headerMode],
|
[headerMode],
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -16047,10 +16047,10 @@ react-native-qrcode-styled@^0.3.3:
|
|||||||
qrcode "^1.5.4"
|
qrcode "^1.5.4"
|
||||||
react-fast-compare "^3.2.2"
|
react-fast-compare "^3.2.2"
|
||||||
|
|
||||||
react-native-reanimated@^3.16.3:
|
react-native-reanimated@3.17.0-nightly-20241211-17e89ca24:
|
||||||
version "3.16.3"
|
version "3.17.0-nightly-20241211-17e89ca24"
|
||||||
resolved "https://registry.yarnpkg.com/react-native-reanimated/-/react-native-reanimated-3.16.3.tgz#3b559dca49e9e40abcf5de834dc27fc05f856b66"
|
resolved "https://registry.yarnpkg.com/react-native-reanimated/-/react-native-reanimated-3.17.0-nightly-20241211-17e89ca24.tgz#af0c36e278646eb2f79e28ad0047cfd80d0e29f5"
|
||||||
integrity sha512-OWlA6e1oHhytTpc7WiSZ7Tmb8OYwLKYZz29Sz6d6WAg60Hm5GuAiKIWUG7Ako7FLcYhFkA0pEQ2xPMEYUo9vlw==
|
integrity sha512-5p7jr0DrnID1puOzMel3VZVRw5Hl/UdMUvPCI1sEG9IA2mUaWrgeoojS2wVwW1U0Pj6HXjPNEimDSXZneZKNuQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@babel/plugin-transform-arrow-functions" "^7.0.0-0"
|
"@babel/plugin-transform-arrow-functions" "^7.0.0-0"
|
||||||
"@babel/plugin-transform-class-properties" "^7.0.0-0"
|
"@babel/plugin-transform-class-properties" "^7.0.0-0"
|
||||||
|
|||||||
Reference in New Issue
Block a user