Opencord: Difference between revisions

Jump to navigation Jump to search
Link to Wikipedia instead of official site
m (add category)
(Link to Wikipedia instead of official site)
Line 13: Line 13:
==Architecture==
==Architecture==


Opencord is written in [https://kotlinlang.org Kotlin] with the use of [https://developer.android.com/jetpack/compose Jetpack Compose], a modern declarative native UI framework for Android. Most of the codebase is based on dependency injection with [https://insert-koin.io Koin], in such a way that it would be theoretically testable in the future. While basic gateway functionality lives independently, most of the complex logic, including caching and live state, lives in [https://github.com/MateriiApps/OpenCord/tree/4e9ed5e92a2879e4e1ccc7aea9b53499e3110f6f/app/src/main/java/com/xinto/opencord/store Stores], a concept taken from the original Discord codebase.
Opencord is written in [[wikipedia:Kotlin_(programming_language)|Kotlin]] with the use of [https://developer.android.com/jetpack/compose Jetpack Compose], a modern declarative native UI framework for Android. Most of the codebase is based on dependency injection with [https://insert-koin.io Koin], in such a way that it would be theoretically testable in the future. While basic gateway functionality lives independently, most of the complex logic, including caching and live state, lives in [https://github.com/MateriiApps/OpenCord/tree/4e9ed5e92a2879e4e1ccc7aea9b53499e3110f6f/app/src/main/java/com/xinto/opencord/store Stores], a concept taken from the original Discord codebase.


While most of the UI is broken up into small <code>@Composable</code> components, complex UI was wrongly implemented, leading to dozens of recomposition issues that took an insane amount of effort to fix. Additionally, due to the idiomaticity of Compose, complex UI components can be split up into the layout and content, where invoking the layout forces you to provide all the content to the layout. This led to a lot of repetitiveness throughout the codebase, quickly becoming [https://github.com/MateriiApps/OpenCord/blob/4e9ed5e92a2879e4e1ccc7aea9b53499e3110f6f/app/src/main/java/com/xinto/opencord/ui/screens/home/panels/chat/ChatLoaded.kt#L80-L285 unmaintainable]. While this was eventually planned to be refactored out, that never happened. This has been taken into consideration regarding future projects of the developers and it hasn't happened to this extent since.
While most of the UI is broken up into small <code>@Composable</code> components, complex UI was wrongly implemented, leading to dozens of recomposition issues that took an insane amount of effort to fix. Additionally, due to the idiomaticity of Compose, complex UI components can be split up into the layout and content, where invoking the layout forces you to provide all the content to the layout. This led to a lot of repetitiveness throughout the codebase, quickly becoming [https://github.com/MateriiApps/OpenCord/blob/4e9ed5e92a2879e4e1ccc7aea9b53499e3110f6f/app/src/main/java/com/xinto/opencord/ui/screens/home/panels/chat/ChatLoaded.kt#L80-L285 unmaintainable]. While this was eventually planned to be refactored out, that never happened. This has been taken into consideration regarding future projects of the developers and it hasn't happened to this extent since.
47

edits

Navigation menu