Some facts i learned about recomposition: - var is always considered Unstable. It is the same concept with Phillip's List example. - viewModel is always unstable. - lambda may be stable or not, based on every "global" object you use inside it, for example using viewModel or var (not mutable state) will cause the function unskipable. For details, lambdas are anonymous classes keeping 1) the lambda content itself and 2) every objects that lambda is using other than parameters itself holds P/s: Overusing @Stable and @Immutable will sometimes make funny moments when your UI seems to not update instead log say yes 😂
Great video. Honestly seems a bit silly to have to wrap a list with a state class just to mark it as stable. Would be awesome if we can eventually just annotate single params like you did at 6:38. Will probably stick to the ImmutableList approach because of this (provided the list doesn't merge well into an existing state)
Every youtuber: How to make a simple todo list app in jetpack compose Philipp: Hey guys! Let's learn some advance topic Me: Why philipp is not uploading new video!!
Great Video. I wanna take the chance to ask for a new tutorial of a chat app using ktor and websockets, since the last one was about 2 years ago and is mostly deprecated... In my case the initial project couldn't even be built.
How about the code below? Does it can be a problem too? @Immutable data class User( val name: String, val age: Int ) { var address: String = "" } you can see the 'address' with Var in the body of the data class. Does it could be a bad performance?
If you annotate a class as @Immutable which implies that the data class can never change, but it does and creates a new instance, wouldn't that have an impact on assigning more memory to accommodate the new instance.and also invoke recoposition?
Don't know why >my layout inspector can't detect any component tree. I tried almost all the solutions from stack and from internet. But seems like on of them works. hedgehog
My problem with programming is it takes me like a hundred lines of code before i know when to use such annotation or any other concept. Optimization is such a headache but is a very crucial part when coding
Suggestion, webview with kmp compose, as large companies use it, reason for use, code push on the website that the webview accesses, feature delivered faster, Cloud scalability, micro frontEnd, micro service in the cloud
@@cursedfunction Market needs, code push, kotlin or swift do not have code push, the market finds webview solutions. Nowadays large companies use webview, for native code @JavascriptInterface, in the end they are creating a meta browser
Some facts i learned about recomposition:
- var is always considered Unstable. It is the same concept with Phillip's List example.
- viewModel is always unstable.
- lambda may be stable or not, based on every "global" object you use inside it, for example using viewModel or var (not mutable state) will cause the function unskipable. For details, lambdas are anonymous classes keeping 1) the lambda content itself and 2) every objects that lambda is using other than parameters itself holds
P/s: Overusing @Stable and @Immutable will sometimes make funny moments when your UI seems to not update instead log say yes 😂
Thanks for the video.
Can't wait for another full project tutorial
Thank you for helping us to boost up our app performance.
Great video. Honestly seems a bit silly to have to wrap a list with a state class just to mark it as stable. Would be awesome if we can eventually just annotate single params like you did at 6:38. Will probably stick to the ImmutableList approach because of this (provided the list doesn't merge well into an existing state)
It's great for me that I started compose thank you sir
Every youtuber: How to make a simple todo list app in jetpack compose
Philipp: Hey guys! Let's learn some advance topic
Me: Why philipp is not uploading new video!!
Awesome...Philipp...😎😎
Great Video. I wanna take the chance to ask for a new tutorial of a chat app using ktor and websockets, since the last one was about 2 years ago and is mostly deprecated...
In my case the initial project couldn't even be built.
This would be awesome.
Maybe recomposition becomes because your `var selected` is out of Column?
Cool. Also would like to see your video about performance and how to profile app using android studio’s profiler.
Really helpful video. Plz make a video on Defer state reads and state hoisting.
how do you notify compose compiler that @Stable object has changed? or how do you pass a new instance of @Imutable anotated class?
Thanks, that was very helpful
How about the code below? Does it can be a problem too?
@Immutable
data class User(
val name: String,
val age: Int
) {
var address: String = ""
}
you can see the 'address' with Var in the body of the data class. Does it could be a bad performance?
Please why is Horizontal pager lagging so much, even after optimising recompositions.
Great explanation
This is so helpful 👏
How does this apply if we use ViewModels for UI state management?
Exactly the same. It's all about the class you use as a state aka model for the functions marked @Composable
If you annotate a class as @Immutable which implies that the data class can never change, but it does and creates a new instance, wouldn't that have an impact on assigning more memory to accommodate the new instance.and also invoke recoposition?
it's just a shallow copy, reorganizing the external Compose components, and most of the internal components will be skipped
thank you bro
Why var is allowed in an @Immutable object?
@@LightDante the annotation is just a promise that you fulfill the requirements, but there won't be any checks whether that's the case
Don't know why >my layout inspector can't detect any component tree. I tried almost all the solutions from stack and from internet. But seems like on of them works. hedgehog
Seem like you change list to immutableList, if my list is still mutable, there is no way to prevent ContactList re-composed right ?
you marked the class as @Stable but it would have been better if you try to update the state to showcase its stability
My problem with programming is it takes me like a hundred lines of code before i know when to use such annotation or any other concept. Optimization is such a headache but is a very crucial part when coding
Very very good 👍 🎉
There is more info about @Stable when we have custom modifiers
Sir, is your online course lifetime if i buy it ? i still consider it to buy
yes :)
goat
I coming from flutter 😂😂 and I was think that jetpack compose does not have the same way
Suggestion, webview with kmp compose, as large companies use it, reason for use, code push on the website that the webview accesses, feature delivered faster, Cloud scalability, micro frontEnd, micro service in the cloud
Please don’t do this. Use the right tool for the job. WebViews are not the do-it-all tool that some folks try to make them out to be.
@@cursedfunction Market needs, code push, kotlin or swift do not have code push, the market finds webview solutions. Nowadays large companies use webview, for native code @JavascriptInterface, in the end they are creating a meta browser
It's horrible.
It's only good to update the "app" faster. It's basically a webpage not an app.
I hate webview bad performance
soy tu fanboy
Jetpack Compose is terrible!
They had a chance to switch to a modern paradigm and they made dog poop.
Everything is hacky and complex.