bowerstatic icon indicating copy to clipboard operation
bowerstatic copied to clipboard

Include at bottom

Open mrijken opened this issue 10 years ago • 5 comments

For some .js files, it's better to include them at the bottom of the html file. Do we want that feature in bowerstatic?

mrijken avatar Nov 10 '14 23:11 mrijken

Yes, I'd like to support that. We had this in Fanstatic. In Fanstatic I had a whole complicated infrastructure about declaring resources "bottom safe" and including them by default in the bottom of the HTML file if so. I think we need something simpler in BowerStatic; perhaps just an argument to the inclusion so that the developer is in control of this behavior.

Plus perhaps a flag in the bower object that turns bottom includes on or off for all inclusions -- a default for this inclusion flag.

Does that make sense?

faassen avatar Nov 11 '14 09:11 faassen

I just realized that this is related to the renderer (or extension) too. CSS and .ico should never be included at the bottom. So perhaps we should extend the notion of a renderer to also have knowledge about whether can be rendered at the bottom, by default "no".

faassen avatar Nov 11 '14 09:11 faassen

This means it's relevant to issue #34, where we also talk about the renderer infrastructure.

faassen avatar Nov 11 '14 09:11 faassen

See also #37

faassen avatar Nov 18 '14 22:11 faassen

This issue implies we need to have renderer classes that can have a property set inject_bottom or something like that. But this affects the renderer infrastructure somewhat, as now it's function-based. I'd like to retain the function-based API as much as possible but support render classes. So this implies we need to wrap the render functions into a class, probably at the point of registration, if it's a function, with a default of inject_bottom set to False.

faassen avatar Nov 19 '14 16:11 faassen