badoo/Decompose

How does Decompose handle routing with dynamic feature components?

moffpage opened this issue ยท 4 comments

Hello! I've watched this video earlier today: https://www.youtube.com/watch?v=iURWvHxTM3k&list=LL&index=4 and it got me curios, what does Decompose offer for its clients for dynamic feature loading?

I remember @rustamsmax used Decompose and Dynamic Features, could you please share your experience?

Dynamic module is platform specific feature.
When I implemented it I created feature availability checker class andfeature rendererclass using reflection.
I passed the checker class to decompose component which use it to decide when routing screens. If featureA available it navigates to HomeA else HomeMain.
For the ui I passed the renderer class via ambients. When decompose component navigates to HomeA this class is used to render featureA ui.
If it's multi platform project you can create fake checkers for desktop app which will return always true.

Here is my project module tree where I used dynamic features
image

I will think about adding an example for dynamic features.

Oh God, that'd be amazing!