Support for @Entry macro
Open
Nobody has claimed this yet.
enhancement
- Dominant language
- Swift
- Stars
- 330
- Forks
- 76
- Avg merge
- 3h 6m
- Merged PRs (30d)
- 1
Description
The @Entry macro is a nice shorthand for needing to make a custom EnvironmentKey. It would be nice is Skip supported it. E.g.:
struct SomeView: View {
@Environment(\. myCustomValue) var myCustomValue: String
var body: some View { … }
}
could be implemented with:
extension EnvironmentValues {
@Entry var myCustomValue: String = "Default value"
@Entry var anotherCustomValue = true
}
instead of:
private struct MyCustomValueKey: EnvironmentKey {
static let defaultValue = "Default value"
}
extension EnvironmentValues {
public var myCustomValue: String {
get { self[MyCustomValueKey.self] }
set { self[MyCustomValueKey.self] = newValue }
}
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with Apple's @Entry documentation and the existing EnvironmentValues and EnvironmentKey support in Skip. Trace how SwiftUI environment declarations are translated for Android, then verify that the examples support default values and multiple custom entries without requiring manually defined keys.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- mobile
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100