Open stevenzeck opened 2 years ago
No more updates for swiftui?
New screens are built using SwiftUI (e.g. the pending Settings API PR), but converting existing screens is not high priority so progress is going slow. @gatamar and @stevenzeck have been contributing great PRs for this but I currently have my plate quite full and didn't have time to follow-up on this yet.
@wisarmy Sorry, I've been busy with a new job and don't have time to continue with this right now. It was coming along though, OPDS is nearly finished, and adding books from a URL or on the device and removing them should be straightforward. I know @gatamar has a PR out for opening books.
Hey there just a heads up I'm going to try to take a stab at integrating the latest changes from main and will also try to get @gatamar's PR over the line. Just FYI in case anyone is also working on this branch ATM.
Sorry guys, I'm unavailable as of now. Will be happy if my branch is useful in any way. As far as I remember there were 2 main challenges: SwiftUI navigation and rewriting some (Promise based?) code to async await. Regarding the first challenge, I'm still not sure if SwiftUI is mature enough to easily do what we wanted to achieve. Regarding the second challenge, sorry for the unfinished code - I know how to do it now, but have no time :)
On Mon, 22 May 2023 at 21:49, Jordan @.***> wrote:
Hey there just a heads up I'm going to try to take a stab at integrating the latest changes from main and will also try to get @gatamar https://github.com/gatamar's PR over the line. Just FYI in case anyone is also working on this branch ATM.
— Reply to this email directly, view it on GitHub https://github.com/readium/swift-toolkit/issues/60#issuecomment-1557862597, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOSN2O3LM4GCTXZF5RTQSDXHO7LHANCNFSM5YBIHSCQ . You are receiving this because you were mentioned.Message ID: @.***>
@gatamar Thanks for summarizing the issues and taking a stab at it in the first place!
@jpollard-cs Sure, that would be welcome. But since it's complicated to get a full SwiftUI rewrite done in one go, I'm thinking we should change the strategy and do more incremental changes based on and synchronized with main
. Here's a proposition:
swiftui
to be on par with main
, feature-wise (doesn't need to be perfect regarding SwiftUI).swiftui
into main
.AppDelegate
, etc.).What do you think?
I talked with @stevenzeck, here are some additional comments:
async/await
, it can be done incrementally, without deleting the existing promise/completion code. This will help avoid having to convert all the UIKit code to async/await
.My main concern is that keeping a swiftui
branch separate without having someone committed to finalizing it and then merging it in main
means that it will likely become obsolete, like we're seeing now. That's why I'm advocating for incremental changes based on main
.
Apologies if this is the wrong place to ask, but is it possible to convert TestApp to async await with the current streamer.open
API and strict concurrency checking? I'm having trouble doing so as Publication
is not Sendable
.
You might be able to pass it around with an async
wrapper if you create a wrapping class or struct with @unchecked Sendable
. I didn't try it though.
struct PublicationWrapper: @unchecked Sendable {
let publication: Publication
}
Be careful as Publication
is not thread-safe, you should not call its methods concurrently.
Thanks. My question was unclear. I was referring to your comment on May 23 where you noted the goal to "Migrate existing Test App Promise/completion-block based APIs to async/await."
I'm not trying to share Publication
s across threads, just create one using structured concurrency. In other words, I want to be able to let pub = await streamer.open(...)
. I tried to do this using withCheckedContinuation
around streamer.open()
and it fails with strict concurrency checking.
It should work if you use the technique I described in the previous comment, as long as you don't use any API on Publication
concurrently.
I created a PR as a soft restart of this effort: #460. It does not incorporate anything from #240, but that PR would be a great place to continue moving forward.
This is a long-term issue. We will continually to make incremental changes to
develop
/main
. No changes should be made that break UIKit functionality. It is ok to create additional functions that do the same thing as an existing one. For example, adding an async/await based function for SwiftUI in addition to the existing promise/completion based one that is used by UIKit.General
Reader
Bookshelf
OPDS feeds
OPDS Feed Detail
Publication Detail
About