Surface / Surface and Bundle

Is a Bundle like a ManagedResource?

No, though a Bundle may provide one. The confusion comes from both having a lifetime tied to Model state:

  • A Bundle owns application truth: it adds Model fields and Message cases to the parent, and its update decides the next slice. Replay, DevTools, and persistence see it.
  • A ManagedResource owns no truth: it provides a handle (socket, EventSource, client) by tag that Commands and Subscriptions use. It never appears in the Model, never has an update, and never produces a Message by itself.

Consequences: two placements of one bundle are two independent Model slices; two users of one resource tag would replace each other, so assemble refuses the second. A bundle with resources cannot be placed per key, for the same tag reason. placements.resources(own) merges the parent's own resources with each placement's, keyed by tag.