Skip to content

Architecture

roux g. buciu edited this page Apr 16, 2024 · 1 revision

This page is intended as a brief description of our general architecture philosophies within the code base and links to some topics elaborating on how to incorporate them into contributions.

Much of the code in this project is very old and has decayed significantly since it was first written. This can make it pretty difficult to work with in many spots because it’s hard to read and difficult to foresee all the impacts a given code change might have. The development team is currently making active efforts to modernize and improve the codebase in order to make it easier to work with and maintain.

Architecture

BrowserKit

One of the steps we have taken is to introduce a local Swift package called BrowserKit. This package contains several libraries that take on specific responsibilities within the app. Read more about when and how to add to this package here:

Modern Swift Tools (SwiftUI & Swift Concurrency & Combine)

We want to encourage the use of new technologies in the codebase where it makes sense. The codebase currently has some SwiftUI and some Swift Concurrency and we plan to use more of these patterns going forward. However we do need to be careful with how we use these technologies as they can do more harm than good when used carelessly. See the pages below on details for how we want to incorporate these technologies going forward.

At this point in time we do not intend to use Combine.

Extensions

In the current codebase there are many anti-patterns used consistently throughout that we are trying to move away from. One of these anti-patterns is the overuse of extensions. Please see the page below for more info on which use cases are acceptable and which use cases we would like to move away from.

New Patterns

Some new patterns we are working on introducing into the project are Redux and the coordinator pattern.

SwiftUI vs UIKit

When faced with the choice between SwiftUI and UIKit, refer to the attached decision tree diagram to determine the appropriate approach for your specific project needs. SwiftUI Decision Tree

Navigation & Coordinators

Work is ongoing to incorporate coordinators, see the link below on how to make use of these during development.

Redux

Work has not yet begun on incorporating Redux but we intend to start introducing this in the near future. See more info in the link below on what it is and how we intend to use it.

Event Queue

The Event Queue is a new API for managing enqueued actions that can depend upon or more events or states in the app.

Clone this wiki locally