workflow-kotlin icon indicating copy to clipboard operation
workflow-kotlin copied to clipboard

Consider removing `ViewEnvironment` parameter from `RenderWorkflowIn`

Open rjrjr opened this issue 1 year ago • 0 comments

Look at the anxious section at the end of the original Compose integration writeup. We mainly rationalized passing ViewEnvironment around because it was so fragile WRT ViewRegistry -- things would blow up if there was no ViewRegistry in ViewEnvironment, that kind of thing.

This is no longer the case. ViewRegistry is very much optional, and having a missing or empty one is just fine. And the manually passed ViewEnvironment has been a chronic optmization problem. Maybe we should undo that decision, and make ViewEnvironment just another Compose local.

val LocalWorkflowEnvironment = staticCompositionLocalOf<ViewEnvironment> {
    noLocalProvidedFor("LocalView")
}

rjrjr avatar Jan 09 '24 01:01 rjrjr