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

Remove icrate's custom macros #593

Merged
merged 5 commits into from
Mar 19, 2024
Merged

Remove icrate's custom macros #593

merged 5 commits into from
Mar 19, 2024

Conversation

madsmtm
Copy link
Owner

@madsmtm madsmtm commented Mar 19, 2024

Part of #537.

To be able to split the frameworks out into separate crates, they each need to not depend on anything except objc2, block2, dispatch and each other. This PR takes the first (big) step towards doing so, by removing the custom macros, and avoiding the use of the imports from the common module outside of auto-generated code.

This makes the generated output more verbose, especially since we don't yet have #[derive(Encode, RefEncode)] (see #55), but should also make it easier for newcomers to understand what's going on (since it's "just" using the documented objc2 macros).

@madsmtm madsmtm added enhancement New feature or request A-framework Affects the framework crates and the translator for them labels Mar 19, 2024
madsmtm added 5 commits March 19, 2024 23:06
If `header-translator` will ever provide functionality to convert e.g. `Bool` to `bool` or `*mut` to `Id`, then that should be implemented inline, without the use of an extra macro (since that is also what we'd recommend a manual user to do).
`header-translator` may at some point provide functionality to mark external statics as safe, but then it should implement that without using a helper macro.
In the future, we may introduce a helper for deriving Encode and RefEncode, but for now this will:
1. Make it clearer in the source code what is actually happening.
2. Help users looking at `icrate` get a feel for how they should import external enums themselves.
@madsmtm madsmtm force-pushed the trim-icrate-common branch from 2244325 to e325239 Compare March 19, 2024 22:11
@madsmtm madsmtm merged commit 1905569 into master Mar 19, 2024
18 of 19 checks passed
@madsmtm madsmtm deleted the trim-icrate-common branch March 19, 2024 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-framework Affects the framework crates and the translator for them enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant