Wicket
  1. Wicket
  2. WICKET-4273

Rendering of resources in the header with dependency resolving and support for bundles

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 6.0.0-beta1
    • Fix Version/s: 6.0.0-beta1
    • Component/s: wicket
    • Labels:
      None

      Description

      The current API for resources does not allow resources to define dependencies nor does it provide native support for bundles. In short, a resource reference should be able to define that it requires other resources to be available as well, much like AbstractResourceDependentResourceReference does. This support should be part of ResourceReference itself and should not be limited to just references (anything that can be added to a header can be a dependency).

      Furthermore, many have requested support for resource bundles. A bundle combines several resources of the same type into one. When a bundle is rendered, all resources that are part of the bundle should not be rendered, otherwise you'll end up with duplicate resources. Although it is often requested that all resources should be combined into one (or two, a js and a css), I do not believe this is a good solution as there is no way of knowing which page requires which resources. In the worst case, this will cause every page to contain a different permutation of resources, requiring the user to download all resources again and again for every page. Therefore, the bundles require the developer to manually register bundles. If one resource from a bundle is required, the bundle will rendered instead.

      Finally, the default HeaderResponse renders many script tags for onDomReady and onLoad scripts. These scripts should be combined into one or two script tags.

      I'm currently working on implementing these features at Github. My progress can be found at https://github.com/papegaaij/wicket/tree/wicket+wiquery

      1. WICKET-4273.patch
        1.16 MB
        Emond Papegaaij

        Activity

        Hide
        Martin Grigorov added a comment -
        Show
        Martin Grigorov added a comment - The URL that I like better is: https://github.com/papegaaij/wicket/compare/trunk...wicket%2Bwiquery
        Hide
        Igor Vaynberg added a comment -

        this needs to be brought up on the mailing list so more devs can see it. not everyone watches jira....

        Show
        Igor Vaynberg added a comment - this needs to be brought up on the mailing list so more devs can see it. not everyone watches jira....
        Hide
        Martin Grigorov added a comment -
        Show
        Martin Grigorov added a comment - It is already: http://markmail.org/message/sq3vyuxe4hjjac67
        Hide
        Igor Vaynberg added a comment -

        now that there is some actual code the mission statement from the description and the link to the code should be posted in its own thread so people can start discussing the code itself...it should also be noted that the discussion should happen on our mailing list and not in the github commits so that its visible here...

        unfortunately we dont yet use github, so non-trivial features should be discussed on our MLs

        Show
        Igor Vaynberg added a comment - now that there is some actual code the mission statement from the description and the link to the code should be posted in its own thread so people can start discussing the code itself...it should also be noted that the discussion should happen on our mailing list and not in the github commits so that its visible here... unfortunately we dont yet use github, so non-trivial features should be discussed on our MLs
        Hide
        Emond Papegaaij added a comment -

        I've disabled the 2 testcases in AjaxHeaderContributionTest, because those fail and can't be fixed easily. For these testcases, WICKET-4000 needs to be fixed first. Probably by rendering wicket:head through IHeaderResponse.

        Show
        Emond Papegaaij added a comment - I've disabled the 2 testcases in AjaxHeaderContributionTest, because those fail and can't be fixed easily. For these testcases, WICKET-4000 needs to be fixed first. Probably by rendering wicket:head through IHeaderResponse.
        Hide
        Emond Papegaaij added a comment -

        This patch contains all the work described in this ticket, including the fix for WICKET-4091 and WICKET-4247.

        Show
        Emond Papegaaij added a comment - This patch contains all the work described in this ticket, including the fix for WICKET-4091 and WICKET-4247 .
        Hide
        Emond Papegaaij added a comment -

        Revised patch that fixes testcase failures and adds some Args.notNull checks

        Show
        Emond Papegaaij added a comment - Revised patch that fixes testcase failures and adds some Args.notNull checks

          People

          • Assignee:
            Martin Grigorov
            Reporter:
            Emond Papegaaij
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development