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

Proposal: Use objc2 and its framework crates #1239

Open
madsmtm opened this issue Apr 30, 2024 · 5 comments
Open

Proposal: Use objc2 and its framework crates #1239

madsmtm opened this issue Apr 30, 2024 · 5 comments

Comments

@madsmtm
Copy link
Contributor

madsmtm commented Apr 30, 2024

objc2 is the successor to objc, which includes a bunch of improvements, especially wrt. memory management. Additionally, it provides the objc2-foundation, objc2-app-kit and objc2-web-kit crates, which would be very useful for wry to decrease the amount of error-prone manual binding code. Finally, the declare_class! macro would be useful for creating wry's delegate classes.

I begun on the transition a little bit in this branch, but realized it's gonna be a lot of work, so wanted to get some feedback first (or ideally: get someone else to do the work ;) ).

We should also migrate to it in muda, tray-icon (tauri-apps/tray-icon#172), window-vibrancy, tao, tauri, tauri-runtime-wry and so on, but doing that in these crates is substantially less work (updating tao to a newer Winit should fix it automatically, and the rest are fairly small), and can be done in parallel.

@amrbashir
Copy link
Member

amrbashir commented May 1, 2024

Thanks for reaching out, this has been a task on our radar for a while now but we didn't have the time to go through it yet.

iirc @pewsheen have started to migrate wry to objc2 in refactor/migrate-to-objc2 branch but not sure what's the progress on that (so pinging him for status update).

As for tao:

updating tao to a newer Winit should fix it automatically, and the rest are fairly small

Not sure what you mean by that, do you mean manually copying from winit repo or did the work on allowing a external backend has landed?

As for other crates, I agree they are substantially less work and I could help migrating them once wry has migrated.

@madsmtm
Copy link
Contributor Author

madsmtm commented May 1, 2024

Not sure what you mean by that, do you mean manually copying from winit repo or did the work on allowing a external backend has landed?

I meant when / if you manually copied commits from the Winit repo, not sure how you usually do Winit upgrades in tao.

Allowing external backends isn't yet possible, if you want to wait for that then that's fine by me ;).

@amrbashir
Copy link
Member

Not sure what you mean by that, do you mean manually copying from winit repo or did the work on allowing a external backend has landed?

I meant when / if you manually copied commits from the Winit repo, not sure how you usually do Winit upgrades in tao.

yeah I usually just manually copy the code and attribute the original PR and its author. Anyways, it is probably very hard to copy the current macOS backend from winit to tao as the two have diverged a lot and probably will take the same effort (if not more) as wry to migrate.

Allowing external backends isn't yet possible, if you want to wait for that then that's fine by me ;).

That would be the optimal solution ofc, but if I ever get some time, I may think of an interim solution like maybe using git patches to patch our gtk backend on top of winit.

@eugenehp
Copy link

eugenehp commented Jun 4, 2024

How can I help?

I'm knee deep into Tao right now, so maybe it could be first thing I can help migrate to objc2. Let me know your priorities.

@amrbashir
Copy link
Member

Tao isn't really prioritized for such refactors, but we can never turn down contributions. Thanks for contributing ❤️

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

No branches or pull requests

3 participants