I'm starting to think over how to implement being able to have components contribute css/js type assets into the Shell component automatically and have run into a one way or the other sort of decision.
Method 1: Because the Shell component will almost always come first before any other component, the only way to allow these global contributions in a normal sense would be to create a NestedMarkupWriter that Shell hands off to render it's body with. This has major drawbacks in that the memory footprint of a page render will grow very large(or not, depending on your pages implementation..), as well as the negative impact of content not being written to the client as it is found, making percieved response times of apps slower. Method 2: The way I'd like to do it, but don't even know if is possible would be to use IComponentSpecification instances of all the components involved in a response to allow the Shell to iterate over and determine the global assets ahead of time. This sounds like the more "correct" way to do things, but also makes me question how reasonable this is to do. It would almost be like doing a rewind cycle the way forms do to parse out submitted values. I can't imagine it will be as simple as just iterating over some assets as they must somehow change sometimes during loops or other application specific logic. My gut says Method 1 is going to win, but if someone can point out an obvious way that Method 2 is safe I'd definitely be willing to explore that path. jesse
