frisodr (2) [Avatar] Offline
#1
Hi,

I'm going through the book and loving it. Finally I'm able to understand much more of what is going on behind the covers of some popular frameworks like angular etc and chapter 2 about hoisting was brilliant. However there is one thing I can't get my head around and that is how you would handle a lot of different urls (pages) with very different features on them without overloading the shell.js.

Example:
Let's say we are building some sort of blogging engine and to begin with we have a postoverview and postdetail screen.
-> http://www.myawesomebloggingengine.com -> post overview url
-> http://www.myawesomebloggingengine.com/1 -> post detail url

Both can have their own urlanchors for history events. Both use different feature modules.

Would you create one shell.js that does all the orchestration between feature modules and handles the different urianchors for the overview and detail page (I believe in a big application this will overload the shell.js). Or would you rather have one shell.js that initializes depending on the url the overview_shell.js and the detail_shell.js. The overview_shell.js and detail_shell.js will then handle all the orchestration between their feature modules and handle the specific urianchor func for this specific page.

How do you normally go about this?

Cheers
F
mtrainham (1) [Avatar] Offline
#2
Re: How to organize SPA's with multiple pages that have different functionality
This is a good question that I'm also interested in, so I'm hoping Mike will answer this. I'm having a similar problem where I have a main site 'domain.com' and I have 'apps.domain.com' where each app ('apps.domain.com/app1') will be it's own spa, but it still needs to inherit js, css, and html from domain.com. I'm not sure how the namespacing and shell would work in this case.
michael.mikowski (247) [Avatar] Offline
#3
Re: How to organize SPA's with multiple pages that have different functionality
My answer to this is shown in my presentation "the fog of SPA" which was shown in the spring HTML5 developer conference and can be found at https://github.com/mmikowski/spa. The core idea is to plan for many spas and create a common layer for use by all. Please review this doc and let me know if you have further questions!

Cheers, Mike