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

Consider adding a boolean to disable GlobalSnapshotManager.ensureStarted() call during scene creation #4800

Open
JakeWharton opened this issue May 10, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request runtime Compose runtime problem to be considered

Comments

@JakeWharton
Copy link

I am building Compose UI for a target you do not support using your repo. Thanks for all the hard work I can easily build upon!

It's hard to build Compose UI for targets which do not have Dispatchers.Main available from coroutines due to the global snapshot manager. I have a UI thread in my app, but it doesn't exist until I create it as part of app initialization. It is not known at the time that this library (well, compose-multiplatform-core) is being compiled.

I would like to set my GlobalSnapshotManagerDispatcher actual to throw when accessed, and instead initialize code similar to the implementation of global snapshot manager myself (before creating my scene).

Would you be open to a boolean flag for scene creation that disables the call to GlobalSnapshotManager.ensureStarted() in BaseComposeScene?

Of course, I could just disable this call myself, but I would prefer to leave the common sources untouched so that my changes are solely within source sets for the new target.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request runtime Compose runtime problem to be considered
Projects
None yet
Development

No branches or pull requests

3 participants