Skip to content
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

ObservableObject to @Observable migrations #1458 #1672

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

bryanmontz
Copy link
Contributor

@bryanmontz bryanmontz commented Oct 19, 2024

Issues covered

#1458

Description

Migrates several more classes to use @Observable macro rather than the ObservableObject protocol for the performance gains and general modernization of patterns.

How to test

  1. Navigate to the Note Composer view.

  2. Tap "@" to bring up the user search view.
    Observe that the search fires on key taps.

  3. Navigate to the Note Composer.

  4. Type a note.

  5. Send it.
    Observe that the note was sent.

  6. Navigate to the Discover tab.

  7. Search for something.
    Observe that results appear as you type.

  8. Navigate to your profile view.

  9. Tap the Claim your username button.

  10. Select either set up or already have.

  11. Type in the box.
    Observe that the UI responds as you type.

Screenshots/Video

No intended UI changes, but here are some videos of affected areas of code to show that they still work as expected:

Adding a mention to a note...(shows that the refactored TextDebouncer works)
mention

Posting a note...(shows that RelayService as @Observable works)
posting

Search in Discover...(shows that SearchController as @Observable works)
search

Username search...(shows that SearchController and TextDebouncer work)
username

@bryanmontz bryanmontz self-assigned this Oct 19, 2024
@bryanmontz bryanmontz marked this pull request as draft October 19, 2024 11:58
@Dependency(\.analytics) private var analytics
@Dependency(\.crashReporting) private var crashReporting
@MainActor @Dependency(\.currentUser) private var currentUser
@Published var numberOfConnectedRelays: Int = 0
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This property wasn't being used anywhere.

@bryanmontz bryanmontz marked this pull request as ready for review October 19, 2024 13:07
Copy link
Contributor

@joshuatbrown joshuatbrown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks good to me and works fine. I might still suggest having @mplorentz review since our release is coming up soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants