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

Use objc2 #1049

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open

Use objc2 #1049

wants to merge 1 commit into from

Conversation

madsmtm
Copy link
Contributor

@madsmtm madsmtm commented Jan 21, 2025

I suspect it'll take a while before winit will be in a state where tao can use that directly, so in the meantime, let's slowly start transitioning tao to objc2. I tried to make this transition in a way that minimizes the amount of code changes, but it's really hard to separate things out, so it ended up being quite large anyways.

Full disclosure: The biggest reason why I'm doing this is to reduce the number of dependencies on objc across the ecosystem, I don't intend on fully finishing the transition in tao / making full use of the features offered by objc2 (hopefully winit will be ready to be usable for you one day).
But I think even this initial transition can be valuable to you, as it fixes at least some of the memory leaks currently present, and makes it easier to develop new features (including visionOS support).

I've tested every example on macOS 14.7.1, and on Mac Catalyst (works very poorly here, but at least we don't trigger any obvious encoding validation errors).

Builds upon #1048.
Fixes the last part of tauri-apps/wry#1239.

CC @pewsheen since you did the work in wry.

@madsmtm
Copy link
Contributor Author

madsmtm commented Jan 21, 2025

Though I guess rejecting this PR would push me towards working more on getting Winit into a state where tao can use it as a dependency... ;)

Copy link
Contributor

github-actions bot commented Jan 21, 2025

Package Changes Through e9008dd

There are 1 changes which include tao with minor

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
tao 0.31.1 0.32.0

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

@amrbashir
Copy link
Member

Though I guess rejecting this PR would push me towards working more on getting Winit into a state where tao can use it as a dependency... ;)

No way, objc2 is awesome and I would accept this PR asap but I don't have macOS test, @pewsheen @FabianLars can any of you test and review this PR?

@amrbashir amrbashir closed this Jan 21, 2025
@amrbashir amrbashir reopened this Jan 21, 2025
@amrbashir
Copy link
Member

oops..

@amrbashir
Copy link
Member

ofc the ultimate goal is to go back to winit as a dependency. I was thinking about creating a crate that uses git submodule to generate a glue code that re-exports winit on macOS and Windows, and delegates onto gtk on Linux, although I think a Platfrom trait that could be implemented externally could be the better way to go.

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