-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve performance #1257
Improve performance #1257
Conversation
🦋 Changeset detectedLatest commit: 141fa4a The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
1d940a2
to
da068cf
Compare
da068cf
to
a8d7604
Compare
Related to #1252
a8d7604
to
4510431
Compare
import { enableFreeze } from 'react-native-screens' | ||
|
||
enableFreeze(true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current version of screens/freeze integration, freezes updates only on views that are more than one level deep the stack hierarchy (the top and second to top screens are not freezing). This is necessary for slide-to-go-back functionality to work as by sliding back we may reveal the content that is displayed below. This is something we plan on improving in the future such that only the top screen is not frozen.
https://github.com/software-mansion/react-freeze?tab=readme-ov-file#quick-start-with-react-navigation-react-native-
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing the WC code that kept the app running in the bg
@@ -154,7 +154,7 @@ const AddressAnimatedBackground = ({ addressHash }: Pick<AddressDetailsModalHead | |||
|
|||
if (!address) return null | |||
|
|||
return <AnimatedBackground shade={address.settings.color} isAnimated /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the main new component that enables animation and gyroscope only when the screen is in focus. The energy consumption remains as it was before when the user remains on the Dashboard, but it significantly reduces in every other screen 👍
Below you can see the difference between being on the Dashboard screen and being on the Addresses screen on a dark theme (half left is the Dashboard, half right is the Addresses)
![image](https://private-user-images.githubusercontent.com/1579899/412509811-98836082-4751-4981-920d-5b8ff2f869a8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2MTU1NDYsIm5iZiI6MTczOTYxNTI0NiwicGF0aCI6Ii8xNTc5ODk5LzQxMjUwOTgxMS05ODgzNjA4Mi00NzUxLTQ5ODEtOTIwZC01YjhmZjJmODY5YTgucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTVUMTAyNzI2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9Zjk2Mzk5MWQ5ODcwMDY1MzFhODUyMzc0Y2NiMWUwZTNmMTQ4ZmRlNWI3Yzk0NzU3MTAxNWRlNTZlYjg0ZjFlNCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.38lZUKCry-aHr6D024TdFag09R2AKw72qB8hUbn5yMc)
@@ -20,4 +20,11 @@ config.resolver.nodeModulesPaths = [ | |||
// Use turborepo to restore the cache when possible | |||
config.cacheStores = [new FileStore({ root: path.join(projectRoot, 'node_modules', '.cache', 'metro') })] | |||
|
|||
config.transformer.minifierConfig = { | |||
compress: { | |||
// The option below removes all console logs statements in production. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome. Great step forward!
Related to: