Hi @mkemp
Thanks for providing the context. I think the use cases for this feature are largely outside the context of Confluence-rendered pages, but in cases where vendors still want to use the WRM for declaration of resources.
For example, I believe Remie’s example is used for generating iframes from a servlet that should not have any Confluence boilerplate JS loaded.
My use case is rendering a separate page (outside of main Confluence pages, without any chrome). The changes to this functionality in Confluence 9 broke a particular feature, because the page first loads a vendor version of jQuery with a specific function extension enabled. The new scripts forced by C9 will defer-load their own copy of jQuery, which blows away the first jQuery (effectively removing the function extension), which breaks later page rendering.
@remie might be able to fix his specific problem by calling drainIncludedSyncResources
instead of drainIncludedResources
, because the former seems to disable the stuff-in-extra-JS piece. Unfortunately, no such option seems to be easily accessible from Velocity.
I am hoping to avoid having to replicate the DefaultWebResourceAssembler
in vendor code (this seems like it will be fragile and hard to keep working properly cross-major, among other things). For now, I have settled on calling the helper from Java rather than Velocity and then filtering out the resources I do not want from the returned String, but the underlying function would ideally be reverted back to pre-C9 behavior.