On 11/26/2015 04:10 AM, Wilson Page wrote: > I know both myself and Justin were strongly against the > document-per-view approach when Vivien first suggested it. But having > both worked building apps around this strategy, we can now both clearly > see the advantages (listed by Justin).
For me, whether document-per-view is good depends a lot on how you divide up the views. One concern I had initially were the plans to have each view be a root-level document instead of being nested in an iframe, and to then rely on Navigation Transitions to swap between each view, with some magic to make "common" elements appear to remain in-place (e.g. headers). I'm glad that we didn't try that for Music. It would be a lot more work to make everything look perfect, and would be very error-prone since the UX wouldn't match the app's architecture. Other than that, I have no issue with document-per-view aside from the potential for performance issues. Since we're now dealing with multiple JS compartments, we need to copy more data around, and there are still some issues with the perf on certain actions (tapping the "next track" button is noticeably slower than OGA, for instance). However, I'm reasonably confident that we can eliminate (or at least improve) these issues. There's been a lot of talk about how document-per-view makes it easier to replace existing views. However, another benefit is that for some form factors (e.g. tablet) we can just rearrange the *existing* views to make new UI. Since each view is its own document, it would be easy to show the player view next to the album list view, for instance. With sufficient effort, this can even extend to desktop (although this might entail rewriting the views anyway). Of course, it should be noted that document-per-view isn't strictly necessary for any of this. A well-designed app could do all this in a single document; document-per-view just makes it more obvious what the right way is. :) - Jim _______________________________________________ dev-fxos mailing list [email protected] https://lists.mozilla.org/listinfo/dev-fxos

