How <dependency> element of Web Resource module works

Hi all,

Accordingly to documentation

Dependencies for the web resource module. A web resource can depend on other web resource(s) to be available.

Could anyone clarify the meaning? Does it mean that

  1. Confluence automatically includes required dependency when our web resource is available
  2. Our resource will be only enabled when the dependency is available in the current context

Some information related to macros auto-convert

    <!-- This will ensure the resource is loaded after autoconvert, and only if autoconvert is enabled. -->

It seems that my web resource won’t load if a required dependency is not available.

Yes - and it will make sure it will be loaded before your web resource in the batch.js. It will also load css, images etc from that resource…

It depends on the product - in some products if a dependency doesn’t exist there will be an error in the logs, in others your app won’t be included in the resources, in some (Jira) it will just be ignored silently. If you’re depending on a non-atlassian provided dependency - I would test to see what the behavior is when the dependency is missing.

1 Like