skiptools / skiptools/skip

Transpile Compose `@Preview`s from SwiftUI `#Preview`

Open
#588 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Swift
Stars
3.2k
Forks
106
Avg merge
6d 13h
Merged PRs (30d)
1

Description

It's convenient to see @Previews in Android Studio. As it stands, I have to write a lot of complicated boilerplate for this:

#if SKIP
@Preview(showBackground = true)
@Composable
fun WelcomeViewPreview() {
    ProcessInfo.launch(LocalContext.current)
    Surface(
        modifier = Modifier.fillMaxSize(),
        color = MaterialTheme.colorScheme.background
    ) {
        WelcomeView(welcomeName = Binding.constant("Skipper"))
            .Compose(context = ComposeContext())
    }
}
#else
#Preview {
    WelcomeView(welcomeName: Binding.constant("Skipper"))
}
#endif

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how SwiftUI #Preview declarations are currently transpiled and how existing SKIP preview handling maps to Android Compose. The work is done when the concise #Preview example produces the equivalent Compose @Preview behavior without the conditional boilerplate shown in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, swift
Domain
compilers, mobile-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.