Skip to content

Merging ViewRegistries inside ViewEnvironments is a nightmare. #395

@rjrjr

Description

@rjrjr

There are a couple of issues:

  • When you plus() two ViewEnvironments, entries are completely replaced, there are no merge hooks
  • When you plus() two ViewRegistry's, if they have any redundant entries an exception is thrown

For the former, perhaps we can build optional merge hooks into ViewEnvironmentKey?

For the latter, I'm hard pressed to think of any bugs we have caught by throwing, but I can come up of lots of examples where we had to struggle mightily to work around it. How about if we document that entries in the registry on the right in a ViewRegistry.plus() call will clobber those on the left? We could offer a strict variant, or even default to it, but I can't really imagine when I'd use it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    uiRelated to UI integration

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions