Design document: Zones
======================

This is the third attempt to do this, since we removed 2 earlier implementations.

V1: [up-zone]
-------------

Strategy:

- Links preferred to update their closest zone, which was an ancestor [up-zone] or the layer
- Zone mains were configured with up.layer.config.zone.mainTargets
- For this UpdateLayer would go through all possible zone mains and turn each into a selector string

Abandoned because:

- Zones still needed a unique ID
- Zoned views always needed to re-render their zone
- Auto-"improving" every target selector with up.element.toSelector() didn't feel good

V2: :closest()
--------------

Strategy:

- Links could target to a parent element with .parent:closest
- Unpoly would then create a selector string for that parent element
- We could also target another element within a closest parent with .parent:closest .other

Abandoned because:

- Targeted elements still needed a unique ID
- Linking elements still needed to know about their parents. I would much prefer parents
  to control the behavior of thei children. We have success with that patterns in overlay,
  where content in overlays do not need to know about a parent interaction.

V3: [up-frame]
--------------

- Maybe we were to quick to dismiss the old [up-zone] idea
  - Yes it was impractical that the zoned content always needed to render the [up-zone]
  - But maybe we don't need to have an absolute selector for both sides if the lookup considers the origin zone
  - We also don't need to support the case that the other side might have many components
    - In any list case (Ambulance, Deskbot), actions would update from the member resource, not the collection
- What I really want is box in multiple copies of a partial.
  Any links should default to updating the box instead of the layer :main

  <up-frame>
    <div class="inner"> <!-- up.frame.get(element).firstSwappableElement() -->
      <a href="/foo" up-follow> <!-- will update this .inner, even if other .inners are in the same page -->
    </div>
  </up-frame>

- How do we break out of the frame?
  - I think frames should be isolated from their parents, but parents can replace their children
  - Escape with [up-frame=parent] or [up-frame=layer]

- If we do frame isolation, we will need to update all functions currently { layer } option
  and also allow them a { frame } option.
- Do we want up.frame.get(element).on()? .emit()? .affix()?
- The server gets up.frame.emit?
- frame or zone?
- I think the Layer should be its own frame, possibly implement up.Frame.


