Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-9657

Same-name JS Use dependencies are not always correctly resolved

    XMLWordPrintableJSON

Details

    Description

      When solving JS dependencies using the resource-type hierarchy, the resolution is not always correct.

      Example content structure:

      /apps/page/
          page.html
          head.js
      /apps/project/page
          [sling:resourceSuperType=page]
          page.html
          partials/
              head.html
              head.js
      

      Example calling model:
      /apps/project/page/page.html

      <div data-sly-include="partials/head.html}"></div>
      

      /apps/project/page/partials/head.html

      <div data-sly-use.head="head.js"></div>
      

      With the above setup, the head.js script being select is the one from /apps/page/head.js, instead of the file inside partials. While this takes the resource type hierarchy into consideration, the correct caller is partials/head.html, hence why the resolution should happen "locally".

      Attachments

        Issue Links

          Activity

            People

              radu Radu Cotescu
              radu Radu Cotescu
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: