On Tue, Aug 12, 2014 at 1:04 PM, Ilya Grigorik <igrigo...@gmail.com> wrote:
>
> I'm still trying to wrap my head around the use case, but I'm with you on 
> this so far...
[snip]
> It seems like there are two cases to consider here:
> (a) You're on a page with the same base template as destination
> (b) You're navigating to a page with a different base template

Agreed.

> For (a), you're best off reusing the current context (it's already rendered, 
> after all), and issuing a fetch for updated content and rendering it in place 
> - with pushState, etc.

Yup.

> Whereas for (b) you can also do it in place by prefetching the template and 
> then issuing a data request for relevant data once you know the exact URL... 
> Which, of course, is exactly how single-page apps work today.

I don't understand what you are saying here.

The point of (b) is that the different base templates. So it'd be very
hard to use pushState and DOM mutations to morph the current page into
the destination page. The fact that the destination page is template
based doesn't make it any easier.

Consider for example google search and google calendar. The google
search page is very template based. I.e. while the contents of a
search result is varies, there's a lot of template content that is
shared between all search result pages.

If Google calendar included a "search the web" box, which when used
would navigate the user to a google search result page. It would be
very hard for google calendar to use pushState and DOM mutations to
transform a calendar page into a search result page.

Not only would the DOM need to be replaced. You'd also need to load
any scripts that google search depends on. And unload any script state
that google calendar had created and that might interfere with the
google search scripts.

This is essentially as hard as morphing the current page into a
completely different non-template-based webpage unless I'm missing
something.

It would be much more practically doable for calendar instead to
prerender a blank search result page, and then once the user commits
the search tell that prerendered page what the search parameters are
such that the page can load and render the appropriate search data.

/ Jonas
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to